2023-04-04 19:21:57 +04:00
|
|
|
|
using BankYouBankruptBusinessLogic.OfficePackage.HelperModels;
|
|
|
|
|
using BankYouBankruptBusinessLogic.OfficePackage;
|
|
|
|
|
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 ReportClientLogic : IReportClientLogic
|
|
|
|
|
{
|
|
|
|
|
private readonly ICreditingStorage _creditingStorage;
|
|
|
|
|
private readonly IDebitingStorage _debitingStorage;
|
|
|
|
|
|
|
|
|
|
private readonly AbstractSaveToExcelClient _saveToExcel;
|
|
|
|
|
private readonly AbstractSaveToWordClient _saveToWord;
|
|
|
|
|
private readonly AbstractSaveToPdfClient _saveToPdf;
|
|
|
|
|
|
2023-04-04 19:27:13 +04:00
|
|
|
|
public ReportClientLogic(ICreditingStorage creditingStorage, IDebitingStorage debitingStorage,
|
2023-04-04 19:21:57 +04:00
|
|
|
|
AbstractSaveToExcelClient saveToExcel, AbstractSaveToWordClient saveToWord, AbstractSaveToPdfClient saveToPdf)
|
|
|
|
|
{
|
|
|
|
|
_creditingStorage = creditingStorage;
|
|
|
|
|
_debitingStorage = debitingStorage;
|
|
|
|
|
|
|
|
|
|
_saveToExcel = saveToExcel;
|
|
|
|
|
_saveToWord = saveToWord;
|
|
|
|
|
_saveToPdf = saveToPdf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportClientViewModel>? GetCrediting(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
return _creditingStorage.GetFilteredList(new CreditingSearchModel
|
|
|
|
|
{
|
2023-05-16 16:45:35 +04:00
|
|
|
|
DateFrom = model.DateFrom,
|
|
|
|
|
DateTo = model.DateTo,
|
2023-04-04 19:21:57 +04:00
|
|
|
|
}).Select(x => new ReportClientViewModel
|
|
|
|
|
{
|
|
|
|
|
CardId = x.CardId,
|
|
|
|
|
SumOperation = x.Sum,
|
2023-05-16 16:45:35 +04:00
|
|
|
|
DateComplite = x.DateOpen
|
2023-04-04 19:21:57 +04:00
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportClientViewModel>? GetDebiting(ReportBindingModel model)
|
|
|
|
|
{
|
2023-04-04 19:27:13 +04:00
|
|
|
|
return _debitingStorage.GetFilteredList(new DebitingSearchModel
|
|
|
|
|
{
|
2023-05-16 16:45:35 +04:00
|
|
|
|
DateTo = model.DateFrom,
|
|
|
|
|
DateFrom = model.DateTo,
|
2023-04-04 19:27:13 +04:00
|
|
|
|
}).Select(x => new ReportClientViewModel
|
|
|
|
|
{
|
|
|
|
|
CardId = x.CardId,
|
|
|
|
|
SumOperation = x.Sum,
|
2023-05-14 15:14:30 +04:00
|
|
|
|
DateComplite = x.DateClose
|
2023-04-04 19:27:13 +04:00
|
|
|
|
}).ToList();
|
2023-04-04 19:21:57 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveCreditingToExcelFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveCreditingToPdfFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveCreditingToWordFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveDebitingToExcelFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveDebitingToPdfFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveDebitingToWordFile(ReportBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|