готовая 4, вроде ласт версия

This commit is contained in:
Николай 2023-03-25 16:04:48 +04:00
parent 1c4600bf37
commit 4f78c49b1b
5 changed files with 15 additions and 6 deletions

View File

@ -152,7 +152,7 @@ namespace FoodOrdersView
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
if (dialog.ShowDialog() == DialogResult.OK) if (dialog.ShowDialog() == DialogResult.OK)
{ {
_reportLogic.SaveComponentsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); _logicR.SaveComponentsToWordFile(new ReportBindingModel { FileName = dialog.FileName });
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
} }

View File

@ -1,5 +1,8 @@
using FoodOrdersBusinessLogic.OfficePackage; using FoodOrdersBusinessLogic.OfficePackage;
using FoodOrdersBusinessLogic.OfficePackage.HelperModels; using FoodOrdersBusinessLogic.OfficePackage.HelperModels;
using FoodOrdersBusinessLogic.OfficePackage.HelperModels.Excel;
using FoodOrdersBusinessLogic.OfficePackage.HelperModels.Pdf;
using FoodOrdersBusinessLogic.OfficePackage.HelperModels.Word;
using FoodOrdersContracts.BindingModels; using FoodOrdersContracts.BindingModels;
using FoodOrdersContracts.BusinessLogicsContracts; using FoodOrdersContracts.BusinessLogicsContracts;
using FoodOrdersContracts.SearchModels; using FoodOrdersContracts.SearchModels;

View File

@ -23,7 +23,7 @@ namespace FoodOrdersBusinessLogic.OfficePackage
{ {
CreateParagraph(new WordParagraph CreateParagraph(new WordParagraph
{ {
Texts = new List<(string, WordTextProperties)> { (dish.DishName, new WordTextProperties { Size = "24" }) }, Texts = new List<(string, WordTextProperties)> { (dish.DishName + " ", new WordTextProperties { Bold = true, Size = "24" }), (dish.Price.ToString(), new WordTextProperties { Size = "24" }) },
TextProperties = new WordTextProperties TextProperties = new WordTextProperties
{ {
Size = "24", Size = "24",

View File

@ -23,7 +23,8 @@ namespace FoodOrdersFileImplement.Implements
{ {
if (!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue) if (!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
{ {
return _source.Orders.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) return _source.Orders
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
.Select(x => GetViewModel(x)) .Select(x => GetViewModel(x))
.ToList(); .ToList();
} }

View File

@ -32,9 +32,14 @@ namespace FoodOrdersListImplement.Implements
var result = new List<OrderViewModel>(); var result = new List<OrderViewModel>();
if (!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue) if (!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
{ {
return _source.Orders.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) foreach (var order in _source.Orders)
.Select(x => GetViewModel(x)) {
.ToList(); if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
{
result.Add(GetViewModel(order));
}
}
return result;
} }
foreach (var order in _source.Orders) foreach (var order in _source.Orders)
{ {