2024-04-30 23:27:38 +04:00
|
|
|
|
using ServiceStationContracts.BindingModels;
|
|
|
|
|
using ServiceStationContracts.BusinessLogicsContracts;
|
2024-05-01 00:14:31 +04:00
|
|
|
|
using ServiceStationContracts.SearchModels;
|
|
|
|
|
using ServiceStationContracts.StoragesContracts;
|
2024-04-30 23:27:38 +04:00
|
|
|
|
using ServiceStationContracts.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ServiceStationBusinessLogic.BusinessLogics
|
|
|
|
|
{
|
|
|
|
|
public class ExecutorReportLogic : IExecutorReportLogic
|
|
|
|
|
{
|
2024-05-01 00:14:31 +04:00
|
|
|
|
|
|
|
|
|
private readonly ITechnicalWorkStorage _techWorkStorage;
|
|
|
|
|
private readonly IRepairStorage _repairStorage;
|
|
|
|
|
|
2024-04-30 23:27:38 +04:00
|
|
|
|
public List<ReportWorksViewModel> GetWorks(List<int> Ids)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
public List<ReportCarsViewModel> GetCars(ReportBindingModel model)
|
|
|
|
|
{
|
2024-05-01 00:14:31 +04:00
|
|
|
|
List<ReportCarsViewModel> allList = new List<ReportCarsViewModel>();
|
|
|
|
|
|
|
|
|
|
List<TechnicalWorkViewModel> techWorkList = _techWorkStorage.GetFilteredList(new TechnicalWorkSearchModel
|
|
|
|
|
{
|
|
|
|
|
DateFrom = model.DateFrom,
|
|
|
|
|
DateTo = model.DateTo,
|
|
|
|
|
ExecutorId = model.ExecutorId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
foreach(var techWork in techWorkList)
|
|
|
|
|
{
|
|
|
|
|
foreach(var car in techWork.TechnicalWorkCars.Values)
|
|
|
|
|
{
|
|
|
|
|
allList.Add(new ReportCarsViewModel
|
|
|
|
|
{
|
|
|
|
|
CarNumber = car.CarNumber,
|
|
|
|
|
CarBrand = car.CarBrand,
|
|
|
|
|
WorkType = techWork.WorkType,
|
|
|
|
|
TechnicalWorkDate = techWork.DateStartWork,
|
|
|
|
|
TechnicalWorkPrice = techWork.WorkPrice,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return allList;
|
2024-04-30 23:27:38 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveComponentsToWordFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveRepairComponentToExcelFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|