Осталась отправка на почту. 4:35 утра... я схожу с ума

This commit is contained in:
Алексей Тихоненков 2024-05-27 04:35:55 +04:00
parent 81d1463e37
commit b0002ec263
19 changed files with 1156 additions and 301 deletions

View File

@ -37,10 +37,26 @@ namespace DiningRoomBusinessLogic.BusinessLogic
{
return _componentStorage.GetComponentsByDate(Report);
}
public void SaveReportToWordFile(ReportBindingModel Model)
public void SaveComponentsToPdfFile(ReportBindingModel model)
{
throw new NotImplementedException();
_saveToPdf.CreateDoc(new PdfInfo
{
FileName = model.FileName,
Title = "Список заказов",
DateFrom = model.DateFrom!.Value,
DateTo = model.DateTo!.Value,
Components = GetReportComponentsByCardDate(model)
});
}
public void SaveReportToWordFile(ReportBindingModel Model, List<ComponentSearchModel> selectedComponents)
{
_saveToWord.CreateDoc(new WordInfo
{
FileName = Model.FileName,
Title = "Список изделий",
ProductComponents = GetReportComponentsWithOrders(selectedComponents)
});
}
public void SaveReportToExcelFile(ReportBindingModel Model, List<ComponentSearchModel> selectedComponents)

View File

@ -11,29 +11,52 @@ namespace DiningRoomBusinessLogic.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<string> { "2cm", "3cm", "6cm", "6cm", "3cm" });
// Устанавливаем размеры колонок таблицы
CreateTable(new List<string> { "3cm", "2cm", "6cm", "6cm" });
CreateRow(new PdfRowParameters
{
Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Статус", "Сумма" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
// Группировка данных по ComponentName
var groupedData = info.Components.GroupBy(c => c.ComponentName);
foreach (var order in info.Orders)
foreach (var group in groupedData)
{
CreateRow(new PdfRowParameters
{
Texts = new List<string> { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.ProductName, order.Status.ToString(), order.Sum.ToString() },
Style = "Normal",
Texts = new List<string> { "Продукт", "Цена", "", "" }, // assuming currency format
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
// Добавление строки с именем компонента и его стоимостью
CreateRow(new PdfRowParameters
{
Texts = new List<string> { group.Key, group.First().ComponentCost.ToString("C"),"","" }, // assuming currency format
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
// Добавление заголовка для элементов компонента
CreateRow(new PdfRowParameters
{
Texts = new List<string> { "","","Карта", "Блюдо" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
// Добавление строк с элементами компонента
foreach (var item in group)
{
CreateRow(new PdfRowParameters
{
Texts = new List<string> { "", "",item.CardName, item.ProductName },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
}
}
CreateParagraph(new PdfParagraph { Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
SavePdf(info);
}
/// <summary>
/// Создание doc-файла
/// </summary>

View File

@ -9,6 +9,7 @@ namespace DiningRoomBusinessLogic.OfficePackage
{
CreateWord(info);
// Добавляем заголовок
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
@ -19,24 +20,61 @@ namespace DiningRoomBusinessLogic.OfficePackage
}
});
foreach (var product in info.Products)
// Группируем компоненты по имени компонента
var groupedComponents = info.ProductComponents
.GroupBy(item => item.ComponentName)
.ToList();
// Перебираем группы компонентов и добавляем их в документ
foreach (var group in groupedComponents)
{
// Добавляем строку с названием компонента
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)> {
(product.ProductName + ": ", new WordTextProperties { Size = "24", Bold = true }),
(Convert.ToInt32(product.Cost).ToString(), new WordTextProperties { Size = "24", })},
Texts = new List<(string, WordTextProperties)> { ("Продукт - " + group.Key + ":", new WordTextProperties { Size = "24", Bold = true }) },
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Both
}
});
// Перебираем продукты внутри группы компонентов
foreach (var product in group)
{
// Добавляем информацию о продукте
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)> {
("Количество блюд в заказе - "+Convert.ToInt32(product.ProductCount).ToString() + " ", new WordTextProperties { Size = "24" }),
("Название заказа - "+product.OrderName, new WordTextProperties { Size = "24"})
},
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Both
}
});
}
// Добавляем пустые абзацы для создания отступа
for (int i = 0; i < 2; i++)
{
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)> { ("", new WordTextProperties { Size = "24" }) },
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Both
}
});
}
}
SaveWord(info);
}
/// <summary>
/// Создание doc-файла
/// </summary>

View File

@ -12,6 +12,6 @@ namespace DiningRoomBusinessLogic.OfficePackage.HelperModels
public DateTime DateTo { get; set; }
public List<ReportOrdersViewModel> Orders { get; set; } = new();
public List<ReportComponentByDateViewModel> Components { get; set; } = new();
}
}

View File

@ -8,6 +8,6 @@ namespace DiningRoomBusinessLogic.OfficePackage.HelperModels
public string Title { get; set; } = string.Empty;
public List<ProductViewModel> Products { get; set; } = new();
public List<ReportComponentOrderViewModel> ProductComponents { get; set; } = new();
}
}

View File

@ -16,8 +16,9 @@ namespace DiningRoomContracts.BusinessLogicContracts
/// </summary>
List<ReportComponentByDateViewModel> GetReportComponentsByCardDate(ReportBindingModel Report);
void SaveReportToWordFile(ReportBindingModel Model);
void SaveReportToWordFile(ReportBindingModel Model, List<ComponentSearchModel> selectedComponents);
void SaveReportToExcelFile(ReportBindingModel Model, List<ComponentSearchModel> selectedComponents);
}
void SaveComponentsToPdfFile(ReportBindingModel model);
}
}

View File

@ -0,0 +1,9 @@
using DiningRoomContracts.ViewModels;
public class GroupedComponentViewModel
{
public string ComponentName { get; set; }
public double? ComponentCost { get; set; }
public string CardName { get; set; }
public string ProductName { get; set; }
}

View File

@ -16,5 +16,7 @@
public int CardId { get; set; }
public string CardName { get; set; }
}
public DateTime DateCardCreate { get; set; } = DateTime.Now;
}
}

View File

@ -130,6 +130,7 @@ namespace DiningRoomDatabaseImplement.Implements
.SelectMany(card => card.Drinks
.SelectMany(d => d.Components.SelectMany(dc => dc.Component.ProductComponents.Select(pc => new ReportComponentByDateViewModel
{
DateCardCreate = card.DateCardCreate,
ComponentId = pc.ComponentId,
ComponentName = dc.Component.ComponentName,
ComponentCost = dc.Component.Cost,

View File

@ -9,6 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="iTextSharp" Version="5.5.13.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View File

@ -38,6 +38,7 @@
заказыПоПродуктамToolStripMenuItem = new ToolStripMenuItem();
wordToolStripMenuItem = new ToolStripMenuItem();
excelToolStripMenuItem = new ToolStripMenuItem();
продуктыПоБлюдамИКартамToolStripMenuItem = new ToolStripMenuItem();
button1 = new Button();
label1 = new Label();
label2 = new Label();
@ -102,7 +103,7 @@
//
// отчетыToolStripMenuItem
//
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { заказыПоПродуктамToolStripMenuItem });
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { заказыПоПродуктамToolStripMenuItem, продуктыПоБлюдамИКартамToolStripMenuItem });
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
отчетыToolStripMenuItem.Size = new Size(60, 20);
отчетыToolStripMenuItem.Text = "Отчеты";
@ -111,22 +112,30 @@
//
заказыПоПродуктамToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { wordToolStripMenuItem, excelToolStripMenuItem });
заказыПоПродуктамToolStripMenuItem.Name = аказыПоПродуктамToolStripMenuItem";
заказыПоПродуктамToolStripMenuItem.Size = new Size(192, 22);
заказыПоПродуктамToolStripMenuItem.Size = new Size(246, 22);
заказыПоПродуктамToolStripMenuItem.Text = "Заказы по продуктам";
//
// wordToolStripMenuItem
//
wordToolStripMenuItem.Name = "wordToolStripMenuItem";
wordToolStripMenuItem.Size = new Size(180, 22);
wordToolStripMenuItem.Size = new Size(103, 22);
wordToolStripMenuItem.Text = "Word";
wordToolStripMenuItem.Click += отчетWordToolStripMenuItem_Click;
//
// excelToolStripMenuItem
//
excelToolStripMenuItem.Name = "excelToolStripMenuItem";
excelToolStripMenuItem.Size = new Size(180, 22);
excelToolStripMenuItem.Size = new Size(103, 22);
excelToolStripMenuItem.Text = "Excel";
excelToolStripMenuItem.Click += ОтчетыToolStripMenuItem_Click;
//
// продуктыПоБлюдамИКартамToolStripMenuItem
//
продуктыПоБлюдамИКартамToolStripMenuItem.Name = "продуктыПоБлюдамИКартамToolStripMenuItem";
продуктыПоБлюдамИКартамToolStripMenuItem.Size = new Size(246, 22);
продуктыПоБлюдамИКартамToolStripMenuItem.Text = "Продукты по блюдам и картам";
продуктыПоБлюдамИКартамToolStripMenuItem.Click += списокПродуктовPDFToolStripMenuItem_Click;
//
// button1
//
button1.Location = new Point(491, 139);
@ -267,5 +276,6 @@
private ToolStripMenuItem заказыПоПродуктамToolStripMenuItem;
private ToolStripMenuItem wordToolStripMenuItem;
private ToolStripMenuItem excelToolStripMenuItem;
private ToolStripMenuItem продуктыПоБлюдамИКартамToolStripMenuItem;
}
}

View File

@ -20,16 +20,21 @@ namespace DiningRoomView
{
private readonly ILogger _logger;
private readonly IProductLogic _productLogic;
private readonly IDrinkLogic _drinkLogic;
private readonly IComponentLogic _logicC;
private readonly IDrinkLogic _drinkLogic;
private readonly IUserLogic _userLogic;
private readonly IReportLogic _reportLogic;
private UserViewModel? _currentUser;
public FormMain(ILogger<FormMain> logger, IProductLogic productLogic, IDrinkLogic drinkLogic, IUserLogic userLogic)
public List<ComponentSearchModel> SelectedComp;
public FormMain(ILogger<FormMain> logger, IProductLogic productLogic, IDrinkLogic drinkLogic, IUserLogic userLogic, IReportLogic reportLogic, IComponentLogic logicC)
{
InitializeComponent();
_logger = logger;
_productLogic = productLogic;
_drinkLogic = drinkLogic;
_userLogic = userLogic;
_reportLogic = reportLogic;
_logicC = logicC;
}
private void FormMain_Load(object sender, EventArgs e)
{
@ -137,6 +142,47 @@ namespace DiningRoomView
form.ShowDialog();
}
}
private void отчетWordToolStripMenuItem_Click(object sender, EventArgs e)
{
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
if (dialog.ShowDialog() == DialogResult.OK)
{
try
{
using (var formProductSelection = new FormComponentSelection(_logicC, _currentUser))
{
if (formProductSelection.ShowDialog() == DialogResult.OK)
{
var selectedProducts = formProductSelection.SelectedProducts;
SelectedComp = selectedProducts;
if (selectedProducts != null && selectedProducts.Any())
{
var reportData = _reportLogic.GetReportComponentsWithOrders(selectedProducts);
}
}
}
_logger.LogInformation("Загрузка списка компонентов по заказам");
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки списка изделий по компонентам");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
_reportLogic.SaveReportToWordFile(new ReportBindingModel { FileName = dialog.FileName },SelectedComp);
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void списокПродуктовPDFToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormReportComponentsByDate));
if (service is FormReportComponentsByDate form)
{
form.ShowDialog();
}
}
private void КартыToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_currentUser == null)

View File

@ -1,127 +0,0 @@
namespace DiningRoomView
{
partial class FormOrdersOld
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
dataGridView = new DataGridView();
ButtonCreateOrder = new Button();
ButtonRef = new Button();
ButtonIssuedOrder = new Button();
ButtonOrderReady = new Button();
ButtonTakeOrderInWork = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// dataGridView
//
dataGridView.BackgroundColor = SystemColors.ButtonHighlight;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.EnableHeadersVisualStyles = false;
dataGridView.Location = new Point(12, 12);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.Size = new Size(600, 371);
dataGridView.TabIndex = 1;
//
// ButtonCreateOrder
//
ButtonCreateOrder.Location = new Point(618, 12);
ButtonCreateOrder.Name = "ButtonCreateOrder";
ButtonCreateOrder.Size = new Size(122, 23);
ButtonCreateOrder.TabIndex = 2;
ButtonCreateOrder.Text = "Создать заказ";
ButtonCreateOrder.UseVisualStyleBackColor = true;
ButtonCreateOrder.Click += ButtonCreateOrder_Click;
//
// ButtonRef
//
ButtonRef.Location = new Point(618, 147);
ButtonRef.Name = "ButtonRef";
ButtonRef.Size = new Size(122, 23);
ButtonRef.TabIndex = 6;
ButtonRef.Text = "Обновить список";
ButtonRef.UseVisualStyleBackColor = true;
ButtonRef.Click += ButtonRef_Click;
//
// ButtonIssuedOrder
//
ButtonIssuedOrder.Location = new Point(618, 118);
ButtonIssuedOrder.Name = "ButtonIssuedOrder";
ButtonIssuedOrder.Size = new Size(122, 23);
ButtonIssuedOrder.TabIndex = 5;
ButtonIssuedOrder.Text = "Заказ выдан";
ButtonIssuedOrder.UseVisualStyleBackColor = true;
ButtonIssuedOrder.Click += ButtonIssuedOrder_Click;
//
// ButtonOrderReady
//
ButtonOrderReady.Location = new Point(618, 89);
ButtonOrderReady.Name = "ButtonOrderReady";
ButtonOrderReady.Size = new Size(122, 23);
ButtonOrderReady.TabIndex = 4;
ButtonOrderReady.Text = "Заказ готов";
ButtonOrderReady.UseVisualStyleBackColor = true;
ButtonOrderReady.Click += ButtonOrderReady_Click;
//
// ButtonTakeOrderInWork
//
ButtonTakeOrderInWork.Location = new Point(618, 41);
ButtonTakeOrderInWork.Name = "ButtonTakeOrderInWork";
ButtonTakeOrderInWork.Size = new Size(122, 42);
ButtonTakeOrderInWork.TabIndex = 3;
ButtonTakeOrderInWork.Text = "Отдать на выполнение";
ButtonTakeOrderInWork.UseVisualStyleBackColor = true;
ButtonTakeOrderInWork.Click += ButtonTakeOrderInWork_Click;
//
// FormOrders
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(752, 391);
Controls.Add(ButtonRef);
Controls.Add(ButtonIssuedOrder);
Controls.Add(ButtonOrderReady);
Controls.Add(ButtonTakeOrderInWork);
Controls.Add(ButtonCreateOrder);
Controls.Add(dataGridView);
Name = "FormOrders";
Text = "Заказы";
Load += FormMain_Load;
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dataGridView;
private System.Windows.Forms.Button ButtonCreateOrder;
private System.Windows.Forms.Button ButtonRef;
private Button ButtonIssuedOrder;
private Button ButtonOrderReady;
private Button ButtonTakeOrderInWork;
}
}

View File

@ -1,145 +0,0 @@
using DiningRoomBusinessLogic.BusinessLogic;
using DiningRoomContracts.BindingModels;
using DiningRoomContracts.BusinessLogicContracts;
using DiningRoomContracts.SearchModels;
using DiningRoomContracts.ViewModels;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DiningRoomView
{
public partial class FormOrdersOld : Form
{
private readonly ILogger _logger;
private readonly IOrderLogic _orderLogic;
public UserViewModel? _currentUser { get; set; }
public FormOrdersOld(ILogger<FormMain> logger, IOrderLogic orderLogic)
{
InitializeComponent();
_logger = logger;
_orderLogic = orderLogic;
}
private void FormMain_Load(object sender, EventArgs e)
{
LoadData();
}
private void LoadData()
{
if (_currentUser == null)
{
MessageBox.Show("Ошибка авторизации", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_logger.LogInformation("Загрузка заказов");
// прописать логику
try
{
var list = _orderLogic.ReadList(new OrderSearchModel { UserId = _currentUser.Id });
if (list != null)
{
dataGridView.DataSource = list;
dataGridView.Columns["ProductId"].Visible = false;
}
_logger.LogInformation("Загрузка продуктов");
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки продуктов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCreateOrder_Click(object sender, EventArgs e)
{
if (_currentUser == null)
{
MessageBox.Show("Ошибка авторизации", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
if (service is FormCreateOrder form)
{
form.UserId = _currentUser.Id;
form.ShowDialog();
LoadData();
}
}
private void ButtonTakeOrderInWork_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id);
try
{
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { Id = id });
if (!operationResult)
{
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
}
LoadData();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка передачи заказа в работу");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void ButtonOrderReady_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'", id);
try
{
var operationResult = _orderLogic.FinishOrder(new OrderBindingModel { Id = id });
if (!operationResult)
{
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
}
LoadData();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка отметки о готовности заказа"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void ButtonIssuedOrder_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Заказ №{id}. Меняется статус на 'Выдан'", id);
try
{
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { Id = id });
if (!operationResult)
{
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
}
_logger.LogInformation("Заказ №{id} выдан", id);
LoadData();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка отметки о выдачи заказа");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void ButtonRef_Click(object sender, EventArgs e)
{
LoadData();
}
}
}

View File

@ -0,0 +1,155 @@
namespace DiningRoomView
{
partial class FormReportComponentsByDate
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
panel = new Panel();
buttonToPdf = new Button();
buttonMake = new Button();
dateTimePickerTo = new DateTimePicker();
labelTo = new Label();
dateTimePickerFrom = new DateTimePicker();
labelFrom = new Label();
dataGridView = new DataGridView();
panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panel
//
panel.Controls.Add(buttonToPdf);
panel.Controls.Add(buttonMake);
panel.Controls.Add(dateTimePickerTo);
panel.Controls.Add(labelTo);
panel.Controls.Add(dateTimePickerFrom);
panel.Controls.Add(labelFrom);
panel.Dock = DockStyle.Top;
panel.Location = new Point(0, 0);
panel.Margin = new Padding(4, 3, 4, 3);
panel.Name = "panel";
panel.Size = new Size(1031, 40);
panel.TabIndex = 0;
//
// buttonToPdf
//
buttonToPdf.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonToPdf.Location = new Point(878, 8);
buttonToPdf.Margin = new Padding(4, 3, 4, 3);
buttonToPdf.Name = "buttonToPdf";
buttonToPdf.Size = new Size(139, 27);
buttonToPdf.TabIndex = 5;
buttonToPdf.Text = "В Pdf";
buttonToPdf.UseVisualStyleBackColor = true;
buttonToPdf.Click += buttonGenerateAndSendPdf_Click;
//
// buttonMake
//
buttonMake.Location = new Point(476, 8);
buttonMake.Margin = new Padding(4, 3, 4, 3);
buttonMake.Name = "buttonMake";
buttonMake.Size = new Size(139, 27);
buttonMake.TabIndex = 4;
buttonMake.Text = "Сформировать";
buttonMake.UseVisualStyleBackColor = true;
buttonMake.Click += ButtonMake_Click;
//
// dateTimePickerTo
//
dateTimePickerTo.Location = new Point(237, 7);
dateTimePickerTo.Margin = new Padding(4, 3, 4, 3);
dateTimePickerTo.Name = "dateTimePickerTo";
dateTimePickerTo.Size = new Size(163, 23);
dateTimePickerTo.TabIndex = 3;
//
// labelTo
//
labelTo.AutoSize = true;
labelTo.Location = new Point(208, 10);
labelTo.Margin = new Padding(4, 0, 4, 0);
labelTo.Name = "labelTo";
labelTo.Size = new Size(21, 15);
labelTo.TabIndex = 2;
labelTo.Text = "по";
//
// dateTimePickerFrom
//
dateTimePickerFrom.Location = new Point(37, 7);
dateTimePickerFrom.Margin = new Padding(4, 3, 4, 3);
dateTimePickerFrom.Name = "dateTimePickerFrom";
dateTimePickerFrom.Size = new Size(163, 23);
dateTimePickerFrom.TabIndex = 1;
//
// labelFrom
//
labelFrom.AutoSize = true;
labelFrom.Location = new Point(14, 10);
labelFrom.Margin = new Padding(4, 0, 4, 0);
labelFrom.Name = "labelFrom";
labelFrom.Size = new Size(15, 15);
labelFrom.TabIndex = 0;
labelFrom.Text = "С";
//
// dataGridView
//
dataGridView.BackgroundColor = SystemColors.ButtonHighlight;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Location = new Point(12, 46);
dataGridView.Name = "dataGridView";
dataGridView.RowTemplate.Height = 25;
dataGridView.Size = new Size(1005, 589);
dataGridView.TabIndex = 1;
//
// FormReportComponentsByDate
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1031, 647);
Controls.Add(dataGridView);
Controls.Add(panel);
Margin = new Padding(4, 3, 4, 3);
Name = "FormReportComponentsByDate";
StartPosition = FormStartPosition.CenterScreen;
Text = "Заказы";
panel.ResumeLayout(false);
panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel;
private System.Windows.Forms.Button buttonToPdf;
private System.Windows.Forms.Button buttonMake;
private System.Windows.Forms.DateTimePicker dateTimePickerTo;
private System.Windows.Forms.Label labelTo;
private System.Windows.Forms.DateTimePicker dateTimePickerFrom;
private System.Windows.Forms.Label labelFrom;
private DataGridView dataGridView;
}
}

View File

@ -0,0 +1,247 @@
using DiningRoomBusinessLogic.OfficePackage.HelperModels;
using DiningRoomContracts.BindingModels;
using DiningRoomContracts.BusinessLogicContracts;
using Microsoft.Extensions.Logging;
using Microsoft.Reporting.WinForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Mail;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Windows.Forms;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace DiningRoomView
{
public partial class FormReportComponentsByDate : Form
{
private readonly ILogger _logger;
private readonly IReportLogic _logic;
public FormReportComponentsByDate(ILogger<FormReportComponentsByDate> logger, IReportLogic logic)
{
InitializeComponent();
_logger = logger;
_logic = logic;
}
private void ButtonMake_Click(object sender, EventArgs e)
{
if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date)
{
MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try
{
var dataSource = _logic.GetReportComponentsByCardDate(new ReportBindingModel
{
DateFrom = DateTime.SpecifyKind(dateTimePickerFrom.Value, DateTimeKind.Utc),
DateTo = DateTime.SpecifyKind(dateTimePickerTo.Value, DateTimeKind.Utc)
});
// Группировка данных по ComponentName и преобразование в нужный формат
var displayData = new List<GroupedComponentViewModel>();
var groupedData = dataSource.GroupBy(c => c.ComponentName);
foreach (var group in groupedData)
{
// Добавляем строку с именем компонента и его стоимостью
displayData.Add(new GroupedComponentViewModel
{
ComponentName = group.Key,
ComponentCost = group.First().ComponentCost
});
// Добавляем строки с названием карты и блюда
foreach (var item in group)
{
displayData.Add(new GroupedComponentViewModel
{
CardName = item.CardName,
ProductName = item.ProductName
});
}
}
// Очистка предыдущих данных
dataGridView.DataSource = null;
// Установка нового источника данных
dataGridView.DataSource = displayData;
// Форматирование столбцов
dataGridView.Columns["ComponentName"].HeaderText = "Название компонента";
dataGridView.Columns["ComponentCost"].HeaderText = "Стоимость компонента";
dataGridView.Columns["CardName"].HeaderText = "Название карты";
dataGridView.Columns["ProductName"].HeaderText = "Название блюда";
// Настройка видимости столбцов
dataGridView.Columns["ComponentName"].Visible = true;
dataGridView.Columns["ComponentCost"].Visible = true;
dataGridView.Columns["CardName"].Visible = true;
dataGridView.Columns["ProductName"].Visible = true;
// Логирование успешной загрузки данных
_logger.LogInformation("Загрузка списка заказов на период {From}-{To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString());
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки списка заказов на период");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonToPdf_Click(object sender, EventArgs e)
{
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date)
{
MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" };
if (dialog.ShowDialog() == DialogResult.OK)
{
try
{
_logic.SaveComponentsToPdfFile(new ReportBindingModel
{
FileName = dialog.FileName,
DateFrom = DateTime.SpecifyKind(dateTimePickerFrom.Value, DateTimeKind.Utc),
DateTo = DateTime.SpecifyKind(dateTimePickerTo.Value, DateTimeKind.Utc)
});
_logger.LogInformation("Сохранение списка заказов на период {From}-{To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString());
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка сохранения списка заказов на период");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void buttonGenerateAndSendPdf_Click(object sender, EventArgs e)
{
try
{
// Получение данных для PDF
var info = new PdfInfo
{
Title = "Отчет",
DateFrom = dateTimePickerFrom.Value,
DateTo = dateTimePickerTo.Value,
Components = _logic.GetReportComponentsByCardDate(new ReportBindingModel
{
DateFrom = DateTime.SpecifyKind(dateTimePickerFrom.Value, DateTimeKind.Utc),
DateTo = DateTime.SpecifyKind(dateTimePickerTo.Value, DateTimeKind.Utc)
})
};
// Генерация PDF в памяти
using (MemoryStream stream = new MemoryStream())
{
CreateDoc(info, stream);
// Email пользователя
string userEmail = "tikhonenkov2015@gmail.com"; // Замените на email пользователя
// Отправка email с PDF вложением
SendEmailWithPdf(stream, userEmail);
}
MessageBox.Show("PDF файл успешно отправлен на почту!", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show("Ошибка: " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public void CreateDoc(PdfInfo info, MemoryStream stream)
{
Document document = new Document();
PdfWriter writer = PdfWriter.GetInstance(document, stream);
document.Open();
document.Add(new Paragraph(info.Title, FontFactory.GetFont("Arial", "16", Font.Bold)));
document.Add(new Paragraph($"с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}", FontFactory.GetFont("Arial", "12")));
PdfPTable table = new PdfPTable(4);
table.WidthPercentage = 100;
table.SetWidths(new float[] { 3, 2, 6, 6 });
var groupedData = info.Components.GroupBy(c => c.ComponentName);
foreach (var group in groupedData)
{
PdfPCell cell = new PdfPCell(new Phrase("Продукт", FontFactory.GetFont("Arial", "12", Font.Bold)));
cell.Colspan = 4;
table.AddCell(cell);
table.AddCell(new Phrase(group.Key, FontFactory.GetFont("Arial", "12", Font.Bold)));
table.AddCell(new Phrase(group.First().ComponentCost.ToString("C"), FontFactory.GetFont("Arial", "12", Font.Bold)));
table.AddCell("");
table.AddCell("");
table.AddCell(new Phrase("", FontFactory.GetFont("Arial", "12", Font.Bold)));
table.AddCell("");
table.AddCell(new Phrase("Карта", FontFactory.GetFont("Arial", "12", Font.Bold)));
table.AddCell(new Phrase("Блюдо", FontFactory.GetFont("Arial", "12", Font.Bold)));
foreach (var item in group)
{
table.AddCell("");
table.AddCell("");
table.AddCell(new Phrase(item.CardName, FontFactory.GetFont("Arial", 12)));
table.AddCell(new Phrase(item.ProductName, FontFactory.GetFont("Arial", 12)));
}
}
document.Add(table);
document.Close();
writer.Close();
}
private void SendEmailWithPdf(MemoryStream pdfStream, string userEmail)
{
pdfStream.Position = 0; // Сбросить позицию потока на начало
MailMessage mail = new MailMessage();
SmtpClient smtpClient = new SmtpClient("smtp.example.com"); // Замените на SMTP-сервер вашего почтового провайдера
mail.From = new MailAddress("mailworker2024@gmail.com"); // Ваш email
mail.To.Add(userEmail);
mail.Subject = "Отчет";
mail.Body = "Пожалуйста, найдите прикрепленный PDF отчет.";
// Создание вложения из потока
Attachment attachment = new Attachment(pdfStream, "Report.pdf", "application/pdf");
mail.Attachments.Add(attachment);
smtpClient.Port = 587; // Обычно 587 или 25 для SMTP
smtpClient.Credentials = new NetworkCredential("mailworker2024@gmail.com", "bixb rbag kumt lefa"); // Ваш email и пароль
smtpClient.EnableSsl = true;
smtpClient.Send(mail);
}
}
}

View File

@ -70,6 +70,7 @@ namespace DiningRoomView
services.AddTransient<FormLogin>();
services.AddTransient<FormReportProductComponents>();
services.AddTransient<FormComponentSelection>();
services.AddTransient<FormReportComponentsByDate>();
}

View File

@ -0,0 +1,577 @@
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="DiningRoomContractsViewModels">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties>
<rd:DataSourceID>10791c83-cee8-4a38-bbd0-245fc17cefb3</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSetOrders">
<Query>
<DataSourceName>DiningRoomContractsViewModels</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="Id">
<DataField>Id</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="DateCreate">
<DataField>DateCreate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name="WoodName">
<DataField>WoodName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Sum">
<DataField>Sum</DataField>
<rd:TypeName>System.Double</rd:TypeName>
</Field>
<Field Name="Status">
<DataField>Status</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DiningRoomContracts.ViewModels</rd:DataSetName>
<rd:TableName>ReportOrdersViewModel</rd:TableName>
<rd:ObjectDataSourceType>DiningRoomContracts.ViewModels.ReportOrdersViewModel, DiningRoomContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
</rd:DataSetInfo>
</DataSet>
</DataSets>
<ReportSections>
<ReportSection>
<Body>
<ReportItems>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Заказы</Value>
<Style />
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Height>0.6cm</Height>
<Width>16.51cm</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Tablix Name="Tablix1">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.6cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>ComponentId</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox4">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Date Create</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox4</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox6">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Wood Name</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox6</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Sum</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox10">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Status</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox10</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.6cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="ComponentId">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!ComponentId.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="DateCreate">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!DateCreate.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>DateCreate</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="WoodName">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!WoodName.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>WoodName</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Sum">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Sum.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Sum</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Status">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Status.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Status</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
</TablixMember>
<TablixMember>
<Group Name="Подробности" />
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DataSetOrders</DataSetName>
<Top>1.95474cm</Top>
<Left>0.76412cm</Left>
<Height>1.2cm</Height>
<Width>12.5cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Tablix>
<Textbox Name="Textbox13">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Итого:</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Top>3.7465cm</Top>
<Left>8.26412cm</Left>
<Height>0.6cm</Height>
<Width>2.5cm</Width>
<ZIndex>2</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox14">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!Sum.Value, "DataSetOrders")</Value>
<Style>
<Format>0.00;(0.00)</Format>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>3.7465cm</Top>
<Left>10.76412cm</Left>
<Height>0.6cm</Height>
<Width>2.5cm</Width>
<ZIndex>3</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="ReportParameterPeriod">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!ReportParameterPeriod.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>ReportParameterPeriod</rd:DefaultName>
<Top>0.94932cm</Top>
<Height>0.6cm</Height>
<Width>16.51cm</Width>
<ZIndex>4</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>2in</Height>
<Style />
</Body>
<Width>7.48276in</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>
<LeftMargin>2cm</LeftMargin>
<RightMargin>2cm</RightMargin>
<TopMargin>2cm</TopMargin>
<BottomMargin>2cm</BottomMargin>
<ColumnSpacing>0.13cm</ColumnSpacing>
<Style />
</Page>
</ReportSection>
</ReportSections>
<ReportParameters>
<ReportParameter Name="ReportParameterPeriod">
<DataType>String</DataType>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<ReportParametersLayout>
<GridLayoutDefinition>
<NumberOfColumns>4</NumberOfColumns>
<NumberOfRows>2</NumberOfRows>
<CellDefinitions>
<CellDefinition>
<ColumnIndex>0</ColumnIndex>
<RowIndex>0</RowIndex>
<ParameterName>ReportParameterPeriod</ParameterName>
</CellDefinition>
</CellDefinitions>
</GridLayoutDefinition>
</ReportParametersLayout>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>18afbe83-6dd3-4305-bdbc-5f5158945a78</rd:ReportID>
</Report>