Word Done

This commit is contained in:
the 2023-04-04 13:59:40 +04:00
parent c7b874d580
commit 2b5739b429
3 changed files with 9 additions and 5 deletions

View File

@ -96,8 +96,8 @@ namespace ComputerShopBusinessLogic.BusinessLogics
_saveToWord.CreateDoc(new WordInfo
{
FileName = model.FileName,
Title = "Список компонент",
Components = _componentStorage.GetFullList()
Title = "Список компьютеров",
Computers = _productStorage.GetFullList()
});
}
/// <summary>

View File

@ -22,17 +22,21 @@ namespace ComputerShopBusinessLogic.OfficePackage
JustificationType = WordJustificationType.Center
}
});
foreach (var component in info.Components)
foreach (var computer in info.Computers)
{
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)> {(component.ComponentName, new WordTextProperties { Size = "24", }) },
Texts = new List<(string, WordTextProperties)>
{(computer.ComputerName + " - ", new WordTextProperties { Size = "24", Bold = true}),
(computer.Price.ToString(), new WordTextProperties { Size = "24", })},
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Both
}
});
}
SaveWord(info);
}

View File

@ -11,6 +11,6 @@ namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public List<ComponentViewModel> Components { get; set; } = new();
public List<ComputerViewModel> Computers { get; set; } = new();
}
}