2023-04-07 23:28:12 +04:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using SchoolContracts.BusinessLogicsContracts;
|
|
|
|
|
using SchoolContracts.StoragesContracts;
|
|
|
|
|
using SchoolContracts.ViewModels;
|
|
|
|
|
using System;
|
2023-04-06 22:52:23 +04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
private readonly IExpenseStorage _expenseStorage;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение списка кружков с указанием списка затрат по ним
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public List<ReportViewModel> GetCircles()
|
|
|
|
|
{
|
|
|
|
|
var expenses = _expenseStorage.GetFullList();
|
|
|
|
|
var circles = _circleStorage.GetFullList();
|
|
|
|
|
var list = new List<ReportViewModel>();
|
|
|
|
|
foreach(var circle in circles)
|
|
|
|
|
{
|
|
|
|
|
var record = new ReportViewModel
|
|
|
|
|
{
|
|
|
|
|
CircleNumber = circle.Id,
|
|
|
|
|
Expenses = new List<ReportExpensesViewModel>(),
|
|
|
|
|
CircleCount = 0
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
foreach (var expense in expenses)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
list.Add(record);
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение списка занятий за определенный период
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
|
|
|
|
/// <returns></returns>
|
2023-04-06 22:52:23 +04:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|