Gismatullin.ISEbd-21.STO.Co.../ServiceStation/ServiceSourceBusinessLogic/BusinessLogic/ReportWork.cs
2024-04-30 22:40:05 +03:00

33 lines
887 B
C#

using ServiceStationContracts.BindingModels;
using ServiceStationContracts.BusinessLogicContracts;
using ServiceStationContracts.SearchModels;
using ServiceStationContracts.ViewModels;
using ServiceStationsContracts.StorageContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServiceSourceBusinessLogic.BusinessLogic {
public class ReportWork : IReportWorkLogic {
private readonly IWorkStorage _storage;
public ReportWork(IWorkStorage storage) {
_storage = storage;
}
public List<ReportWorkViewModel> GetWorks(ReportWorkBindingModel model) {
return _storage.GetFilteredList(new WorkSearchModel {
Date = model.Date
}).Select(x => new ReportWorkViewModel {
Id = x.Id,
Date = x.Date,
price = x.Price,
WorkStatus = x.Status.ToString(),
}).ToList();
}
}
}