2023-04-07 23:28:12 +04:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2023-04-09 00:40:04 +04:00
|
|
|
|
using Microsoft.Identity.Client;
|
2023-04-07 23:28:12 +04:00
|
|
|
|
using SchoolContracts.BusinessLogicsContracts;
|
|
|
|
|
using SchoolContracts.StoragesContracts;
|
|
|
|
|
using SchoolContracts.ViewModels;
|
2023-04-09 00:40:04 +04:00
|
|
|
|
using SchoolDatabaseImplement.Models;
|
|
|
|
|
using SchoolDataModels.Models;
|
|
|
|
|
using SchoolContracts.BindingModel;
|
2023-04-06 22:52:23 +04:00
|
|
|
|
|
|
|
|
|
namespace SchoolContracts.BusinessLogics
|
|
|
|
|
{
|
2023-04-07 23:28:12 +04:00
|
|
|
|
public class ReportLogic : IReportLogic
|
2023-04-06 22:52:23 +04:00
|
|
|
|
{
|
2023-04-07 23:28:12 +04:00
|
|
|
|
private readonly ICircleStorage _circleStorage;
|
2023-04-09 00:40:04 +04:00
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
|
private readonly ICircleExpenseStorage _circleExpenseStorage;
|
2023-04-07 23:28:12 +04:00
|
|
|
|
|
2023-04-09 00:40:04 +04:00
|
|
|
|
public ReportLogic(ILogger logger, ICircleStorage circleStorage,
|
|
|
|
|
ICircleExpenseStorage circleExpenseStorage)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_circleStorage = circleStorage;
|
|
|
|
|
_circleExpenseStorage = circleExpenseStorage;
|
|
|
|
|
}
|
2023-04-07 23:28:12 +04:00
|
|
|
|
/// <summary>
|
2023-04-09 00:40:04 +04:00
|
|
|
|
/// получение занятий по кружку
|
2023-04-07 23:28:12 +04:00
|
|
|
|
/// </summary>
|
2023-04-09 00:40:04 +04:00
|
|
|
|
public List<ReportCircleLessonsViewModel> GetLessonCircles(ReportBindingModel model)
|
2023-04-07 23:28:12 +04:00
|
|
|
|
{
|
2023-04-09 00:40:04 +04:00
|
|
|
|
return _circleStorage.GetLessonCircles(new() { SelectedCirclesIds = model.SelectedCircles});
|
2023-04-07 23:28:12 +04:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2023-04-09 00:40:04 +04:00
|
|
|
|
/// получение затрат кружку
|
2023-04-07 23:28:12 +04:00
|
|
|
|
/// </summary>
|
2023-04-09 00:40:04 +04:00
|
|
|
|
public List<ReportExpensesInCirclesViewModel> GetExpenses (ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
return _circleExpenseStorage.GetExpensesInCircles(new() { DateFrom = model.DateFrom, DateTo = model.DateTo });
|
|
|
|
|
}
|
|
|
|
|
public void SaveComponentsToWordFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveManufactureComponentToExcelFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2023-04-06 22:52:23 +04:00
|
|
|
|
}
|
|
|
|
|
}
|