готовая 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" };
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);
}
}

View File

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

View File

@ -23,7 +23,7 @@ namespace FoodOrdersBusinessLogic.OfficePackage
{
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
{
Size = "24",

View File

@ -23,7 +23,8 @@ namespace FoodOrdersFileImplement.Implements
{
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))
.ToList();
}

View File

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