This commit is contained in:
Programmist73 2023-04-04 23:22:39 +04:00
commit 17c796bc0f
8 changed files with 129 additions and 24 deletions

View File

@ -0,0 +1,99 @@
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 IAccountStorage _accauntStorage;
private readonly ICardStorage _cardStorage;
private readonly ICashierStorage _cashierStorage;
private readonly ICashWithdrawalStorage _cashWithdrawalStorage;
private readonly IClientStorage _clientStorage;
private readonly ICreditingStorage _creditingStorage;
private readonly IDebitingStorage _debitingStorage;
private readonly IMoneyTransferStorage _moneyTransferStorage;
private readonly AbstractSaveToExcelClient _saveToExcel;
private readonly AbstractSaveToWordClient _saveToWord;
private readonly AbstractSaveToPdfClient _saveToPdf;
public ReportClientLogic(IAccountStorage accauntStorage, ICardStorage cardStorage, ICashierStorage cashierStorage,
ICashWithdrawalStorage cashWithdrawalStorage, IClientStorage clientStorage, ICreditingStorage creditingStorage,
IDebitingStorage debitingStorage, IMoneyTransferStorage moneyTransferStorage,
AbstractSaveToExcelClient saveToExcel, AbstractSaveToWordClient saveToWord, AbstractSaveToPdfClient saveToPdf)
{
_accauntStorage = accauntStorage;
_cardStorage = cardStorage;
_cashierStorage = cashierStorage;
_cashWithdrawalStorage = cashWithdrawalStorage;
_clientStorage = clientStorage;
_creditingStorage = creditingStorage;
_debitingStorage = debitingStorage;
_moneyTransferStorage = moneyTransferStorage;
_saveToExcel = saveToExcel;
_saveToWord = saveToWord;
_saveToPdf = saveToPdf;
}
public List<ReportClientViewModel>? GetCrediting(ReportBindingModel model)
{
return _creditingStorage.GetFilteredList(new CreditingSearchModel
{
dateFrom = model.DateFrom,
dateTo = model.DateTo,
}).Select(x => new ReportClientViewModel
{
CardId = x.CardId,
SumOperation = x.Sum,
DateComplite = x.Date
}).ToList();
}
public List<ReportClientViewModel>? GetDebiting(ReportBindingModel model)
{
throw new NotImplementedException();
}
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();
}
}
}

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace BankYouBankruptBusinessLogic.OfficePackage
{
public abstract class AbstractSaveToPdfCLient
public abstract class AbstractSaveToPdfClient
{
//публичный метод создания документа. Описание методов ниже
public void CreateDoc(PdfInfo info)

View File

@ -11,15 +11,19 @@ namespace BankYouBankruptContracts.BusinessLogicsContracts
{
public interface IReportClientLogic
{
List<ReportClientViewModel>? GetCards(ReportBindingModel model);
List<ReportClientViewModel>? GetCrediting(ReportBindingModel model);
List<ReportClientViewModel>? GetDebiting(ReportBindingModel model);
//Сохранение отчёта по картам в файл-Word
void SaveCardsToWordFile(ReportBindingModel model);
void SaveCreditingToWordFile(ReportBindingModel model);
void SaveDebitingToWordFile(ReportBindingModel model);
//Сохранение отчёта по картам в файл-Excel
void SaveCardsToExcelFile(ReportBindingModel model);
void SaveCreditingToExcelFile(ReportBindingModel model);
void SaveDebitingToExcelFile(ReportBindingModel model);
//Сохранение отчёта по картам в файл-Pdf
void SaveCardsToPdfFile(ReportBindingModel model);
void SaveCreditingToPdfFile(ReportBindingModel model);
void SaveDebitingToPdfFile(ReportBindingModel model);
}
}

View File

@ -14,6 +14,8 @@ namespace BankYouBankruptContracts.SearchModels
public int? Sum { get; set; }
public DateTime? date { get; set; }
public DateTime? dateFrom { get; set; }
public DateTime? dateTo { get; set; }
}
}

View File

@ -14,6 +14,8 @@ namespace BankYouBankruptContracts.SearchModels
public int? Sum { get; set; }
public DateTime? date { get; set; }
public DateTime? dateFrom { get; set; }
public DateTime? dateTo { get; set; }
}
}

View File

@ -9,18 +9,18 @@ using System.Threading.Tasks;
namespace BankYouBankruptContracts.StoragesContracts
{
public interface IDebitingStorage
public interface ICreditingStorage
{
List<DebitingViewModel> GetFullList();
List<CreditingViewModel> GetFullList();
List<DebitingViewModel> GetFilteredList(DebitingSearchModel model);
List<CreditingViewModel> GetFilteredList(CreditingSearchModel model);
DebitingViewModel? GetElement(DebitingSearchModel model);
CreditingViewModel? GetElement(CreditingSearchModel model);
DebitingViewModel? Insert(DebitingBindingModel model);
CreditingViewModel? Insert(CreditingBindingModel model);
DebitingViewModel? Update(DebitingBindingModel model);
CreditingViewModel? Update(CreditingBindingModel model);
DebitingViewModel? Delete(DebitingBindingModel model);
CreditingViewModel? Delete(CreditingBindingModel model);
}
}

View File

@ -9,18 +9,18 @@ using System.Threading.Tasks;
namespace BankYouBankruptContracts.StoragesContracts
{
public interface ICreditingStorage
public interface IDebitingStorage
{
List<CreditingViewModel> GetFullList();
List<DebitingViewModel> GetFullList();
List<CreditingViewModel> GetFilteredList(CreditingSearchModel model);
List<DebitingViewModel> GetFilteredList(DebitingSearchModel model);
CreditingViewModel? GetElement(CreditingSearchModel model);
DebitingViewModel? GetElement(DebitingSearchModel model);
CreditingViewModel? Insert(CreditingBindingModel model);
DebitingViewModel? Insert(DebitingBindingModel model);
CreditingViewModel? Update(CreditingBindingModel model);
DebitingViewModel? Update(DebitingBindingModel model);
CreditingViewModel? Delete(CreditingBindingModel model);
DebitingViewModel? Delete(DebitingBindingModel model);
}
}

View File

@ -10,8 +10,6 @@ namespace BankYouBankruptContracts.ViewModels
{
public int CardId { get; set; }
public string TypeOperation { get; set; } = string.Empty;
public double SumOperation { get; set; }
public DateTime DateComplite { get; set; }