diff --git a/FoodOrders/FoodOrders/ReportOrders.rdlc b/FoodOrders/FoodOrders/ReportOrders.rdlc
index 889babc..525eaf2 100644
--- a/FoodOrders/FoodOrders/ReportOrders.rdlc
+++ b/FoodOrders/FoodOrders/ReportOrders.rdlc
@@ -33,6 +33,10 @@
Sum
System.Decimal
+
+ OrderStatus
+ System.String
+
FoodOrdersContracts.ViewModels
@@ -126,6 +130,9 @@
2.5cm
+
+
+ 3.21438cm
@@ -258,6 +265,38 @@
2pt
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Статус заказа
+
+
+
+
+
+
+ Textbox100
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
@@ -385,6 +424,36 @@
2pt
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!OrderStatus.Value
+
+
+
+
+
+
+ OrderStatus
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
@@ -397,6 +466,7 @@
+
diff --git a/FoodOrders/FoodOrders/ReportOrders.rdlc.bak b/FoodOrders/FoodOrders/ReportOrders.rdlc.bak
new file mode 100644
index 0000000..889babc
--- /dev/null
+++ b/FoodOrders/FoodOrders/ReportOrders.rdlc.bak
@@ -0,0 +1,529 @@
+
+
+ 0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 10791c83-cee8-4a38-bbd0-245fc17cefb3
+
+
+
+
+
+ FoodOrdersContractsViewModels
+ /* Local Query */
+
+
+
+ Id
+ System.Int32
+
+
+ DateCreate
+ System.DateTime
+
+
+ DishName
+ System.String
+
+
+ Sum
+ System.Decimal
+
+
+
+ FoodOrdersContracts.ViewModels
+ ReportOrdersViewModel
+ FoodOrdersContracts.ViewModels.ReportOrdersViewModel, FoodOrdersContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!ReportParameterPeriod.Value
+
+
+
+
+
+
+ ReportParameterPeriod
+ 1cm
+ 1cm
+ 21cm
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ Заказы
+
+
+
+
+
+
+ 1cm
+ 21cm
+ 1
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ 2.5cm
+
+
+ 3.21438cm
+
+
+ 8.23317cm
+
+
+ 2.5cm
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Номер
+
+
+
+
+
+
+ Textbox5
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Дата создания
+
+
+
+
+
+
+ Textbox1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Блюдо
+
+
+
+
+
+
+ Textbox3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Сумма
+
+
+
+
+
+
+ Textbox7
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Id.Value
+
+
+
+
+
+
+ Id
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DateCreate.Value
+
+
+
+
+
+
+ DateCreate
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DishName.Value
+
+
+
+
+
+
+ DishName
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Sum.Value
+
+
+
+
+
+
+ Sum
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ DataSetOrders
+ 2.48391cm
+ 0.55245cm
+ 1.2cm
+ 16.44755cm
+ 2
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Итого:
+
+
+
+
+
+
+ 4cm
+ 12cm
+ 0.6cm
+ 2.5cm
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!Sum.Value, "DataSetOrders")
+
+
+
+
+
+
+ 4cm
+ 14.5cm
+ 0.6cm
+ 2.5cm
+ 4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 5.72875cm
+
+
+ 21cm
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+
+
+
+
+ String
+ true
+ ReportParameter1
+
+
+
+
+ 4
+ 2
+
+
+ 0
+ 0
+ ReportParameterPeriod
+
+
+
+
+ Cm
+ 2de0031a-4d17-449d-922d-d9fc54572312
+
\ No newline at end of file
diff --git a/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/ReportLogic.cs b/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/ReportLogic.cs
index bb2b0c5..3a07572 100644
--- a/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/ReportLogic.cs
+++ b/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/ReportLogic.cs
@@ -54,13 +54,10 @@ namespace FoodOrdersBusinessLogic.BusinessLogics
Components = new List<(string, int)>(),
TotalCount = 0
};
- foreach (var component in components)
+ foreach (var component in dish.DishComponents)
{
- if (dish.DishComponents.ContainsKey(component.Id))
- {
- record.Components.Add(new (component.ComponentName, dish.DishComponents[component.Id].Item2));
- record.TotalCount += dish.DishComponents[component.Id].Item2;
- }
+ record.Components.Add(new(component.Value.Item1.ComponentName, component.Value.Item2));
+ record.TotalCount += component.Value.Item2;
}
list.Add(record);
@@ -82,7 +79,8 @@ namespace FoodOrdersBusinessLogic.BusinessLogics
Id = x.Id,
DateCreate = x.DateCreate,
DishName = x.DishName,
- Sum = x.Sum
+ Sum = x.Sum,
+ OrderStatus = x.Status.ToString()
})
.ToList();
}
diff --git a/FoodOrders/FoodOrdersBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/FoodOrders/FoodOrdersBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
index ca70ea1..86b71d3 100644
--- a/FoodOrders/FoodOrdersBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
+++ b/FoodOrders/FoodOrdersBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
@@ -11,11 +11,11 @@ namespace FoodOrdersBusinessLogic.OfficePackage
CreateParagraph(new PdfParagraph { Text = info.Title, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center });
CreateParagraph(new PdfParagraph { Text = $"с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
- CreateTable(new List { "2cm", "3cm", "6cm", "3cm" });
+ CreateTable(new List { "2cm", "3cm", "6cm", "3cm", "3cm" });
CreateRow(new PdfRowParameters
{
- Texts = new List { "Номер", "Дата заказа", "Блюдо", "Сумма" },
+ Texts = new List { "Номер", "Дата заказа", "Блюдо", "Сумма", "Статус" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
@@ -24,7 +24,7 @@ namespace FoodOrdersBusinessLogic.OfficePackage
{
CreateRow(new PdfRowParameters
{
- Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.DishName, order.Sum.ToString() },
+ Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.DishName, order.Sum.ToString(), order.OrderStatus },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
diff --git a/FoodOrders/FoodOrdersContracts/ViewModels/ReportOrdersViewModel.cs b/FoodOrders/FoodOrdersContracts/ViewModels/ReportOrdersViewModel.cs
index 170dc3a..2228a48 100644
--- a/FoodOrders/FoodOrdersContracts/ViewModels/ReportOrdersViewModel.cs
+++ b/FoodOrders/FoodOrdersContracts/ViewModels/ReportOrdersViewModel.cs
@@ -17,6 +17,6 @@ namespace FoodOrdersContracts.ViewModels
public double Sum { get; set; }
- public OrderStatus OrderStatus { get; set; }
+ public string OrderStatus { get; set; }
}
}
diff --git a/FoodOrders/FoodOrdersDatabaseImplement/Models/Order.cs b/FoodOrders/FoodOrdersDatabaseImplement/Models/Order.cs
index 5c694ef..745dd07 100644
--- a/FoodOrders/FoodOrdersDatabaseImplement/Models/Order.cs
+++ b/FoodOrders/FoodOrdersDatabaseImplement/Models/Order.cs
@@ -65,7 +65,8 @@ namespace FoodOrdersDatabaseImplement.Models
Sum = Sum,
Status = Status,
DateCreate = DateCreate,
- DateImplement = DateImplement
+ DateImplement = DateImplement,
+ DishName = Dish.DishName
};
}
}
\ No newline at end of file