2024-04-29 19:33:15 +04:00
|
|
|
|
using ElectronicsShopContracts.BindingModels;
|
|
|
|
|
using ElectronicsShopContracts.BusinessLogicContracts;
|
|
|
|
|
using ElectronicsShopContracts.SearchModels;
|
|
|
|
|
using ElectronicsShopContracts.StorageContracts;
|
|
|
|
|
using ElectronicsShopContracts.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ElectronicsShopBusinessLogic.BusinessLogic
|
|
|
|
|
{
|
|
|
|
|
public class ReportLogic : IReportLogic
|
|
|
|
|
{
|
|
|
|
|
private readonly IOrderStorage _orderStorage;
|
|
|
|
|
private readonly IProductStorage _productStorag;
|
|
|
|
|
|
|
|
|
|
public ReportLogic(IOrderStorage orderStorage, IProductStorage productStorag) {
|
|
|
|
|
_orderStorage = orderStorage;
|
|
|
|
|
_productStorag = productStorag;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 22:48:51 +04:00
|
|
|
|
// Получение списка заказов за определенный период
|
|
|
|
|
public List<ReportOrdersViewModel> GetOrders(ReportBindingModel model) {
|
|
|
|
|
return _orderStorage.GetFilteredList(new OrderSearchModel {
|
|
|
|
|
DateFrom = model.DateFrom,
|
|
|
|
|
DateTo = model.DateTo,
|
|
|
|
|
}).Select(x => new ReportOrdersViewModel {
|
|
|
|
|
ID = x.ID,
|
|
|
|
|
DateCreate = x.DateCreate,
|
|
|
|
|
Sum = x.Sum,
|
|
|
|
|
PaymeantOption = x.PaymeantOption.ToString(),
|
|
|
|
|
OrderStatus = x.Status.ToString(),
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
2024-04-29 19:33:15 +04:00
|
|
|
|
}
|
|
|
|
|
}
|