diff --git a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index d35fa44..f70e228 100644 --- a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -202,6 +202,8 @@ namespace BankYouBankruptBusinessLogic.OfficePackage //номер строчки в докуметне uint rowIndex = 3; + //string supportNumber = string.Empty; + foreach (var cr in info.Crediting) { //вставляет номер перевода @@ -258,6 +260,46 @@ namespace BankYouBankruptBusinessLogic.OfficePackage rowIndex++; + //формирование списка поступления по каждой карте + var dict = new Dictionary(); + + foreach(var elem in info.Crediting) + { + if (dict.ContainsKey(elem.CardNumber)) + { + dict[elem.CardNumber] += elem.Sum; + } + else + { + dict[elem.CardNumber] = elem.Sum; + } + } + + foreach(var elem in dict) + { + //строчка с номером счёта получателя + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "B", + RowIndex = rowIndex, + Text = "Сумма пополнения на карту №" + elem.Key + ":", + StyleInfo = ExcelStyleInfoType.TextWithBorder + }); + + //вставка номера отправителя + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "C", + RowIndex = rowIndex, + Text = elem.Value.ToString(), + StyleInfo = ExcelStyleInfoType.TextWithBorder + }); + + rowIndex++; + } + + rowIndex++; + InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "A", @@ -362,6 +404,46 @@ namespace BankYouBankruptBusinessLogic.OfficePackage rowIndex++; + //формирование списка поступления по каждой карте + var dict = new Dictionary(); + + foreach (var elem in info.Debiting) + { + if (dict.ContainsKey(elem.CardNumber)) + { + dict[elem.CardNumber] += elem.Sum; + } + else + { + dict[elem.CardNumber] = elem.Sum; + } + } + + foreach (var elem in dict) + { + //строчка с номером счёта получателя + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "B", + RowIndex = rowIndex, + Text = "Сумма снятия с карты №" + elem.Key + ":", + StyleInfo = ExcelStyleInfoType.TextWithBorder + }); + + //вставка номера отправителя + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "C", + RowIndex = rowIndex, + Text = elem.Value.ToString(), + StyleInfo = ExcelStyleInfoType.TextWithBorder + }); + + rowIndex++; + } + + rowIndex++; + InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "A", diff --git a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 0f012a3..d1ba885 100644 --- a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -93,6 +93,17 @@ namespace BankYouBankruptBusinessLogic.OfficePackage }); } + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { ("Суммарный объём переводов: " + info.MoneyTransfer.Sum(x => x.Sum).ToString(), + new WordTextProperties { Bold = true, Size = "24" }) }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + SaveWord(info); } @@ -152,6 +163,34 @@ namespace BankYouBankruptBusinessLogic.OfficePackage }); } + //формирование списка поступления по каждой карте + var dict = new Dictionary(); + + foreach (var elem in info.Crediting) + { + if (dict.ContainsKey(elem.CardNumber)) + { + dict[elem.CardNumber] += elem.Sum; + } + else + { + dict[elem.CardNumber] = elem.Sum; + } + } + + foreach (var elem in dict) + { + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { ("Суммарное пополнение на карту №" + elem.Key + ": " + elem.Value.ToString(), new WordTextProperties { Bold = true, Size = "24" }) }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + } + SaveWord(info); } @@ -210,6 +249,34 @@ namespace BankYouBankruptBusinessLogic.OfficePackage }); } + //формирование списка поступления по каждой карте + var dict = new Dictionary(); + + foreach (var elem in info.Debiting) + { + if (dict.ContainsKey(elem.CardNumber)) + { + dict[elem.CardNumber] += elem.Sum; + } + else + { + dict[elem.CardNumber] = elem.Sum; + } + } + + foreach (var elem in dict) + { + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { ("Суммарное снятие с карты №" + elem.Key + ": " + elem.Value.ToString(), new WordTextProperties { Bold = true, Size = "24" }) }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + } + SaveWord(info); } diff --git a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWordCashier.cs b/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWordCashier.cs deleted file mode 100644 index cc28715..0000000 --- a/BankYouBankrupt/BankYouBankruptBusinessLogic/OfficePackage/AbstractSaveToWordCashier.cs +++ /dev/null @@ -1,43 +0,0 @@ -using BankYouBankruptBusinessLogic.OfficePackage.HelperEnums; -using BankYouBankruptBusinessLogic.OfficePackage.HelperModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BankYouBankruptBusinessLogic.OfficePackage -{ - public abstract class AbstractSaveToWordCashier - { - //метод создания документа - public void CreateDoc(WordInfo info) - { - CreateWord(info); - - //создание ряда абзацев - CreateParagraph(new WordParagraph - { - Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) }, - TextProperties = new WordTextProperties - { - Size = "24", - JustificationType = WordJustificationType.Center - } - }); - - //TODO - - SaveWord(info); - } - - // Создание doc-файла - protected abstract void CreateWord(WordInfo info); - - // Создание абзаца с текстом - protected abstract void CreateParagraph(WordParagraph paragraph); - - // Сохранение файла - protected abstract void SaveWord(WordInfo info); - } -} diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml index ca18af4..ad32951 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml @@ -52,7 +52,7 @@ } .footer { - position: absolute; + position: fixed; left: 0; bottom: 0; width: 100%; diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml index 4a9231b..8e83145 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml @@ -24,7 +24,7 @@ - Номер счёта + Номер карты Баланс