2023-04-04 23:22:23 +04:00
|
|
|
|
using BankYouBankruptBusinessLogic.OfficePackage;
|
|
|
|
|
using BankYouBankruptBusinessLogic.OfficePackage.HelperModels;
|
|
|
|
|
using BankYouBankruptContracts.BindingModels;
|
|
|
|
|
using BankYouBankruptContracts.BusinessLogicsContracts;
|
|
|
|
|
using BankYouBankruptContracts.SearchModels;
|
|
|
|
|
using BankYouBankruptContracts.StoragesContracts;
|
|
|
|
|
using BankYouBankruptContracts.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace BankYouBankruptBusinessLogic.BusinessLogics
|
|
|
|
|
{
|
|
|
|
|
public class ReportCashierLogic : IReportCashierLogic
|
|
|
|
|
{
|
|
|
|
|
private readonly IMoneyTransferStorage _moneyTransferStorage;
|
|
|
|
|
|
|
|
|
|
private readonly ICashWithdrawalStorage _cashWithdrawalStorage;
|
|
|
|
|
|
2023-04-04 23:24:12 +04:00
|
|
|
|
private readonly IAccountStorage _accountStorage;
|
2023-04-04 23:22:23 +04:00
|
|
|
|
|
|
|
|
|
private readonly AbstractSaveToExcelCashier _saveToExcel;
|
|
|
|
|
|
|
|
|
|
private readonly AbstractSaveToWordCashier _saveToWord;
|
|
|
|
|
|
|
|
|
|
private readonly AbstractSaveToPdfCashier _saveToPdf;
|
|
|
|
|
|
|
|
|
|
//инициализируем поля класса через контейнер
|
|
|
|
|
public ReportCashierLogic(IMoneyTransferStorage moneyTransferStorage, ICashWithdrawalStorage cashWithdrawalStorage,
|
|
|
|
|
IAccountStorage accountStorage, AbstractSaveToExcelCashier saveToExcel, AbstractSaveToWordCashier saveToWord,
|
|
|
|
|
AbstractSaveToPdfCashier saveToPdf)
|
|
|
|
|
{
|
|
|
|
|
_moneyTransferStorage = moneyTransferStorage;
|
|
|
|
|
_cashWithdrawalStorage = cashWithdrawalStorage;
|
2023-04-04 23:24:12 +04:00
|
|
|
|
_accountStorage = accountStorage;
|
2023-04-04 23:22:23 +04:00
|
|
|
|
|
|
|
|
|
_saveToExcel = saveToExcel;
|
|
|
|
|
_saveToWord = saveToWord;
|
|
|
|
|
_saveToPdf = saveToPdf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportCashierViewModel>? GetMoneyTransfers(ReportBindingModel model)
|
|
|
|
|
{
|
2023-04-04 23:24:12 +04:00
|
|
|
|
return _moneyTransferStorage.GetFilteredList(new MoneyTransferSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo})
|
2023-04-04 23:22:23 +04:00
|
|
|
|
.Select(x => new ReportCashierViewModel
|
|
|
|
|
{
|
2023-04-04 23:30:30 +04:00
|
|
|
|
DateComplite = x.DateOperation,
|
2023-04-04 23:39:03 +04:00
|
|
|
|
AccountPayeeId = x.AccountPayeeId,
|
|
|
|
|
AccountSenderId = x.AccountSenderId,
|
|
|
|
|
SumOperation = x.Sum
|
2023-04-04 23:22:23 +04:00
|
|
|
|
})
|
|
|
|
|
.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportCashierViewModel>? GetCashWithrawals(ReportBindingModel model)
|
|
|
|
|
{
|
2023-04-04 23:24:12 +04:00
|
|
|
|
return _cashWithdrawalStorage.GetFilteredList(new CashWithdrawalSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo })
|
2023-04-04 23:30:30 +04:00
|
|
|
|
.Select(x => new ReportCashierViewModel
|
2023-04-04 23:22:23 +04:00
|
|
|
|
{
|
2023-04-04 23:39:03 +04:00
|
|
|
|
AccountPayeeId = x.Id,
|
2023-04-04 23:30:30 +04:00
|
|
|
|
DateComplite = x.DateOperation,
|
2023-04-04 23:39:03 +04:00
|
|
|
|
SumOperation = x.Sum
|
2023-04-04 23:22:23 +04:00
|
|
|
|
})
|
|
|
|
|
.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Сохранение мороженных в файл-Word
|
|
|
|
|
public void SaveAccountsToWordFile(ReportBindingModel model)
|
|
|
|
|
{
|
2023-04-04 23:39:03 +04:00
|
|
|
|
throw new NotImplementedException();
|
2023-04-04 23:22:23 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Сохранение заготовок с указаеним изделий в файл-Excel
|
|
|
|
|
public void SaveAccountsToExcelFile(ReportBindingModel model)
|
|
|
|
|
{
|
2023-04-04 23:39:03 +04:00
|
|
|
|
throw new NotImplementedException();
|
2023-04-04 23:22:23 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Сохранение заказов в файл-Pdf
|
|
|
|
|
public void SaveAccountsToPdfFile(ReportBindingModel model)
|
|
|
|
|
{
|
2023-04-04 23:39:03 +04:00
|
|
|
|
throw new NotImplementedException();
|
2023-04-04 23:22:23 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|