diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryShopDataModels/Models/IStoreModel.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryShopDataModels/Models/IStoreModel.cs new file mode 100644 index 0000000..ea34e71 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryShopDataModels/Models/IStoreModel.cs @@ -0,0 +1,17 @@ +using JewelryShopDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreDataModels.Models +{ + public interface IStoreModel : IId + { + public string StoreName { get; } + public string StoreAdress { get; } + DateTime OpeningDate { get; } + Dictionary Jewels { get; } + } +} diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryShopDataModels/Models/ISupplyModel.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryShopDataModels/Models/ISupplyModel.cs new file mode 100644 index 0000000..a656f7e --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryShopDataModels/Models/ISupplyModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreDataModels.Models +{ + public interface ISupplyModel + { + int ShopId { get; } + int JewelId { get; } + int Count { get; } + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.Designer.cs new file mode 100644 index 0000000..a94fe8b --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.Designer.cs @@ -0,0 +1,143 @@ +namespace JewelryStoreView +{ + partial class FormCreateSupply + { + /// + /// 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.comboBoxShop = new System.Windows.Forms.ComboBox(); + this.labelShop = new System.Windows.Forms.Label(); + this.labelJewel = new System.Windows.Forms.Label(); + this.comboBoxJewel = new System.Windows.Forms.ComboBox(); + this.labelCount = new System.Windows.Forms.Label(); + this.textBoxCount = new System.Windows.Forms.TextBox(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonSave = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // comboBoxShop + // + this.comboBoxShop.FormattingEnabled = true; + this.comboBoxShop.Location = new System.Drawing.Point(115, 12); + this.comboBoxShop.Name = "comboBoxShop"; + this.comboBoxShop.Size = new System.Drawing.Size(344, 28); + this.comboBoxShop.TabIndex = 0; + // + // labelShop + // + this.labelShop.AutoSize = true; + this.labelShop.Location = new System.Drawing.Point(12, 15); + this.labelShop.Name = "labelShop"; + this.labelShop.Size = new System.Drawing.Size(76, 20); + this.labelShop.TabIndex = 1; + this.labelShop.Text = "Магазин: "; + // + // labelJewel + // + this.labelJewel.AutoSize = true; + this.labelJewel.Location = new System.Drawing.Point(12, 49); + this.labelJewel.Name = "labelJewel"; + this.labelJewel.Size = new System.Drawing.Size(75, 20); + this.labelJewel.TabIndex = 2; + this.labelJewel.Text = "Изделие: "; + // + // comboBoxJewel + // + this.comboBoxJewel.FormattingEnabled = true; + this.comboBoxJewel.Location = new System.Drawing.Point(115, 46); + this.comboBoxJewel.Name = "comboBoxJewel"; + this.comboBoxJewel.Size = new System.Drawing.Size(344, 28); + this.comboBoxJewel.TabIndex = 3; + // + // labelCount + // + this.labelCount.AutoSize = true; + this.labelCount.Location = new System.Drawing.Point(12, 83); + this.labelCount.Name = "labelCount"; + this.labelCount.Size = new System.Drawing.Size(97, 20); + this.labelCount.TabIndex = 4; + this.labelCount.Text = "Количество: "; + // + // textBoxCount + // + this.textBoxCount.Location = new System.Drawing.Point(115, 80); + this.textBoxCount.Name = "textBoxCount"; + this.textBoxCount.Size = new System.Drawing.Size(344, 27); + this.textBoxCount.TabIndex = 5; + // + // buttonCancel + // + this.buttonCancel.Location = new System.Drawing.Point(300, 113); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(116, 39); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Отмена"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); + // + // buttonSave + // + this.buttonSave.Location = new System.Drawing.Point(168, 113); + this.buttonSave.Name = "buttonSave"; + this.buttonSave.Size = new System.Drawing.Size(116, 39); + this.buttonSave.TabIndex = 7; + this.buttonSave.Text = "Сохранить"; + this.buttonSave.UseVisualStyleBackColor = true; + this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click); + // + // FormCreateSupply + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(471, 164); + this.Controls.Add(this.buttonSave); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.textBoxCount); + this.Controls.Add(this.labelCount); + this.Controls.Add(this.comboBoxJewel); + this.Controls.Add(this.labelJewel); + this.Controls.Add(this.labelShop); + this.Controls.Add(this.comboBoxShop); + this.Name = "FormCreateSupply"; + this.Text = "Создание поставки"; + this.Load += new System.EventHandler(this.FormCreateSupply_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private ComboBox comboBoxShop; + private Label labelShop; + private Label labelJewel; + private ComboBox comboBoxJewel; + private Label labelCount; + private TextBox textBoxCount; + private Button buttonCancel; + private Button buttonSave; + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.cs new file mode 100644 index 0000000..518f149 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.cs @@ -0,0 +1,100 @@ +using Microsoft.Extensions.Logging; +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.BusinessLogicsContracts; +using JewelryStoreContracts.ViewModels; +using System; +using System.Collections; +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; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using JewelryStoreContracts.BindingModels; + +namespace JewelryStoreView +{ + public partial class FormCreateSupply : Form + { + private readonly ILogger _logger; + private readonly IJewelLogic _logicP; + private readonly IStoreLogic _logicS; + private List _shopList = new List(); + private List _jewelList = new List(); + + public FormCreateSupply(ILogger logger, IJewelLogic logicP, IStoreLogic logicS) + { + InitializeComponent(); + _logger = logger; + _logicP = logicP; + _logicS = logicS; + } + + private void FormCreateSupply_Load(object sender, EventArgs e) + { + _shopList = _logicS.ReadList(null); + _jewelList = _logicP.ReadList(null); + if (_shopList != null) + { + comboBoxShop.DisplayMember = "ShopName"; + comboBoxShop.ValueMember = "Id"; + comboBoxShop.DataSource = _shopList; + comboBoxShop.SelectedItem = null; + _logger.LogInformation("Загрузка магазинов для поставок"); + } + if (_jewelList != null) + { + comboBoxJewel.DisplayMember = "JewelName"; + comboBoxJewel.ValueMember = "Id"; + comboBoxJewel.DataSource = _jewelList; + comboBoxJewel.SelectedItem = null; + _logger.LogInformation("Загрузка изделий для поставок"); + } + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + if (comboBoxShop.SelectedValue == null) + { + MessageBox.Show("Выберите магазин", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (comboBoxJewel.SelectedValue == null) + { + MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + _logger.LogInformation("Создание поставки"); + try + { + var operationResult = _logicS.MakeSupply(new SupplyBindingModel + { + ShopId = Convert.ToInt32(comboBoxShop.SelectedValue), + JewelId = Convert.ToInt32(comboBoxJewel.SelectedValue), + Count = Convert.ToInt32(textBoxCount.Text) + }); + if (!operationResult) + { + throw new Exception("Ошибка при создании поставки. Дополнительная информация в логах."); + } + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания поставки"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.resx b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormCreateSupply.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.Designer.cs index 2fb53a5..2346b90 100644 --- a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.Designer.cs +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.Designer.cs @@ -42,7 +42,7 @@ this.buttonOrderReady = new System.Windows.Forms.Button(); this.buttonIssuedOrder = new System.Windows.Forms.Button(); this.buttonRefresh = new System.Windows.Forms.Button(); - this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.пополнениеМагазинаToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.SuspendLayout(); @@ -64,7 +64,8 @@ // this.СправочникиToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.КомпонентыToolStripMenuItem, - this.ИзделияToolStripMenuItem}); + this.ИзделияToolStripMenuItem, + this.магазиныToolStripMenuItem}); this.СправочникиToolStripMenuItem.Name = "СправочникиToolStripMenuItem"; this.СправочникиToolStripMenuItem.Size = new System.Drawing.Size(139, 29); this.СправочникиToolStripMenuItem.Text = "Справочники"; @@ -72,14 +73,14 @@ // КомпонентыToolStripMenuItem // this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem"; - this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(218, 34); + this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(270, 34); this.КомпонентыToolStripMenuItem.Text = "Компоненты"; this.КомпонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click); // // ИзделияToolStripMenuItem // this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem"; - this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(218, 34); + this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(270, 34); this.ИзделияToolStripMenuItem.Text = "Изделия"; this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click); // @@ -116,16 +117,12 @@ // // 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.Window; this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView.Location = new System.Drawing.Point(12, 36); this.dataGridView.Name = "dataGridView"; this.dataGridView.RowHeadersWidth = 62; this.dataGridView.RowTemplate.Height = 33; - this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView.Size = new System.Drawing.Size(851, 402); this.dataGridView.TabIndex = 1; // @@ -179,12 +176,12 @@ this.buttonRefresh.UseVisualStyleBackColor = true; this.buttonRefresh.Click += new System.EventHandler(this.ButtonRefresh_Click); // - // клиентыToolStripMenuItem + // пополнениеМагазинаToolStripMenuItem // - this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem"; - this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(96, 29); - this.клиентыToolStripMenuItem.Text = "Клиенты"; - this.клиентыToolStripMenuItem.Click += new System.EventHandler(this.КлиентыToolStripMenuItem_Click); + this.пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem"; + this.пополнениеМагазинаToolStripMenuItem.Size = new System.Drawing.Size(210, 29); + this.пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина"; + this.пополнениеМагазинаToolStripMenuItem.Click += new System.EventHandler(this.ПополнениеМагазинаToolStripMenuItem_Click); // // FormMain // diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.cs index 4f5f8cd..6bebb72 100644 --- a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.cs +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormMain.cs @@ -2,8 +2,10 @@ using JewelryStoreContracts.BindingModels; using JewelryStoreContracts.BusinessLogicsContracts; using JewelryStoreDataModels.Enums; +using JewelryStoreView; using Microsoft.Extensions.Logging; using System.Windows.Forms; +using PizzeriaView; namespace JewelryStore { @@ -100,6 +102,23 @@ namespace JewelryStore } } } + private void shopsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormStores)); + if (service is FormStores form) + { + form.ShowDialog(); + } + } + + private void transactionToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormCreateSupply)); + if (service is FormCreateSupply form) + { + form.ShowDialog(); + } + } private void ButtonOrderReady_Click(object sender, EventArgs e) { @@ -160,44 +179,50 @@ namespace JewelryStore LoadData(); } + private void BusyShopsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportShop)); + if (service is FormReportShop form) + { + form.ShowDialog(); + } + } - private void СписокИзделийToolStripMenuItem_Click(object sender, EventArgs e) + private void ПополнениеМагазинаToolStripMenuItem_Click(object sender, EventArgs e) { - using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; - if (dialog.ShowDialog() == DialogResult.OK) - { - _reportLogic.SaveJewelsToWordFile(new ReportBindingModel - { - FileName = dialog.FileName - }); - MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, - MessageBoxIcon.Information); - } - } - private void КомпонентыПоИзделиямToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormReportJewelComponents)); - if (service is FormReportJewelComponents form) - { - form.ShowDialog(); - } - } - private void СписокЗаказовToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); - if (service is FormReportOrders form) - { - form.ShowDialog(); - } - } + var service = Program.ServiceProvider?.GetService(typeof(FormStoreReplenishment)); - private void КлиентыToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormClients)); - if (service is FormClients form) + if (service is FormStoreReplenishment form) { form.ShowDialog(); } } - } + private void ComponentsToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveJewelsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + private void InfoToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveShopsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + private void GroupOrdersToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders)); + if (service is FormReportGroupedOrders form) + { + form.ShowDialog(); + } + } + + } } \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.Designer.cs new file mode 100644 index 0000000..f79dd7a --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.Designer.cs @@ -0,0 +1,86 @@ +namespace PizzeriaView +{ + partial class FormReportGroupedOrders + { + /// + /// 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.panel = new System.Windows.Forms.Panel(); + this.buttonToPDF = new System.Windows.Forms.Button(); + this.buttonMake = new System.Windows.Forms.Button(); + this.panel.SuspendLayout(); + this.SuspendLayout(); + // + // panel + // + this.panel.Controls.Add(this.buttonToPDF); + this.panel.Controls.Add(this.buttonMake); + this.panel.Dock = System.Windows.Forms.DockStyle.Top; + this.panel.Location = new System.Drawing.Point(0, 0); + this.panel.Name = "panel"; + this.panel.Size = new System.Drawing.Size(970, 52); + this.panel.TabIndex = 1; + // + // buttonToPDF + // + this.buttonToPDF.Location = new System.Drawing.Point(486, 12); + this.buttonToPDF.Name = "buttonToPDF"; + this.buttonToPDF.Size = new System.Drawing.Size(411, 29); + this.buttonToPDF.TabIndex = 5; + this.buttonToPDF.Text = "В PDF"; + this.buttonToPDF.UseVisualStyleBackColor = true; + this.buttonToPDF.Click += new System.EventHandler(this.buttonToPDF_Click); + // + // buttonMake + // + this.buttonMake.Location = new System.Drawing.Point(49, 12); + this.buttonMake.Name = "buttonMake"; + this.buttonMake.Size = new System.Drawing.Size(377, 29); + this.buttonMake.TabIndex = 4; + this.buttonMake.Text = "Сформировать"; + this.buttonMake.UseVisualStyleBackColor = true; + this.buttonMake.Click += new System.EventHandler(this.ButtonMake_Click); + // + // FormReportGroupedOrders + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(970, 450); + this.Controls.Add(this.panel); + this.Name = "FormReportGroupedOrders"; + this.Text = "Отчёт по группированным заказам "; + this.panel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Panel panel; + private Button buttonToPDF; + private Button buttonMake; + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.cs new file mode 100644 index 0000000..aa29713 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.cs @@ -0,0 +1,80 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.BusinessLogicsContracts; +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 PizzeriaView +{ + public partial class FormReportGroupedOrders : Form + { + private readonly ReportViewer reportViewer; + private readonly ILogger _logger; + private readonly IReportLogic _logic; + + public FormReportGroupedOrders(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportGroupedOrders.rdlc", FileMode.Open)); + Controls.Clear(); + Controls.Add(reportViewer); + Controls.Add(panel); + } + + private void ButtonMake_Click(object sender, EventArgs e) + { + try + { + var dataSource = _logic.GetGroupedOrders(); + var source = new ReportDataSource("DataSetGroupedOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + + reportViewer.RefreshReport(); + _logger.LogInformation("Загрузка списка группированных заказов"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка группированных заказов на период"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + + private void buttonToPDF_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveGroupedOrdersToPdfFile(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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.resx b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportGroupedOrders.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.Designer.cs new file mode 100644 index 0000000..540d9fd --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.Designer.cs @@ -0,0 +1,115 @@ +namespace PizzeriaView +{ + partial class FormReportShop + { + /// + /// 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.buttonSaveToExcel = new System.Windows.Forms.Button(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.ColumnShop = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnJewel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // buttonSaveToExcel + // + this.buttonSaveToExcel.Location = new System.Drawing.Point(0, 6); + this.buttonSaveToExcel.Name = "buttonSaveToExcel"; + this.buttonSaveToExcel.Size = new System.Drawing.Size(223, 29); + this.buttonSaveToExcel.TabIndex = 3; + this.buttonSaveToExcel.Text = "Сохранить в Excel"; + this.buttonSaveToExcel.UseVisualStyleBackColor = true; + this.buttonSaveToExcel.Click += new System.EventHandler(this.ButtonSaveToExcel_Click); + // + // dataGridView + // + this.dataGridView.AllowUserToAddRows = false; + this.dataGridView.AllowUserToDeleteRows = false; + this.dataGridView.AllowUserToOrderColumns = true; + this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.ColumnShop, + this.ColumnJewel, + this.ColumnCount}); + this.dataGridView.Dock = System.Windows.Forms.DockStyle.Bottom; + this.dataGridView.Location = new System.Drawing.Point(0, 47); + this.dataGridView.Name = "dataGridView"; + this.dataGridView.ReadOnly = true; + this.dataGridView.RowHeadersWidth = 51; + this.dataGridView.RowTemplate.Height = 29; + this.dataGridView.Size = new System.Drawing.Size(598, 403); + this.dataGridView.TabIndex = 2; + // + // ColumnShop + // + this.ColumnShop.FillWeight = 130F; + this.ColumnShop.HeaderText = "Магазин"; + this.ColumnShop.MinimumWidth = 6; + this.ColumnShop.Name = "ColumnShop"; + this.ColumnShop.ReadOnly = true; + + // + this.ColumnJewel.FillWeight = 140F; + this.ColumnJewel.HeaderText = "Украшения"; + this.ColumnJewel.MinimumWidth = 6; + this.ColumnJewel.Name = "ColumnJewel"; + this.ColumnJewel.ReadOnly = true; + // + // ColumnCount + // + this.ColumnCount.FillWeight = 90F; + this.ColumnCount.HeaderText = "Количество"; + this.ColumnCount.MinimumWidth = 6; + this.ColumnCount.Name = "ColumnCount"; + this.ColumnCount.ReadOnly = true; + // + // FormReportShop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(598, 450); + this.Controls.Add(this.buttonSaveToExcel); + this.Controls.Add(this.dataGridView); + this.Name = "FormReportShop"; + this.Text = "Наполненость магазинов"; + this.Load += new System.EventHandler(this.FormReportShop_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Button buttonSaveToExcel; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn ColumnShop; + private DataGridViewTextBoxColumn ColumnJewel; + private DataGridViewTextBoxColumn ColumnCount; + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.cs new file mode 100644 index 0000000..a30f5a1 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.cs @@ -0,0 +1,78 @@ +using Microsoft.Extensions.Logging; +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.BusinessLogicsContracts; +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 PizzeriaView +{ + public partial class FormReportShop : Form + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + + public FormReportShop(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormReportShop_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetShops(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.ShopName, "", "" }); + foreach (var listElem in elem.Jewels) + { + 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.SaveShopsToExcelFile(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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.resx b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormReportShop.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.Designer.cs new file mode 100644 index 0000000..9c1b44d --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.Designer.cs @@ -0,0 +1,200 @@ +namespace JewelryStore +{ + partial class FormStore + { + /// + /// 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.StoreNameLabel = new System.Windows.Forms.Label(); + this.StoreAdressLabel = new System.Windows.Forms.Label(); + this.OpeningDateLabel = new System.Windows.Forms.Label(); + this.NameTextBox = new System.Windows.Forms.TextBox(); + this.AdressTextBox = new System.Windows.Forms.TextBox(); + this.DataGridView = new System.Windows.Forms.DataGridView(); + this.JewelName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.JewelPrice = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.JewelCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.SaveButton = new System.Windows.Forms.Button(); + + this.OpeningDatePicker = new System.Windows.Forms.DateTimePicker(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpJewelMaxCount)).BeginInit(); + this.SuspendLayout(); + // + // StoreNameLabel + // + this.StoreNameLabel.AutoSize = true; + this.StoreNameLabel.Location = new System.Drawing.Point(17, 13); + this.StoreNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.StoreNameLabel.Name = "StoreNameLabel"; + this.StoreNameLabel.Size = new System.Drawing.Size(179, 25); + this.StoreNameLabel.TabIndex = 0; + this.StoreNameLabel.Text = "Название магазина: "; + // + // StoreAdressLabel + // + this.StoreAdressLabel.AutoSize = true; + this.StoreAdressLabel.Location = new System.Drawing.Point(17, 54); + this.StoreAdressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.StoreAdressLabel.Name = "StoreAdressLabel"; + this.StoreAdressLabel.Size = new System.Drawing.Size(151, 25); + this.StoreAdressLabel.TabIndex = 1; + this.StoreAdressLabel.Text = "Адрес магазина: "; + // + // OpeningDateLabel + // + this.OpeningDateLabel.AutoSize = true; + this.OpeningDateLabel.Location = new System.Drawing.Point(17, 99); + this.OpeningDateLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.OpeningDateLabel.Name = "OpeningDateLabel"; + this.OpeningDateLabel.Size = new System.Drawing.Size(140, 25); + this.OpeningDateLabel.TabIndex = 2; + this.OpeningDateLabel.Text = "Дата открытия: "; + // + // NameTextBox + // + this.NameTextBox.Location = new System.Drawing.Point(204, 10); + this.NameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.NameTextBox.Name = "NameTextBox"; + this.NameTextBox.Size = new System.Drawing.Size(247, 31); + this.NameTextBox.TabIndex = 3; + // + // AdressTextBox + // + this.AdressTextBox.Location = new System.Drawing.Point(204, 51); + this.AdressTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.AdressTextBox.Name = "AdressTextBox"; + this.AdressTextBox.Size = new System.Drawing.Size(247, 31); + this.AdressTextBox.TabIndex = 4; + // + // DataGridView + // + this.DataGridView.BackgroundColor = System.Drawing.SystemColors.Window; + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.JewelName, + this.JewelPrice, + this.JewelCount}); + this.DataGridView.Location = new System.Drawing.Point(13, 135); + this.DataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowHeadersWidth = 62; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(802, 365); + this.DataGridView.TabIndex = 6; + // + // JewelName + // + this.JewelName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.JewelName.HeaderText = "Название изделия"; + this.JewelName.MinimumWidth = 8; + this.JewelName.Name = "JewelName"; + // + // JewelPrice + // + this.JewelPrice.HeaderText = "Цена"; + this.JewelPrice.MinimumWidth = 8; + this.JewelPrice.Name = "JewelPrice"; + this.JewelPrice.Width = 150; + // + // JewelCount + // + this.JewelCount.HeaderText = "Количество"; + this.JewelCount.MinimumWidth = 8; + this.JewelCount.Name = "JewelCount"; + this.JewelCount.Width = 150; + // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(531, 510); + this.SaveButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(138, 35); + this.SaveButton.TabIndex = 7; + this.SaveButton.Text = "Сохранить"; + this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); + // + // ButtonCancel + // + this.ButtonCancel.Location = new System.Drawing.Point(677, 510); + this.ButtonCancel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.ButtonCancel.Name = "ButtonCancel"; + this.ButtonCancel.Size = new System.Drawing.Size(138, 35); + this.ButtonCancel.TabIndex = 8; + this.ButtonCancel.Text = "Отменить"; + this.ButtonCancel.UseVisualStyleBackColor = true; + this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); + // + // OpeningDatePicker + // + this.OpeningDatePicker.Location = new System.Drawing.Point(204, 94); + this.OpeningDatePicker.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.OpeningDatePicker.Name = "OpeningDatePicker"; + this.OpeningDatePicker.Size = new System.Drawing.Size(247, 31); + this.OpeningDatePicker.TabIndex = 9; + // + // FormStore + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(867, 560); + this.Controls.Add(this.OpeningDatePicker); + this.Controls.Add(this.ButtonCancel); + this.Controls.Add(this.SaveButton); + this.Controls.Add(this.DataGridView); + this.Controls.Add(this.AdressTextBox); + this.Controls.Add(this.NameTextBox); + this.Controls.Add(this.OpeningDateLabel); + this.Controls.Add(this.StoreAdressLabel); + this.Controls.Add(this.StoreNameLabel); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "FormStore"; + this.Text = "Изделия магазина"; + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Label StoreNameLabel; + private Label StoreAdressLabel; + private Label OpeningDateLabel; + private TextBox NameTextBox; + private TextBox AdressTextBox; + private DataGridView DataGridView; + private Button SaveButton; + private Button ButtonCancel; + private DataGridViewTextBoxColumn JewelName; + private DataGridViewTextBoxColumn JewelPrice; + private DataGridViewTextBoxColumn JewelCount; + private DateTimePicker OpeningDatePicker; + private DateTimePicker dateTimeOpen; + private NumericUpDown numericUpJewelMaxCount; + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.cs new file mode 100644 index 0000000..5592e36 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.cs @@ -0,0 +1,136 @@ +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.BusinessLogicsContracts; +using JewelryStoreContracts.SearchModels; +using JewelryStoreContracts.ViewModels; +using JewelryStoreDataModels.Models; +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 JewelryStore +{ + public partial class FormStore : Form + { + private int? _id; + public int Id { set { _id = value; } } + private Dictionary _Jewels; + private DateTime? _openingDate = null; + private readonly IStoreLogic _logic; + private readonly ILogger _logger; + + public FormStore(ILogger logger, IStoreLogic logic) + { + InitializeComponent(); + _logger = logger; + _Jewels = new Dictionary(); + _logic = logic; + } + private void FormShop_Load(object sender, EventArgs e) + { + if (_id.HasValue) + { + _logger.LogInformation("Загрузка магазина"); + try + { + var view = _logic.ReadElement(new StoreSearchModel + { + Id = _id.Value + }); + if (view != null) + { + NameTextBox.Text = view.StoreName; + AdressTextBox.Text = view.StoreAdress; + dateTimeOpen.Value = view.OpeningDate; + numericUpJewelMaxCount.Value = view.JewelMaxCount; + _Jewels = view.Jewels ?? new Dictionary(); + LoadData(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + + + private void SaveButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(NameTextBox.Text)) + { + MessageBox.Show("Заполните название", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (string.IsNullOrEmpty(AdressTextBox.Text)) + { + MessageBox.Show("Заполните адрес", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + _logger.LogInformation("Сохранение магазина"); + try + { + var model = new StoreBindingModel + { + Id = _id ?? 0, + StoreName = NameTextBox.Text, + StoreAdress = AdressTextBox.Text, + OpeningDate = dateTimeOpen.Value, + JewelMaxCount = (int)numericUpJewelMaxCount.Value + }; + var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model); + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + + private void LoadData() + { + _logger.LogInformation("Загрузка изделий в магазине"); + try + { + if (_Jewels != null) + { + DataGridView.Rows.Clear(); + foreach (var sr in _Jewels) + { + DataGridView.Rows.Add(new object[] { sr.Key, sr.Value.Item1.JewelName, sr.Value.Item2 }); + } + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки изделий магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + + + } +} diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.resx b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStore.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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.Designer.cs new file mode 100644 index 0000000..b8cdadd --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.Designer.cs @@ -0,0 +1,151 @@ +namespace JewelryStore +{ + partial class FormStoreReplenishment + { + /// + /// 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.StoreNameLabel = new System.Windows.Forms.Label(); + this.JewelNameLabel = new System.Windows.Forms.Label(); + this.CountLabel = new System.Windows.Forms.Label(); + this.StoreNameComboBox = new System.Windows.Forms.ComboBox(); + this.JewelNameComboBox = new System.Windows.Forms.ComboBox(); + this.CountTextBox = new System.Windows.Forms.TextBox(); + this.SaveButton = new System.Windows.Forms.Button(); + this.ButtonCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // StoreNameLabel + // + this.StoreNameLabel.AutoSize = true; + this.StoreNameLabel.Location = new System.Drawing.Point(9, 9); + this.StoreNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.StoreNameLabel.Name = "StoreNameLabel"; + this.StoreNameLabel.Size = new System.Drawing.Size(179, 25); + this.StoreNameLabel.TabIndex = 0; + this.StoreNameLabel.Text = "Название магазина: "; + // + // JewelNameLabel + // + this.JewelNameLabel.AutoSize = true; + this.JewelNameLabel.Location = new System.Drawing.Point(9, 58); + this.JewelNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.JewelNameLabel.Name = "JewelNameLabel"; + this.JewelNameLabel.Size = new System.Drawing.Size(169, 25); + this.JewelNameLabel.TabIndex = 1; + this.JewelNameLabel.Text = "Название изделия: "; + // + // CountLabel + // + this.CountLabel.AutoSize = true; + this.CountLabel.Location = new System.Drawing.Point(9, 107); + this.CountLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.CountLabel.Name = "CountLabel"; + this.CountLabel.Size = new System.Drawing.Size(116, 25); + this.CountLabel.TabIndex = 2; + this.CountLabel.Text = "Количество: "; + // + // StoreNameComboBox + // + this.StoreNameComboBox.FormattingEnabled = true; + this.StoreNameComboBox.Location = new System.Drawing.Point(196, 6); + this.StoreNameComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.StoreNameComboBox.Name = "StoreNameComboBox"; + this.StoreNameComboBox.Size = new System.Drawing.Size(272, 33); + this.StoreNameComboBox.TabIndex = 3; + // + // JewelNameComboBox + // + this.JewelNameComboBox.FormattingEnabled = true; + this.JewelNameComboBox.Location = new System.Drawing.Point(196, 55); + this.JewelNameComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.JewelNameComboBox.Name = "JewelNameComboBox"; + this.JewelNameComboBox.Size = new System.Drawing.Size(272, 33); + this.JewelNameComboBox.TabIndex = 4; + // + // CountTextBox + // + this.CountTextBox.Location = new System.Drawing.Point(196, 104); + this.CountTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.CountTextBox.Name = "CountTextBox"; + this.CountTextBox.Size = new System.Drawing.Size(272, 31); + this.CountTextBox.TabIndex = 5; + // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(234, 145); + this.SaveButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(107, 38); + this.SaveButton.TabIndex = 6; + this.SaveButton.Text = "Сохранить"; + this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); + // + // ButtonCancel + // + this.ButtonCancel.Location = new System.Drawing.Point(361, 145); + this.ButtonCancel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.ButtonCancel.Name = "ButtonCancel"; + this.ButtonCancel.Size = new System.Drawing.Size(107, 38); + this.ButtonCancel.TabIndex = 7; + this.ButtonCancel.Text = "Отмена"; + this.ButtonCancel.UseVisualStyleBackColor = true; + this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); + // + // FormStoreReplenishment + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(481, 200); + this.Controls.Add(this.ButtonCancel); + this.Controls.Add(this.SaveButton); + this.Controls.Add(this.CountTextBox); + this.Controls.Add(this.JewelNameComboBox); + this.Controls.Add(this.StoreNameComboBox); + this.Controls.Add(this.CountLabel); + this.Controls.Add(this.JewelNameLabel); + this.Controls.Add(this.StoreNameLabel); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "FormStoreReplenishment"; + this.Text = "Пополнение магазина"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Label StoreNameLabel; + private Label JewelNameLabel; + private Label CountLabel; + private ComboBox StoreNameComboBox; + private ComboBox JewelNameComboBox; + private TextBox CountTextBox; + private Button SaveButton; + private Button ButtonCancel; + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.cs new file mode 100644 index 0000000..579cd47 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.cs @@ -0,0 +1,91 @@ +using JewelryStoreContracts.BusinessLogicsContracts; +using JewelryStoreContracts.SearchModels; +using JewelryStoreContracts.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 JewelryStore +{ + public partial class FormStoreReplenishment : Form + { + private readonly ILogger _logger; + private readonly IStoreLogic _storeLogic; + private readonly IJewelLogic _jewelLogic; + private readonly List? _listStores; + private readonly List? _listJewels; + public FormStoreReplenishment(ILogger logger, IStoreLogic storeLogic, IJewelLogic jewelLogic) + { + InitializeComponent(); + _storeLogic = storeLogic; + _jewelLogic = jewelLogic; + _logger = logger; + _listStores = storeLogic.ReadList(null); + if (_listStores != null) + { + StoreNameComboBox.DisplayMember = "StoreName"; + StoreNameComboBox.ValueMember = "Id"; + StoreNameComboBox.DataSource = _listStores; + StoreNameComboBox.SelectedItem = null; + } + + _listJewels = jewelLogic.ReadList(null); + if (_listJewels != null) + { + JewelNameComboBox.DisplayMember = "JewelName"; + JewelNameComboBox.ValueMember = "Id"; + JewelNameComboBox.DataSource = _listJewels; + JewelNameComboBox.SelectedItem = null; + } + } + + private void SaveButton_Click(object sender, EventArgs e) + { + if (JewelNameComboBox.SelectedValue == null) + { + MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + _logger.LogInformation("Создание покупки"); + try + { + bool resout = _storeLogic.Sale(new SupplySearchModel + { + JewelId = Convert.ToInt32(JewelNameComboBox.SelectedValue), + Count = Convert.ToInt32(CountTextBox.Text) + }); + if (resout) + { + _logger.LogInformation("Проверка пройдена, продажа проведена"); + MessageBox.Show("Продажа проведена", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + else + { + _logger.LogInformation("Проверка не пройдена"); + MessageBox.Show("Продажа не может быть создана.", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания покупки"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + + private void ButtonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.resx b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStoreReplenishment.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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.Designer.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.Designer.cs new file mode 100644 index 0000000..31a8bdf --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.Designer.cs @@ -0,0 +1,122 @@ +namespace JewelryStore +{ + partial class FormStores + { + /// + /// 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.DataGridView = new System.Windows.Forms.DataGridView(); + this.AddButton = new System.Windows.Forms.Button(); + this.ChangeButton = new System.Windows.Forms.Button(); + this.DeleteButton = new System.Windows.Forms.Button(); + this.UpdateButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); + this.SuspendLayout(); + // + // DataGridView + // + this.DataGridView.BackgroundColor = System.Drawing.SystemColors.Window; + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Location = new System.Drawing.Point(1, 2); + this.DataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowHeadersWidth = 62; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(768, 452); + this.DataGridView.TabIndex = 0; + // + // AddButton + // + this.AddButton.Location = new System.Drawing.Point(807, 52); + this.AddButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.AddButton.Name = "AddButton"; + this.AddButton.Size = new System.Drawing.Size(151, 38); + this.AddButton.TabIndex = 1; + this.AddButton.Text = "Добавить"; + this.AddButton.UseVisualStyleBackColor = true; + this.AddButton.Click += new System.EventHandler(this.AddButton_Click); + // + // ChangeButton + // + this.ChangeButton.Location = new System.Drawing.Point(807, 129); + this.ChangeButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.ChangeButton.Name = "ChangeButton"; + this.ChangeButton.Size = new System.Drawing.Size(151, 38); + this.ChangeButton.TabIndex = 2; + this.ChangeButton.Text = "Изменить"; + this.ChangeButton.UseVisualStyleBackColor = true; + this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click); + // + // DeleteButton + // + this.DeleteButton.Location = new System.Drawing.Point(807, 203); + this.DeleteButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.DeleteButton.Name = "DeleteButton"; + this.DeleteButton.Size = new System.Drawing.Size(151, 38); + this.DeleteButton.TabIndex = 3; + this.DeleteButton.Text = "Удалить"; + this.DeleteButton.UseVisualStyleBackColor = true; + this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); + // + // UpdateButton + // + this.UpdateButton.Location = new System.Drawing.Point(807, 277); + this.UpdateButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.UpdateButton.Name = "UpdateButton"; + this.UpdateButton.Size = new System.Drawing.Size(151, 35); + this.UpdateButton.TabIndex = 4; + this.UpdateButton.Text = "Обновить"; + this.UpdateButton.UseVisualStyleBackColor = true; + this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click); + // + // FormStores + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(988, 457); + this.Controls.Add(this.UpdateButton); + this.Controls.Add(this.DeleteButton); + this.Controls.Add(this.ChangeButton); + this.Controls.Add(this.AddButton); + this.Controls.Add(this.DataGridView); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "FormStores"; + this.Text = "Магазины"; + this.Load += new System.EventHandler(this.FormStores_Load); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DataGridView DataGridView; + private Button AddButton; + private Button ChangeButton; + private Button DeleteButton; + private Button UpdateButton; + } +} \ No newline at end of file diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.cs new file mode 100644 index 0000000..8c84e6e --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.cs @@ -0,0 +1,122 @@ +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.BusinessLogicsContracts; +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 JewelryStore +{ + public partial class FormStores : Form + { + private readonly ILogger _logger; + private readonly IStoreLogic _logic; + public FormStores(ILogger logger, IStoreLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormStores_Load(object sender, EventArgs e) + { + LoadData(); + } + + private void LoadData() + { + try + { + var list = _logic.ReadList(null); + + if (list != null) + { + DataGridView.DataSource = list; + DataGridView.Columns["Id"].Visible = false; + DataGridView.Columns["StoreName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + DataGridView.Columns["Jewels"].Visible = false; + } + + _logger.LogInformation("Загрузка магазинов"); + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки магазинов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void UpdateButton_Click(object sender, EventArgs e) + { + LoadData(); + } + + private void DeleteButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Удаление магазина"); + + try + { + if (!_logic.Delete(new StoreBindingModel + { + Id = id + })) + { + throw new Exception("Ошибка при удалении. Дополнительная информация в логах."); + } + + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления изделия"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + + private void ChangeButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + var service = Program.ServiceProvider?.GetService(typeof(FormStore)); + + if (service is FormStore form) + { + form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + } + + private void AddButton_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormStore)); + + if (service is FormStore form) + { + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + } +} diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.resx b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/FormStores.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/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/Program.cs b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/Program.cs index 859ade0..0e71b88 100644 --- a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/Program.cs +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/Program.cs @@ -1,13 +1,14 @@ using JewelryStoreContracts.BusinessLogicsContracts; using JewelryStoreContracts.StoragesContracts; -using JewelryStoreDatabaseImplement.Implements; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; using JewelryStoreBusinessLogic.BusinessLogics; +using JewelryStoreContracts.StoragesModels; +using JewelryStoreListImplement.Implements; using JewelryStoreBusinessLogic.OfficePackage.Implements; using JewelryStoreBusinessLogic.OfficePackage; -using JewelryStoreContracts.StoragesModels; +using PizzeriaView; namespace JewelryStore { @@ -15,9 +16,7 @@ namespace JewelryStore { private static ServiceProvider? _serviceProvider; public static ServiceProvider? ServiceProvider => _serviceProvider; - /// - /// The main entry point for the application. - /// + [STAThread] static void Main() { @@ -38,26 +37,30 @@ namespace JewelryStore services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } } diff --git a/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/ReportGroupedOrders.rdlc b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/ReportGroupedOrders.rdlc new file mode 100644 index 0000000..2ef2b88 --- /dev/null +++ b/PIbd-23_Panina.A.D_JewelryStore/JewelryStore/ReportGroupedOrders.rdlc @@ -0,0 +1,441 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 20791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + PrecastConcretePlantContractsViewModels + /* Local Query */ + + + + Date + System.DateTime + + + OrdersCount + System.Int32 + + + OrdersSum + System.Decimal + + + + PrecastConcretePlantContracts.ViewModels + ReportGroupOrdersViewModel + PrecastConcretePlantContracts.ViewModels.ReportGroupOrdersViewModel, PrecastConcretePlantContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + + + + + true + true + + + + + Отчёт по заказам + + + + 0.6cm + 16.51cm + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ReportParameterPeriod.Value + + + + + + + ReportParameterPeriod + 0.6cm + 0.6cm + 16.51cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 3.90406cm + + + 3.97461cm + + + 3.65711cm + + + + + 0.6cm + + + + + true + true + + + + + Дата создания + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Количество заказов + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Общая сумма заказов + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Date.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!OrdersCount.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!OrdersSum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetGroupedOrders + 1.88242cm + 2.68676cm + 1.2cm + 11.53578cm + 2 + + + + + + true + true + + + + + Итого: + + + + 3.29409cm + 8.06542cm + 0.6cm + 2.5cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!OrdersSum.Value, "DataSetGroupedOrders") + + + + + + + 3.29409cm + 10.70653cm + 0.6cm + 3.48072cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 2in +