2023-04-07 19:57:21 +04:00
|
|
|
|
using CarServiceContracts.BindingModels;
|
|
|
|
|
using CarServiceContracts.BusinessLogicsContracts;
|
|
|
|
|
using CarServiceContracts.StorageContracts;
|
|
|
|
|
using CarServiceContracts.ViewModels;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
namespace CarServiceBusinessLogic.BusinessLogics
|
|
|
|
|
{
|
|
|
|
|
public class ReportLogic : IReportLogic
|
|
|
|
|
{
|
|
|
|
|
//private readonly ILogger _logger;
|
|
|
|
|
private readonly IWorkStorage _workStorage;
|
2023-04-08 14:01:54 +04:00
|
|
|
|
private readonly IWorkPaymentStorage _workPaymentStorage;
|
|
|
|
|
public ReportLogic(/*ILogger logger,*/ IWorkStorage workStorage, IWorkPaymentStorage workPaymentStorage)
|
2023-04-07 19:57:21 +04:00
|
|
|
|
{
|
|
|
|
|
//_logger = logger;
|
|
|
|
|
_workStorage = workStorage;
|
2023-04-08 14:01:54 +04:00
|
|
|
|
_workPaymentStorage = workPaymentStorage;
|
2023-04-07 19:57:21 +04:00
|
|
|
|
}
|
|
|
|
|
public List<ReportWorkWithRequestsViewModel> GetRequestsByWorks(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
return _workStorage.GetWorksWithRequest(new() { SelectedWorksIds = model.SelectedWorks });
|
|
|
|
|
}
|
2023-04-08 14:01:54 +04:00
|
|
|
|
public List<ReportWorksWithPaymentsViewModel> GetPayments(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
return _workPaymentStorage.GetPaymentsByWorks(new() {DateFrom = model.DateFrom, DateTo = model.DateTo });
|
|
|
|
|
}
|
2023-04-07 19:57:21 +04:00
|
|
|
|
public void SaveComponentsToWordFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
public void SaveManufactureComponentToExcelFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|