From 3aa3ecebb4bec706ea708a26b50e7cda1d30f735 Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Tue, 30 Apr 2024 22:39:45 +0400 Subject: [PATCH] =?UTF-8?q?Stage=204:=20=20BussnessLogic(=D0=94=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=90=D0=B1?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=BD=D1=8B=D1=85=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20Wor?= =?UTF-8?q?d,=20Excel,=20Pdf,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20Reports=20=D0=B8=20=D0=B8=D0=B7=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D1=91=D1=82=D0=BE=D0=B2),=20Contracts(=D1=80=D0=B5=D0=B4=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?Views),=20DatabaseImplement(=D1=80=D0=B5=D0=B4=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BA=20=D0=B1=D0=B0=D0=B7=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D1=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BankBusinessLogic.csproj | 4 + .../Reports/ReportCashierLogic.cs | 141 +++++++++++++++ .../Reports/ReportClientLogic.cs | 163 ++++++++++++++++++ .../OfficePackage/AbstractSaveToExcel.cs | 12 +- .../OfficePackage/AbstractSaveToPdf.cs | 18 +- .../OfficePackage/AbstractSaveToWord.cs | 15 +- .../OfficePackage/HelperModels/ExcelInfo.cs | 1 - .../OfficePackage/HelperModels/PdfInfo.cs | 6 +- .../OfficePackage/HelperModels/WordInfo.cs | 2 +- .../OfficePackage/Implements/SaveToExcel.cs | 11 +- .../OfficePackage/Implements/SaveToPdf.cs | 11 +- .../OfficePackage/Implements/SaveToWord.cs | 9 +- Bank/BankContracts/BankContracts.csproj | 1 - .../Reports/IReportCashierLogic.cs | 6 +- .../Reports/IReportClientLogic.cs | 6 +- .../ViewModels/MoneyTransferViewModel.cs | 8 +- .../Client/ViewModels/CreditingViewModel.cs | 1 + .../Reports/Cashier/ReportCashierViewModel.cs | 23 +++ .../Reports/Client/ReportClientViewModel.cs | 19 ++ .../Reports/ReportCashierViewModelForHTML.cs | 18 ++ .../Reports/ReportClientViewModelForHTML.cs | 18 ++ Bank/BankDatabaseImplement/BankDatabase.cs | 2 +- 22 files changed, 477 insertions(+), 18 deletions(-) create mode 100644 Bank/BankBusinessLogic/BusinessLogic/Reports/ReportCashierLogic.cs create mode 100644 Bank/BankBusinessLogic/BusinessLogic/Reports/ReportClientLogic.cs create mode 100644 Bank/BankContracts/ViewModels/Reports/Cashier/ReportCashierViewModel.cs create mode 100644 Bank/BankContracts/ViewModels/Reports/Client/ReportClientViewModel.cs create mode 100644 Bank/BankContracts/ViewModels/Reports/ReportCashierViewModelForHTML.cs create mode 100644 Bank/BankContracts/ViewModels/Reports/ReportClientViewModelForHTML.cs diff --git a/Bank/BankBusinessLogic/BankBusinessLogic.csproj b/Bank/BankBusinessLogic/BankBusinessLogic.csproj index 91c1a88..45d152a 100644 --- a/Bank/BankBusinessLogic/BankBusinessLogic.csproj +++ b/Bank/BankBusinessLogic/BankBusinessLogic.csproj @@ -8,6 +8,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Bank/BankBusinessLogic/BusinessLogic/Reports/ReportCashierLogic.cs b/Bank/BankBusinessLogic/BusinessLogic/Reports/ReportCashierLogic.cs new file mode 100644 index 0000000..89a2db3 --- /dev/null +++ b/Bank/BankBusinessLogic/BusinessLogic/Reports/ReportCashierLogic.cs @@ -0,0 +1,141 @@ +using BankBusinessLogic.OfficePackage; +using BankBusinessLogic.OfficePackage.HelperModels; +using BankContracts.BindingModels.Reports; +using BankContracts.BusinessLogicsContracts.Reports; +using BankContracts.SearchModels.Cashier; +using BankContracts.SearchModels.Client; +using BankContracts.StoragesModels.Cashier; +using BankContracts.StoragesModels.Client; +using BankContracts.ViewModels.Client.ViewModels; +using BankContracts.ViewModels.Reports.Cashier; +using BankContracts.ViewModels.Reports; +using BankDatabaseImplement.Implements.ClientImplements; +using BankDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankBusinessLogic.BusinessLogic.Reports +{ + public class ReportCashierLogic : IReportCashierLogic + { + private readonly IMoneyTransferStorage _moneyTransferStorage; + private readonly ICashWithdrawalStorage _cashWithdrawalStorage; + private readonly IDebitingStorage _debitingStorage; + + private readonly IClientStorage _clientStorage; + private readonly ICardStorage _cardStorage; + + private readonly AbstractSaveToExcel _saveToExcel; + private readonly AbstractSaveToWord _saveToWord; + private readonly AbstractSaveToPdf _saveToPdf; + + // Конструктор + public ReportCashierLogic(IMoneyTransferStorage moneyTransferStorage, ICashWithdrawalStorage cashWithdrawalStorage, + IDebitingStorage debitingStorage, IClientStorage clientStorage, ICardStorage cardStorage, + AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) + { + _moneyTransferStorage = moneyTransferStorage; + _cashWithdrawalStorage = cashWithdrawalStorage; + _debitingStorage = debitingStorage; + + _clientStorage = clientStorage; + _cardStorage = cardStorage; + + _saveToExcel = saveToExcel; + _saveToWord = saveToWord; + _saveToPdf = saveToPdf; + } + + // Формирование списка переводов между счетами за период + public List? GetMoneyTransfers(ReportBindingModel model) + { + return _moneyTransferStorage.GetFilteredList(new MoneyTransferSearchModel { ClientId = model.ClientId, DateTransfer = model.DateTo }) + .Select(x => new ReportCashierViewModel + { + OperationId = x.Id, + DateComplite = x.DateTransfer, + AccountSenderNumber = x.AccountPayeeNumber, + AccountPayeeNumber = x.AccountSenderNumber, + SumOperation = x.Sum + }) + .ToList(); + } + + // Формирование списка выдачи наличных со счёта за период + public List? GetCashWithrawals(ReportBindingModel model) + { + return _cashWithdrawalStorage.GetFilteredList(new CashWithdrawalSearchModel { ClientId = model.ClientId, DateWithdrawal = model.DateTo }) + .Select(x => new ReportCashierViewModel + { + OperationId = x.Id, + DebitingId = x.DebitingId, + AccountPayeeNumber = x.AccountNumber, + DateComplite = x.DateWithdrawal, + SumOperation = x.Sum + }) + .ToList(); + } + + // Формирование списка выдачи наличных со счёта за период + public List? GetDebitings(ReportBindingModel model) + { + List CardIdList = new(); + + var list = _cardStorage.GetFilteredList(new CardSearchModel + { + AccountId = model.AccountId + }); + + foreach (var index in list) + { + CardIdList.Add(index.Id); + } + + List totalList = new(); + + foreach (var index in CardIdList) + { + var result = _debitingStorage.GetFilteredList(new DebitingSearchModel + { + CardId = index + }); + + totalList.AddRange(result); + } + + return totalList; + } + + // Формирование полного имени клиента для отчёта + public string GetFullName(ReportBindingModel model) + { + var client = _clientStorage.GetElement(new ClientSearchModel + { + Id = model.ClientId + }); + + return client.Surname + " " + client.Name + " " + client.Patronymic; + } + + // Сохранение счетов в файл-Word + public void SaveAccountsToWordFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + + // Сохранение счетов в файл-Excel + public void SaveAccountsToExcelFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + + // Сохранение счетов в файл-Pdf + public ReportCashierViewModelForHTML SaveAccountsToPdfFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + } +} diff --git a/Bank/BankBusinessLogic/BusinessLogic/Reports/ReportClientLogic.cs b/Bank/BankBusinessLogic/BusinessLogic/Reports/ReportClientLogic.cs new file mode 100644 index 0000000..7c182b7 --- /dev/null +++ b/Bank/BankBusinessLogic/BusinessLogic/Reports/ReportClientLogic.cs @@ -0,0 +1,163 @@ +using BankBusinessLogic.OfficePackage; +using BankBusinessLogic.OfficePackage.HelperModels; +using BankContracts.BindingModels.Reports; +using BankContracts.BusinessLogicsContracts.Reports; +using BankContracts.SearchModels.Cashier; +using BankContracts.SearchModels.Client; +using BankContracts.StoragesModels.Cashier; +using BankContracts.StoragesModels.Client; +using BankContracts.ViewModels.Cashier.ViewModels; +using BankContracts.ViewModels.Client.ViewModels; +using BankContracts.ViewModels.Reports; +using BankContracts.ViewModels.Reports.Client; +using BankDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankBusinessLogic.BusinessLogic.Reports +{ + public class ReportClientLogic : IReportClientLogic + { + private readonly IMoneyTransferStorage _moneyTransferStorage; + private readonly ICreditingStorage _creditingStorage; + private readonly IDebitingStorage _debitingStorage; + + private readonly IClientStorage _clientStorage; + private readonly ICardStorage _cardStorage; + + private readonly AbstractSaveToExcel _saveToExcel; + private readonly AbstractSaveToWord _saveToWord; + private readonly AbstractSaveToPdf _saveToPdf; + + // Конструктор + public ReportClientLogic(IMoneyTransferStorage moneyTransferStorage,ICreditingStorage creditingStorage, + IDebitingStorage debitingStorage, IClientStorage clientStorage, ICardStorage cardStorage, + AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) + { + _moneyTransferStorage = moneyTransferStorage; + _creditingStorage = creditingStorage; + _debitingStorage = debitingStorage; + + _clientStorage = clientStorage; + _cardStorage = cardStorage; + + _saveToExcel = saveToExcel; + _saveToWord = saveToWord; + _saveToPdf = saveToPdf; + } + + public List? GetCrediting(ReportBindingModel model) + { + return _creditingStorage.GetFilteredList(new CreditingSearchModel + { + DateCrediting = model.DateFrom, + }).Select(x => new ReportClientViewModel + { + OperationId = x.Id, + CardNumber = x.CardNumber, + SumOperation = x.Sum, + DateComplite = x.DateCredit + }).ToList(); + } + + public List? GetDebiting(ReportBindingModel model) + { + return _debitingStorage.GetFilteredList(new DebitingSearchModel + { + DateDebit = model.DateFrom, + }).Select(x => new ReportClientViewModel + { + OperationId = x.Id, + CardNumber = x.CardNumber, + SumOperation = x.Sum, + DateComplite = x.DateDebit + }).ToList(); + } + + // Для Excel отчёта по переводам между счетов + public List? GetMoneyTransfer(ReportBindingModel model) + { + // Список счетов по выбранным картам + List accountId = new(); + + foreach (var index in model.CardList) + { + accountId.Add(_cardStorage.GetElement(new CardSearchModel { Id = index }).AccountId); + } + + var list = accountId.ToHashSet().ToList(); + + List totalList = new(); + + foreach (var index in list) + { + var result = _moneyTransferStorage.GetFilteredList(new MoneyTransferSearchModel + { + AccountSenderId = index, + AccountPayeeId = index + }).OrderBy(x => x.AccountSenderId).ToList(); + + totalList.AddRange(result); + } + + return totalList; + } + + // Для Excel отчёта по пополнениям карты + public List GetExcelCrediting(ReportBindingModel model) + { + List totalList = new(); + + foreach (var index in model.CardList) + { + var result = _creditingStorage.GetFilteredList(new CreditingSearchModel + { + CardId = index + }); + + totalList.AddRange(result); + } + + return totalList; + } + + // Для Excel отчёта по снятиям с карты + public List GetExcelDebiting(ReportBindingModel model) + { + List totalList = new(); + + foreach (var index in model.CardList) + { + var result = _debitingStorage.GetFilteredList(new DebitingSearchModel + { + CardId = index + }); + + totalList.AddRange(result); + } + + return totalList; + } + + // Сохранение в файл-Excel для клиентов + public void SaveToExcelFile(ReportBindingModel model, OfficeOperationEnum operationEnum) + { + throw new NotImplementedException(); + } + + // Сохранение в файл-Word для клиентов + public void SaveToWordFile(ReportBindingModel model, OfficeOperationEnum operationEnum) + { + throw new NotImplementedException(); + } + + // Сохранение в файл-Pdf для клиента + public ReportClientViewModelForHTML SaveClientReportToPdfFile(ReportBindingModel model) + { + throw new NotImplementedException(); + } + } +} diff --git a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 218d2a7..c228a49 100644 --- a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -11,6 +11,16 @@ namespace BankBusinessLogic.OfficePackage { public abstract class AbstractSaveToExcel { - + /// Создание excel-файла + protected abstract void CreateExcel(ExcelInfo info); + + /// Добавляем новую ячейку в лист + protected abstract void InsertCellInWorksheet(ExcelCellParameters excelParams); + + /// Объединение ячеек + protected abstract void MergeCells(ExcelMergeParameters excelParams); + + /// Сохранение файла + protected abstract void SaveExcel(ExcelInfo info); } } diff --git a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index cb2479e..449f49a 100644 --- a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -1,4 +1,5 @@ -using System; +using BankBusinessLogic.OfficePackage.HelperModels; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,5 +9,20 @@ namespace BankBusinessLogic.OfficePackage { public abstract class AbstractSaveToPdf { + + /// Создание pdf-файла + protected abstract void CreatePdf(PdfInfo info); + + /// Создание параграфа с текстом + protected abstract void CreateParagraph(PdfParagraph paragraph); + + /// Создание таблицы + protected abstract void CreateTable(List columns); + + /// Создание и заполнение строки + protected abstract void CreateRow(PdfRowParameters rowParameters); + + /// Сохранение файла + protected abstract void SavePdf(PdfInfo info); } } diff --git a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 12c1dc3..49719c5 100644 --- a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -1,4 +1,5 @@ -using System; +using BankBusinessLogic.OfficePackage.HelperModels; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,5 +9,17 @@ namespace BankBusinessLogic.OfficePackage { public abstract class AbstractSaveToWord { + + /// Создание doc-файла + protected abstract void CreateWord(WordInfo info); + + /// Создание абзаца с текстом + protected abstract void CreateParagraph(WordParagraph paragraph); + + ///Создание таблицы + protected abstract void CreateTable(WordParagraph paragraph); + + /// Сохранение файла + protected abstract void SaveWord(WordInfo info); } } diff --git a/Bank/BankBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/Bank/BankBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs index deca5bb..5d17a03 100644 --- a/Bank/BankBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs +++ b/Bank/BankBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -26,4 +26,3 @@ namespace BankBusinessLogic.OfficePackage.HelperModels public List Debiting { get; set; } = new(); } } -} diff --git a/Bank/BankBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs b/Bank/BankBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs index 12bff67..54a0259 100644 --- a/Bank/BankBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs +++ b/Bank/BankBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs @@ -1,4 +1,6 @@ -using System; +using BankContracts.ViewModels.Reports.Cashier; +using BankContracts.ViewModels.Reports.Client; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -32,7 +34,7 @@ namespace BankBusinessLogic.OfficePackage.HelperModels // Перечень переводов со счёта на счёт public List ReportMoneyTransfer { get; set; } = new(); - // Перечень зачислений денежных средств на карту (т. е. на её счёт) + // Перечень зачислений денежных средств public List ReportCashWithdrawal { get; set; } = new(); } } diff --git a/Bank/BankBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/Bank/BankBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index ca267da..ad7f3c4 100644 --- a/Bank/BankBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/Bank/BankBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace BankBusinessLogic.OfficePackage.HelperModels { // Общая информация по документу - internal class WordInfo + public class WordInfo { public string FileName { get; set; } = string.Empty; diff --git a/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToExcel.cs b/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToExcel.cs index 47bee17..fac7f89 100644 --- a/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToExcel.cs +++ b/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToExcel.cs @@ -1,4 +1,6 @@ -using System; +using DocumentFormat.OpenXml.Packaging; +using DocumentFormat.OpenXml.Spreadsheet; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +8,14 @@ using System.Threading.Tasks; namespace BankBusinessLogic.OfficePackage.Implements { + // Реализация создания Excel-документа от абстрактного класса public class SaveToExcel { + private SpreadsheetDocument? _spreadsheetDocument; + + private SharedStringTablePart? _shareStringPart; + + private Worksheet? _worksheet; + } } diff --git a/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToPdf.cs b/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToPdf.cs index 7150145..dc26547 100644 --- a/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToPdf.cs +++ b/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToPdf.cs @@ -1,4 +1,7 @@ -using System; +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.Rendering; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +9,13 @@ using System.Threading.Tasks; namespace BankBusinessLogic.OfficePackage.Implements { + // Реализация создания Pdf-документа от абстрактного класса public class SaveToPdf { + private Document? _document; + + private Section? _section; + + private Table? _table; } } diff --git a/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 7cd8f11..8af5380 100644 --- a/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/Bank/BankBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -1,4 +1,6 @@ -using System; +using DocumentFormat.OpenXml.Packaging; +using DocumentFormat.OpenXml.Wordprocessing; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +8,12 @@ using System.Threading.Tasks; namespace BankBusinessLogic.OfficePackage.Implements { + // Реализация создания Word-документа от абстрактного класса public class SaveToWord { + private WordprocessingDocument? _wordDocument; + + private Body? _docBody; + } } diff --git a/Bank/BankContracts/BankContracts.csproj b/Bank/BankContracts/BankContracts.csproj index 3454933..e6bb86f 100644 --- a/Bank/BankContracts/BankContracts.csproj +++ b/Bank/BankContracts/BankContracts.csproj @@ -15,7 +15,6 @@ - diff --git a/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportCashierLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportCashierLogic.cs index 7787750..7bbdf0d 100644 --- a/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportCashierLogic.cs +++ b/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportCashierLogic.cs @@ -1,4 +1,6 @@ using BankContracts.BindingModels.Reports; +using BankContracts.ViewModels.Reports; +using BankContracts.ViewModels.Reports.Cashier; using System; using System.Collections.Generic; using System.Linq; @@ -7,8 +9,8 @@ using System.Threading.Tasks; namespace BankContracts.BusinessLogicsContracts.Reports { - // Интерфейс бизнес-логики для отчёта (Кассир) - public interface IReportCashierLogic + // Интерфейс бизнес-логики для отчёта (Кассир) + public interface IReportCashierLogic { List? GetMoneyTransfers(ReportBindingModel model); diff --git a/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportClientLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportClientLogic.cs index 4ccf768..ae96929 100644 --- a/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportClientLogic.cs +++ b/Bank/BankContracts/BusinessLogicsContracts/Reports/IReportClientLogic.cs @@ -1,4 +1,6 @@ using BankContracts.BindingModels.Reports; +using BankContracts.ViewModels.Reports; +using BankContracts.ViewModels.Reports.Client; using BankDataModels.Enums; using System; using System.Collections.Generic; @@ -8,8 +10,8 @@ using System.Threading.Tasks; namespace BankContracts.BusinessLogicsContracts.Reports { - // Интерфейс бизнес-логики для отчёта (Клиент) - public interface IReportClientLogic + // Интерфейс бизнес-логики для отчёта (Клиент) + public interface IReportClientLogic { List? GetCrediting(ReportBindingModel model); diff --git a/Bank/BankContracts/ViewModels/Cashier/ViewModels/MoneyTransferViewModel.cs b/Bank/BankContracts/ViewModels/Cashier/ViewModels/MoneyTransferViewModel.cs index 17dcc71..4ef6b05 100644 --- a/Bank/BankContracts/ViewModels/Cashier/ViewModels/MoneyTransferViewModel.cs +++ b/Bank/BankContracts/ViewModels/Cashier/ViewModels/MoneyTransferViewModel.cs @@ -18,12 +18,16 @@ namespace BankContracts.ViewModels.Cashier.ViewModels public double Sum { get; set; } // Для перевода между счетами - [DisplayName("Номер счёта отп.")] public int? AccountSenderId { get; set; } - [DisplayName("Номер счёта получ.")] + [DisplayName("Номер счёта отправителя")] + public string AccountSenderNumber { get; set; } = string.Empty; + public int AccountPayeeId { get; set; } + [DisplayName("Номер счёта получателя")] + public string AccountPayeeNumber { get; set; } = string.Empty; + [DisplayName("Дата операции")] public DateTime DateTransfer { get; set; } = DateTime.Now; diff --git a/Bank/BankContracts/ViewModels/Client/ViewModels/CreditingViewModel.cs b/Bank/BankContracts/ViewModels/Client/ViewModels/CreditingViewModel.cs index fc17357..c938470 100644 --- a/Bank/BankContracts/ViewModels/Client/ViewModels/CreditingViewModel.cs +++ b/Bank/BankContracts/ViewModels/Client/ViewModels/CreditingViewModel.cs @@ -16,6 +16,7 @@ namespace BankContracts.ViewModels.Client.ViewModels public int ClientId { get; set; } public int CardId { get; set; } + [DisplayName("Номер карты")] public string? CardNumber { get; set; } diff --git a/Bank/BankContracts/ViewModels/Reports/Cashier/ReportCashierViewModel.cs b/Bank/BankContracts/ViewModels/Reports/Cashier/ReportCashierViewModel.cs new file mode 100644 index 0000000..18e0537 --- /dev/null +++ b/Bank/BankContracts/ViewModels/Reports/Cashier/ReportCashierViewModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels.Reports.Cashier +{ + public class ReportCashierViewModel + { + public int OperationId { get; set; } + + public int DebitingId { get; set; } + + public string AccountPayeeNumber { get; set; } + + public string AccountSenderNumber { get; set; } + + public double SumOperation { get; set; } + + public DateTime DateComplite { get; set; } + } +} diff --git a/Bank/BankContracts/ViewModels/Reports/Client/ReportClientViewModel.cs b/Bank/BankContracts/ViewModels/Reports/Client/ReportClientViewModel.cs new file mode 100644 index 0000000..77dd08a --- /dev/null +++ b/Bank/BankContracts/ViewModels/Reports/Client/ReportClientViewModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels.Reports.Client +{ + public class ReportClientViewModel + { + public int OperationId { get; set; } + + public string CardNumber { get; set; } + + public double SumOperation { get; set; } + + public DateTime? DateComplite { get; set; } + } +} diff --git a/Bank/BankContracts/ViewModels/Reports/ReportCashierViewModelForHTML.cs b/Bank/BankContracts/ViewModels/Reports/ReportCashierViewModelForHTML.cs new file mode 100644 index 0000000..812f400 --- /dev/null +++ b/Bank/BankContracts/ViewModels/Reports/ReportCashierViewModelForHTML.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using BankContracts.ViewModels.Reports.Cashier; + +namespace BankContracts.ViewModels.Reports +{ + public class ReportCashierViewModelForHTML + { + // Список переводов со счёта на счёт + public List ReportMoneyTransfer { get; set; } = new(); + + // Список зачислений денежных средств на карту + public List ReportCashWithdrawal { get; set; } = new(); + } +} diff --git a/Bank/BankContracts/ViewModels/Reports/ReportClientViewModelForHTML.cs b/Bank/BankContracts/ViewModels/Reports/ReportClientViewModelForHTML.cs new file mode 100644 index 0000000..3b10f40 --- /dev/null +++ b/Bank/BankContracts/ViewModels/Reports/ReportClientViewModelForHTML.cs @@ -0,0 +1,18 @@ +using BankContracts.ViewModels.Reports.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels.Reports +{ + public class ReportClientViewModelForHTML + { + // Список операций пополнения за указанный период для вывода/сохранения в файл + public List ReportCrediting { get; set; } = new(); + + // Список снятий за указанный период для вывода/сохранения в файл + public List ReportDebiting { get; set; } = new(); + } +} diff --git a/Bank/BankDatabaseImplement/BankDatabase.cs b/Bank/BankDatabaseImplement/BankDatabase.cs index 9f08c67..5b768d0 100644 --- a/Bank/BankDatabaseImplement/BankDatabase.cs +++ b/Bank/BankDatabaseImplement/BankDatabase.cs @@ -15,7 +15,7 @@ namespace BankDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source= \SQLEXPRESS;Initial Catalog=BankDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source= localhost\SQLEXPRESS;Initial Catalog=BankDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); }