Borschevskaya A.A. Lab work 4 #6

Closed
pgirl1 wants to merge 17 commits from lab4_base into lab3_base
3 changed files with 12 additions and 12 deletions
Showing only changes of commit 3bba334dbb - Show all commits

View File

@ -24,10 +24,10 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage
Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm" });
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm", "3cm" });
CreateRow(new PdfRowParameters
{
Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Сумма" },
Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Статус", "Сумма" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
@ -35,7 +35,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage
{
CreateRow(new PdfRowParameters
{
Texts = new List<string> { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.FurnitureName, order.Sum.ToString() },
Texts = new List<string> { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.FurnitureName, order.OrderStatus, order.Sum.ToString() },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});

View File

@ -21,10 +21,8 @@ namespace FurnitureAssemblyBusinessLogic
private readonly AbstractSaveToExcel _saveToExcel;
private readonly AbstractSaveToWord _saveToWord;
private readonly AbstractSaveToPdf _saveToPdf;
public ReportLogic(IFurnitureStorage productStorage, IComponentStorage
componentStorage, IOrderStorage orderStorage,
AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord,
AbstractSaveToPdf saveToPdf)
public ReportLogic(IFurnitureStorage productStorage, IComponentStorage componentStorage, IOrderStorage orderStorage,
AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf)
{
_productStorage = productStorage;
_componentStorage = componentStorage;
@ -71,8 +69,7 @@ namespace FurnitureAssemblyBusinessLogic
{
return _orderStorage.GetFilteredList(new OrderSearchModel
{
DateFrom
= model.DateFrom,
DateFrom = model.DateFrom,
DateTo = model.DateTo
})
.Select(x => new ReportOrdersViewModel
@ -80,7 +77,8 @@ namespace FurnitureAssemblyBusinessLogic
Id = x.Id,
DateCreate = x.DateCreate,
FurnitureName = x.FurnitureName,
Sum = x.Sum
Sum = x.Sum,
OrderStatus = x.Status.ToString()
})
.ToList();
}

View File

@ -1,4 +1,6 @@
namespace FurnitureAssemblyContracts.ViewModels
using FurnitureAssemblyDataModels.Enums;
namespace FurnitureAssemblyContracts.ViewModels
{
public class ReportOrdersViewModel
{
@ -6,6 +8,6 @@
public DateTime DateCreate { get; set; }
public string FurnitureName { get; set; } = string.Empty;
public double Sum { get; set; }
public string OrderStatus { get; set; } = string.Empty;
}
}