diff --git a/Pizzeria/Pizzeria/FormMain.Designer.cs b/Pizzeria/Pizzeria/FormMain.Designer.cs index 1a753ee..73ed42d 100644 --- a/Pizzeria/Pizzeria/FormMain.Designer.cs +++ b/Pizzeria/Pizzeria/FormMain.Designer.cs @@ -40,6 +40,10 @@ this.справочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.списокКомпонентовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.компонентовПоПиццамToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.списокЗаказовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -123,7 +127,8 @@ // this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.справочникиToolStripMenuItem}); + this.справочникиToolStripMenuItem, + this.отчетыToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(1233, 28); @@ -142,17 +147,48 @@ // компонентыToolStripMenuItem // this.компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; - this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(182, 26); this.компонентыToolStripMenuItem.Text = "Компоненты"; this.компонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click); // // изделияToolStripMenuItem // this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem"; - this.изделияToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.изделияToolStripMenuItem.Size = new System.Drawing.Size(182, 26); this.изделияToolStripMenuItem.Text = "Пиццы"; this.изделияToolStripMenuItem.Click += new System.EventHandler(this.ПиццыToolStripMenuItem_Click); // + // отчетыToolStripMenuItem + // + this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.списокКомпонентовToolStripMenuItem, + this.компонентовПоПиццамToolStripMenuItem, + this.списокЗаказовToolStripMenuItem}); + this.отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; + this.отчетыToolStripMenuItem.Size = new System.Drawing.Size(73, 24); + this.отчетыToolStripMenuItem.Text = "Отчеты"; + // + // списокКомпонентовToolStripMenuItem + // + this.списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem"; + this.списокКомпонентовToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.списокКомпонентовToolStripMenuItem.Text = "Список компонентов"; + this.списокКомпонентовToolStripMenuItem.Click += new System.EventHandler(this.ComponentsToolStripMenuItem_Click); + // + // компонентовПоПиццамToolStripMenuItem + // + this.компонентовПоПиццамToolStripMenuItem.Name = "компонентовПоПиццамToolStripMenuItem"; + this.компонентовПоПиццамToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.компонентовПоПиццамToolStripMenuItem.Text = "Компонентов по пиццам"; + this.компонентовПоПиццамToolStripMenuItem.Click += new System.EventHandler(this.ComponentPizzasToolStripMenuItem_Click); + // + // списокЗаказовToolStripMenuItem + // + this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; + this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.списокЗаказовToolStripMenuItem.Text = "Список заказов"; + this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.OrdersToolStripMenuItem_Click); + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -190,5 +226,9 @@ private ToolStripMenuItem справочникиToolStripMenuItem; private ToolStripMenuItem компонентыToolStripMenuItem; private ToolStripMenuItem изделияToolStripMenuItem; + private ToolStripMenuItem отчетыToolStripMenuItem; + private ToolStripMenuItem списокКомпонентовToolStripMenuItem; + private ToolStripMenuItem компонентовПоПиццамToolStripMenuItem; + private ToolStripMenuItem списокЗаказовToolStripMenuItem; } } \ No newline at end of file diff --git a/Pizzeria/Pizzeria/FormMain.cs b/Pizzeria/Pizzeria/FormMain.cs index cf5652d..eed58d0 100644 --- a/Pizzeria/Pizzeria/FormMain.cs +++ b/Pizzeria/Pizzeria/FormMain.cs @@ -9,11 +9,13 @@ namespace Pizzeria { private readonly ILogger _logger; private readonly IOrderLogic _orderLogic; - public FormMain(ILogger logger, IOrderLogic orderLogic) + private readonly IReportLogic _reportLogic; + public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic) { InitializeComponent(); _logger = logger; _orderLogic = orderLogic; + _reportLogic = reportLogic; } private void FormMain_Load(object sender, EventArgs e) { @@ -151,5 +153,38 @@ namespace Pizzeria LoadData(); } + + private void ComponentsToolStripMenuItem_Click(object sender, EventArgs +e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveComponentsToWordFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + MessageBox.Show("", "", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + } + private void ComponentPizzasToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = + Program.ServiceProvider?.GetService(typeof(FormReportPizzaComponents)); + if (service is FormReportPizzaComponents form) + { + form.ShowDialog(); + } + } + private void OrdersToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); + if (service is FormReportOrders form) + { + form.ShowDialog(); + } + } + } } \ No newline at end of file diff --git a/Pizzeria/Pizzeria/FormReportOrders.Designer.cs b/Pizzeria/Pizzeria/FormReportOrders.Designer.cs new file mode 100644 index 0000000..72dd438 --- /dev/null +++ b/Pizzeria/Pizzeria/FormReportOrders.Designer.cs @@ -0,0 +1,129 @@ +namespace Pizzeria +{ + partial class FormReportOrders + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.dateTimePickerFrom = new System.Windows.Forms.DateTimePicker(); + this.dateTimePickerTo = new System.Windows.Forms.DateTimePicker(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.panel = new System.Windows.Forms.Panel(); + this.SuspendLayout(); + // + // dateTimePickerFrom + // + this.dateTimePickerFrom.Location = new System.Drawing.Point(36, 13); + this.dateTimePickerFrom.Name = "dateTimePickerFrom"; + this.dateTimePickerFrom.Size = new System.Drawing.Size(174, 27); + this.dateTimePickerFrom.TabIndex = 0; + // + // dateTimePickerTo + // + this.dateTimePickerTo.Location = new System.Drawing.Point(249, 13); + this.dateTimePickerTo.Name = "dateTimePickerTo"; + this.dateTimePickerTo.Size = new System.Drawing.Size(174, 27); + this.dateTimePickerTo.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 18); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(18, 20); + this.label1.TabIndex = 3; + this.label1.Text = "C"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(216, 18); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(27, 20); + this.label2.TabIndex = 4; + this.label2.Text = "по"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(463, 11); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(135, 29); + this.button1.TabIndex = 5; + this.button1.Text = "Сформировать"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.ButtonMake_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(675, 11); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(94, 29); + this.button2.TabIndex = 6; + this.button2.Text = "В Pdf"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.ButtonToPdf_Click); + // + // panel + // + this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel.Location = new System.Drawing.Point(0, 46); + this.panel.Name = "panel"; + this.panel.Size = new System.Drawing.Size(843, 409); + this.panel.TabIndex = 7; + // + // FormReportOrders + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(842, 470); + this.Controls.Add(this.panel); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.dateTimePickerTo); + this.Controls.Add(this.dateTimePickerFrom); + this.Name = "FormReportOrders"; + this.Text = "FormReportOrders"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private DateTimePicker dateTimePickerFrom; + private DateTimePicker dateTimePickerTo; + private Label label1; + private Label label2; + private Button button1; + private Button button2; + private Panel panel; + } +} \ No newline at end of file diff --git a/Pizzeria/Pizzeria/FormReportOrders.cs b/Pizzeria/Pizzeria/FormReportOrders.cs new file mode 100644 index 0000000..412517a --- /dev/null +++ b/Pizzeria/Pizzeria/FormReportOrders.cs @@ -0,0 +1,90 @@ +using PizzeriaContracts.BindingModels; +using PizzeriaContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; +namespace Pizzeria +{ + public partial class FormReportOrders : Form + { + private readonly ReportViewer reportViewer; + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportOrders(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrders.rdlc", FileMode.Open)); + panel.Controls.Add(reportViewer); + } + 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.GetOrders(new ReportBindingModel + { + DateFrom = DateTime.SpecifyKind(dateTimePickerFrom.Value, DateTimeKind.Utc), + DateTo = DateTime.SpecifyKind(dateTimePickerTo.Value, DateTimeKind.Utc) + }); + var source = new ReportDataSource("DataSetOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") }; + reportViewer.LocalReport.SetParameters(parameters); + reportViewer.RefreshReport(); + _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) + { + 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.SaveOrdersToPdfFile(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); + } + } + } + + } +} \ No newline at end of file diff --git a/Pizzeria/Pizzeria/FormReportOrders.resx b/Pizzeria/Pizzeria/FormReportOrders.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/Pizzeria/Pizzeria/FormReportOrders.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Pizzeria/Pizzeria/FormReportPizzaComponents.Designer.cs b/Pizzeria/Pizzeria/FormReportPizzaComponents.Designer.cs new file mode 100644 index 0000000..447a87f --- /dev/null +++ b/Pizzeria/Pizzeria/FormReportPizzaComponents.Designer.cs @@ -0,0 +1,111 @@ +namespace Pizzeria +{ + partial class FormReportPizzaComponents + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.Компонент = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Пицца = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Количество = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(12, 12); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(159, 30); + this.button1.TabIndex = 0; + this.button1.Text = "Сохранить в Excel"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.ButtonSaveToExcel_Click); + // + // dataGridView + // + this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight; + this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Компонент, + this.Пицца, + this.Количество}); + this.dataGridView.Location = new System.Drawing.Point(12, 48); + this.dataGridView.Name = "dataGridView"; + this.dataGridView.RowHeadersWidth = 51; + this.dataGridView.RowTemplate.Height = 29; + this.dataGridView.Size = new System.Drawing.Size(783, 475); + this.dataGridView.TabIndex = 1; + // + // Компонент + // + this.Компонент.HeaderText = "Component"; + this.Компонент.MinimumWidth = 6; + this.Компонент.Name = "Компонент"; + this.Компонент.Width = 125; + // + // Пицца + // + this.Пицца.HeaderText = "Pizza"; + this.Пицца.MinimumWidth = 6; + this.Пицца.Name = "Пицца"; + this.Пицца.Width = 125; + // + // Количество + // + this.Количество.HeaderText = "Count"; + this.Количество.MinimumWidth = 6; + this.Количество.Name = "Количество"; + this.Количество.Width = 125; + // + // FormReportPizzaComponents + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(807, 519); + this.Controls.Add(this.dataGridView); + this.Controls.Add(this.button1); + this.Name = "FormReportPizzaComponents"; + this.Text = "FormReportPizzaComponents"; + this.Load += new System.EventHandler(this.FormReportPizzaComponents_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Button button1; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn Компонент; + private DataGridViewTextBoxColumn Пицца; + private DataGridViewTextBoxColumn Количество; + } +} \ No newline at end of file diff --git a/Pizzeria/Pizzeria/FormReportPizzaComponents.cs b/Pizzeria/Pizzeria/FormReportPizzaComponents.cs new file mode 100644 index 0000000..fb5b94f --- /dev/null +++ b/Pizzeria/Pizzeria/FormReportPizzaComponents.cs @@ -0,0 +1,75 @@ +using PizzeriaContracts.BindingModels; +using PizzeriaContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +namespace Pizzeria +{ + public partial class FormReportPizzaComponents : Form + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportPizzaComponents(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + private void FormReportPizzaComponents_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetPizzaComponent(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" }); + foreach (var listElem in elem.Pizzas) + { + dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); + } + dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount }); + dataGridView.Rows.Add(Array.Empty()); + } + } + _logger.LogInformation("Загрузка списка изделий по компонентам"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка изделий по компонентам"); + + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + private void ButtonSaveToExcel_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog + { + Filter = "xlsx|*.xlsx" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SavePizzaComponentToExcelFile(new + ReportBindingModel + { + FileName = dialog.FileName + }); + _logger.LogInformation("Сохранение списка изделий по компонентам"); + + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка изделий по компонентам"); + + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + } + } +} diff --git a/Pizzeria/Pizzeria/FormReportPizzaComponents.resx b/Pizzeria/Pizzeria/FormReportPizzaComponents.resx new file mode 100644 index 0000000..3804e60 --- /dev/null +++ b/Pizzeria/Pizzeria/FormReportPizzaComponents.resx @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + \ No newline at end of file diff --git a/Pizzeria/Pizzeria/Pizzeria.csproj b/Pizzeria/Pizzeria/Pizzeria.csproj index 50dc696..9b2c453 100644 --- a/Pizzeria/Pizzeria/Pizzeria.csproj +++ b/Pizzeria/Pizzeria/Pizzeria.csproj @@ -16,6 +16,7 @@ + @@ -29,6 +30,9 @@ Always + + Always + \ No newline at end of file diff --git a/Pizzeria/Pizzeria/Program.cs b/Pizzeria/Pizzeria/Program.cs index c1b9b43..658551c 100644 --- a/Pizzeria/Pizzeria/Program.cs +++ b/Pizzeria/Pizzeria/Program.cs @@ -1,4 +1,6 @@ using PizzeriaBusinessLogic; +using PizzeriaBusinessLogic.OfficePackage; +using PizzeriaBusinessLogic.OfficePackage.Implements; using PizzeriaContracts.BusinessLogicsContracts; using PizzeriaContracts.StoragesContracts; using PizzeriaDatabaseImplement.Implements; @@ -40,6 +42,11 @@ namespace Pizzeria services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -48,6 +55,8 @@ namespace Pizzeria services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file diff --git a/Pizzeria/Pizzeria/ReportOrders.rdlc b/Pizzeria/Pizzeria/ReportOrders.rdlc new file mode 100644 index 0000000..0eb814a --- /dev/null +++ b/Pizzeria/Pizzeria/ReportOrders.rdlc @@ -0,0 +1,529 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + PizzeriaContractsViewModels + /* Local Query */ + + + + Id + System.Int32 + + + DateCreate + System.DateTime + + + PizzaName + System.String + + + Sum + System.Decimal + + + + PizzeriaContracts.ViewModels + ReportOrdersViewModel + PizzeriaContracts.ViewModels.ReportOrdersViewModel, PizzeriaContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + + + + + true + true + + + + + =Parameters!ReportParameterPeriod.Value + + + + + + + ReportParameterPeriod + 1cm + 1cm + 17.4445cm + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Заказы + + + + + + + 1cm + 17.4445cm + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.5cm + + + 3.21438cm + + + 8.23317cm + + + 2.5cm + + + + + 0.6cm + + + + + true + true + + + + + Номер + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Дата создания + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Пицца + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Id.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DateCreate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PizzaName.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.Value + + + 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 + + + + 6.27908cm +