я ничего не знаю я дебил
This commit is contained in:
parent
ea30411791
commit
c2d673f9a3
@ -0,0 +1,44 @@
|
|||||||
|
using HardwareShopContracts.BindingModels;
|
||||||
|
using HardwareShopContracts.BusinessLogicsContracts;
|
||||||
|
using HardwareShopContracts.SearchModels;
|
||||||
|
using HardwareShopContracts.StoragesContracts;
|
||||||
|
using HardwareShopContracts.ViewModels;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace HardwareShopBusinessLogic.BusinessLogics.Storekeeper
|
||||||
|
{
|
||||||
|
public class ReportStorekeeperLogic : IReportStorekeeperLogic
|
||||||
|
{
|
||||||
|
private readonly IComponentStorage _componentStorage;
|
||||||
|
private readonly IGoodStorage _goodStorage;
|
||||||
|
private readonly IPurchaseStorage _purchaseStorage;
|
||||||
|
|
||||||
|
public ReportStorekeeperLogic(IComponentStorage componentStorage, IGoodStorage goodStorage, IPurchaseStorage purchaseStorage)
|
||||||
|
{
|
||||||
|
_componentStorage = componentStorage;
|
||||||
|
_goodStorage = goodStorage;
|
||||||
|
_purchaseStorage = purchaseStorage;
|
||||||
|
}
|
||||||
|
public List<ReportBuildGoodViewModel> GetBuildGood(List<GoodViewModel> goods)
|
||||||
|
{
|
||||||
|
var list = new List<ReportBuildGoodViewModel>();
|
||||||
|
|
||||||
|
foreach (var good in goods)
|
||||||
|
{
|
||||||
|
var record = new ReportBuildGoodViewModel
|
||||||
|
{
|
||||||
|
GoodName = good.GoodName,
|
||||||
|
Builds = new()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReportComponentsViewModel> GetComponents(ReportBindingModel model)
|
||||||
|
{
|
||||||
|
var list = new List<ReportComponentsViewModel>();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
using HardwareShopContracts.BindingModels;
|
||||||
|
using HardwareShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace HardwareShopContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IReportStorekeeperLogic
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Получение списка сборок с указанием, в каких товарах используются
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ReportBuildGoodViewModel> GetBuildGood(List<GoodViewModel> goods);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получение сведений по комплектующим за период,
|
||||||
|
/// с указанием в каких товарах и сборках они использовались
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ReportComponentsViewModel> GetComponents(ReportBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -9,5 +9,6 @@ namespace HardwareShopContracts.SearchModels
|
|||||||
public int? UserId { get; set; }
|
public int? UserId { get; set; }
|
||||||
|
|
||||||
public DateTime? DatePurchase { get; set; }
|
public DateTime? DatePurchase { get; set; }
|
||||||
|
public DateTime? DateTo { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
namespace HardwareShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportBuildGoodViewModel
|
||||||
|
{
|
||||||
|
public string GoodName { get; set; } = string.Empty;
|
||||||
|
public List<string> Builds
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = new();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
namespace HardwareShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportComponentsViewModel
|
||||||
|
{
|
||||||
|
public string ComponentName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int TotalCount { get; set; }
|
||||||
|
|
||||||
|
public List<(string GoodOrBuild, int Count)> GoodOrBuilds { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user