CreateRequestsDoc(WordInfo info)

This commit is contained in:
Zakharov_Rostislav 2024-05-26 16:48:05 +04:00
parent 3a9eb0de13
commit 370cbb6699

View File

@ -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<string>> list = new List<List<string>>();
foreach (var shop in info.Shops)
List<List<string>> table = new List<List<string>>();
List<ReportRequestsViewModel> reports = info.Requests;
foreach (ReportRequestsViewModel report in reports)
{
var ls = new List<string>
foreach (RequestViewModel request in report.Requests)
{
shop.ShopName,
shop.Address,
shop.OpeningDate.ToShortDateString()
};
list.Add(ls);
List<string> row = new List<string>
{
report.AccountNumber,
request.Id.ToString(),
request.Status.ToString(),
request.Sum.ToString(),
request.RequestTime.ToString(),
};
table.Add(row);
}
}
var wordTable = new WordTable
{
Headers = new List<string> {
"Название",
"Адрес",
"Дата открытия"},
Columns = 3,
RowText = list
"Номер карты",
"Номер заявки",
"Статус заявки",
"Сумма выдачи",
"Дата заявки"},
Columns = 5,
RowText = table
};
CreateTable(wordTable);
SaveWord(info);