diff --git a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 8e45211..e7acbcc 100644 --- a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -1,6 +1,7 @@ using BankBusinessLogic.OfficePackage.DocumentModels; using BankBusinessLogic.OfficePackage.HelperEnums; using BankBusinessLogic.OfficePackage.HelperModels; +using BankContracts.ViewModels; using BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels; using System; using System.Collections.Generic; @@ -15,25 +16,33 @@ namespace BankBusinessLogic.OfficePackage public void CreateRequestsDoc(WordInfo info) { CreateWord(info); - List> list = new List>(); - foreach (var shop in info.Shops) + List> table = new List>(); + List reports = info.Requests; + foreach (ReportRequestsViewModel report in reports) { - var ls = new List + foreach (RequestViewModel request in report.Requests) { - shop.ShopName, - shop.Address, - shop.OpeningDate.ToShortDateString() - }; - list.Add(ls); + List row = new List + { + report.AccountNumber, + request.Id.ToString(), + request.Status.ToString(), + request.Sum.ToString(), + request.RequestTime.ToString(), + }; + table.Add(row); + } } var wordTable = new WordTable { Headers = new List { - "Название", - "Адрес", - "Дата открытия"}, - Columns = 3, - RowText = list + "Номер карты", + "Номер заявки", + "Статус заявки", + "Сумма выдачи", + "Дата заявки"}, + Columns = 5, + RowText = table }; CreateTable(wordTable); SaveWord(info);