From 00bb983b8aef5c4ed842eb1a544e8ef6646f1022 Mon Sep 17 00:00:00 2001 From: Artyom_Yashin Date: Sun, 26 May 2024 16:48:11 +0400 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=B1=D1=81=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=BE=D0=B4?= =?UTF-8?q?=D1=80=D0=B0=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToWord.cs | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 8e45211..c4e761c 100644 --- a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -1,7 +1,7 @@ using BankBusinessLogic.OfficePackage.DocumentModels; using BankBusinessLogic.OfficePackage.HelperEnums; using BankBusinessLogic.OfficePackage.HelperModels; -using BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels; +using BankContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; @@ -41,25 +41,36 @@ namespace BankBusinessLogic.OfficePackage public void CreateTransfersDoc(WordInfo info) { CreateWord(info); - List> list = new List>(); - foreach (var shop in info.Shops) + List> table = new List>(); + List reports = info.Transfers; + foreach (ReportTransfersViewModel report in reports) { - var ls = new List + foreach(TransferViewModel transfer in report.Transfers) { - shop.ShopName, - shop.Address, - shop.OpeningDate.ToShortDateString() - }; - list.Add(ls); + List row = new List + { + report.CardNumber, + transfer.Id.ToString(), + transfer.Sum.ToString(), + transfer.TransferTime.ToString(), + transfer.SenderAccountNumber, + transfer.RecipientAccountNumber, + }; + table.Add(row); + } } var wordTable = new WordTable { Headers = new List { - "Название", - "Адрес", - "Дата открытия"}, - Columns = 3, - RowText = list + "Номер карты", + "Номер перевода", + "Сумма", + "Время перевода", + "Карта отправителя", + "Карта получателя" + }, + Columns = 6, + RowText = table }; CreateTable(wordTable); SaveWord(info);