diff --git a/DiningRoom/DiningRoomContracts/ViewModels/DrinkViewModel.cs b/DiningRoom/DiningRoomContracts/ViewModels/DrinkViewModel.cs index d753a01..67872b2 100644 --- a/DiningRoom/DiningRoomContracts/ViewModels/DrinkViewModel.cs +++ b/DiningRoom/DiningRoomContracts/ViewModels/DrinkViewModel.cs @@ -12,7 +12,7 @@ namespace DiningRoomContracts.ViewModels [DisplayName("Алкогольная карта")] public string CardName { get; set; } = string.Empty; - [DisplayName("Название товара")] + [DisplayName("Название напитка")] public string DrinkName { get; set; } = string.Empty; [DisplayName("Стоимость")] diff --git a/DiningRoom/DiningRoomContracts/ViewModels/ProductViewModel.cs b/DiningRoom/DiningRoomContracts/ViewModels/ProductViewModel.cs index a4334e8..76b2242 100644 --- a/DiningRoom/DiningRoomContracts/ViewModels/ProductViewModel.cs +++ b/DiningRoom/DiningRoomContracts/ViewModels/ProductViewModel.cs @@ -9,7 +9,7 @@ namespace DiningRoomContracts.ViewModels public int UserId { get; set; } public string Login { get; set; } = string.Empty; - [DisplayName("Название товара")] + [DisplayName("Название блюда")] public string ProductName { get; set; } = string.Empty; [DisplayName("Стоимость")] diff --git a/DiningRoom/DiningRoomContracts/ViewModels/ReportComponentByDateViewModel.cs b/DiningRoom/DiningRoomContracts/ViewModels/ReportComponentByDateViewModel.cs index f795517..e7573e1 100644 --- a/DiningRoom/DiningRoomContracts/ViewModels/ReportComponentByDateViewModel.cs +++ b/DiningRoom/DiningRoomContracts/ViewModels/ReportComponentByDateViewModel.cs @@ -14,7 +14,7 @@ public double ProductPrice { get; set; } - public int CardId { get; set; } + public int? CardId { get; set; } public string CardName { get; set; } public DateTime DateCardCreate { get; set; } = DateTime.Now; diff --git a/DiningRoom/DiningRoomDatabaseImplement/Implements/ComponentStorage.cs b/DiningRoom/DiningRoomDatabaseImplement/Implements/ComponentStorage.cs index 4d19980..0708f7d 100644 --- a/DiningRoom/DiningRoomDatabaseImplement/Implements/ComponentStorage.cs +++ b/DiningRoom/DiningRoomDatabaseImplement/Implements/ComponentStorage.cs @@ -128,19 +128,23 @@ namespace DiningRoomDatabaseImplement.Implements .ThenInclude(pc => pc.Product) .ToList() .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, - ProductId = pc.ProductId, - ProductName = pc.Product.ProductName, - ProductPrice = pc.Product.Cost, - CardId = card.Id, - CardName = card.CardName, - })))) - .ToList(); + .SelectMany(d => d.Components)) + .SelectMany(dc => dc.Component.ProductComponents + .Select(pc => new ReportComponentByDateViewModel + { + DateCardCreate = dc.Drink.Card.DateCardCreate, + ComponentId = dc.ComponentId, + ComponentName = dc.Component.ComponentName, + ComponentCost = dc.Component.Cost, + ProductId = pc.ProductId, + ProductName = pc.Product.ProductName, + ProductPrice = pc.Product.Cost, + CardId = dc.Drink.CardId, + CardName = dc.Drink.Card.CardName, + })) + .ToList(); } + + } } \ No newline at end of file diff --git a/DiningRoom/DiningRoomView/FormCards.Designer.cs b/DiningRoom/DiningRoomView/FormCards.Designer.cs index 85177d3..dc553c4 100644 --- a/DiningRoom/DiningRoomView/FormCards.Designer.cs +++ b/DiningRoom/DiningRoomView/FormCards.Designer.cs @@ -106,7 +106,7 @@ Controls.Add(ButtonAdd); Controls.Add(dataGridView); Name = "FormCards"; - Text = "Изделия"; + Text = "Алкогольные карты"; Load += FormProducts_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); diff --git a/DiningRoom/DiningRoomView/FormComponent.Designer.cs b/DiningRoom/DiningRoomView/FormComponent.Designer.cs index 2784a3e..739ba14 100644 --- a/DiningRoom/DiningRoomView/FormComponent.Designer.cs +++ b/DiningRoom/DiningRoomView/FormComponent.Designer.cs @@ -122,7 +122,7 @@ Controls.Add(ButtonCancel); Controls.Add(ButtonSave); Name = "FormComponent"; - Text = "Компонент"; + Text = "Продукт"; Load += FormComponent_Load; ResumeLayout(false); PerformLayout(); diff --git a/DiningRoom/DiningRoomView/FormComponentSelection.Designer.cs b/DiningRoom/DiningRoomView/FormComponentSelection.Designer.cs index c5ec2c6..78608bc 100644 --- a/DiningRoom/DiningRoomView/FormComponentSelection.Designer.cs +++ b/DiningRoom/DiningRoomView/FormComponentSelection.Designer.cs @@ -62,7 +62,7 @@ Controls.Add(btnOK); Margin = new Padding(4, 3, 4, 3); Name = "FormComponentSelection"; - Text = "Select Products"; + Text = "Выбрать продукты"; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); } diff --git a/DiningRoom/DiningRoomView/FormComponents.Designer.cs b/DiningRoom/DiningRoomView/FormComponents.Designer.cs index 859ef79..2fef11e 100644 --- a/DiningRoom/DiningRoomView/FormComponents.Designer.cs +++ b/DiningRoom/DiningRoomView/FormComponents.Designer.cs @@ -97,7 +97,7 @@ Controls.Add(ButtonAdd); Controls.Add(dataGridView); Name = "FormComponents"; - Text = "Компоненты"; + Text = "Продукты"; Load += FormComponents_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); diff --git a/DiningRoom/DiningRoomView/FormCreateOrder.Designer.cs b/DiningRoom/DiningRoomView/FormCreateOrder.Designer.cs index 1cfbb41..3fe15ab 100644 --- a/DiningRoom/DiningRoomView/FormCreateOrder.Designer.cs +++ b/DiningRoom/DiningRoomView/FormCreateOrder.Designer.cs @@ -43,9 +43,9 @@ labelProduct.AutoSize = true; labelProduct.Location = new Point(12, 8); labelProduct.Name = "labelProduct"; - labelProduct.Size = new Size(53, 15); + labelProduct.Size = new Size(44, 15); labelProduct.TabIndex = 0; - labelProduct.Text = "Изделие"; + labelProduct.Text = "Блюдо"; // // labelCount // diff --git a/DiningRoom/DiningRoomView/FormDrink.Designer.cs b/DiningRoom/DiningRoomView/FormDrink.Designer.cs index bd30d8d..9a3c388 100644 --- a/DiningRoom/DiningRoomView/FormDrink.Designer.cs +++ b/DiningRoom/DiningRoomView/FormDrink.Designer.cs @@ -34,9 +34,6 @@ textBoxPrice = new TextBox(); groupBox1 = new GroupBox(); dataGridView = new DataGridView(); - ID = new DataGridViewTextBoxColumn(); - ComponentName = new DataGridViewTextBoxColumn(); - Count = new DataGridViewTextBoxColumn(); ButtonSave = new Button(); ButtonCancel = new Button(); ButtonRef = new Button(); @@ -45,6 +42,9 @@ ButtonAdd = new Button(); comboBoxCards = new ComboBox(); label1 = new Label(); + ID = new DataGridViewTextBoxColumn(); + ComponentName = new DataGridViewTextBoxColumn(); + Count = new DataGridViewTextBoxColumn(); groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); @@ -95,7 +95,7 @@ groupBox1.Size = new Size(510, 389); groupBox1.TabIndex = 4; groupBox1.TabStop = false; - groupBox1.Text = "Компонент"; + groupBox1.Text = "Продукты"; // // dataGridView // @@ -108,24 +108,6 @@ dataGridView.Size = new Size(394, 311); dataGridView.TabIndex = 5; // - // ID - // - ID.HeaderText = "Id"; - ID.Name = "ID"; - ID.Visible = false; - ID.Width = 250; - // - // ComponentName - // - ComponentName.HeaderText = "Компоненте"; - ComponentName.Name = "ComponentName"; - ComponentName.Width = 250; - // - // Count - // - Count.HeaderText = "Количество"; - Count.Name = "Count"; - // // ButtonSave // ButtonSave.Location = new Point(354, 352); @@ -204,6 +186,24 @@ label1.TabIndex = 8; label1.Text = "Алкогольная карта:"; // + // ID + // + ID.HeaderText = "Id"; + ID.Name = "ID"; + ID.Visible = false; + ID.Width = 250; + // + // ComponentName + // + ComponentName.HeaderText = "Продукты"; + ComponentName.Name = "ComponentName"; + ComponentName.Width = 250; + // + // Count + // + Count.HeaderText = "Количество"; + Count.Name = "Count"; + // // FormDrink // AutoScaleDimensions = new SizeF(7F, 15F); @@ -217,7 +217,7 @@ Controls.Add(labelPrice); Controls.Add(labelName); Name = "FormDrink"; - Text = "Создание изделия"; + Text = "Создание напитка"; Load += FormDrink_Load; groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); @@ -239,10 +239,10 @@ private System.Windows.Forms.Button ButtonAdd; private System.Windows.Forms.Button ButtonSave; private System.Windows.Forms.Button ButtonCancel; - private System.Windows.Forms.DataGridViewTextBoxColumn ID; - private System.Windows.Forms.DataGridViewTextBoxColumn ComponentName; - private System.Windows.Forms.DataGridViewTextBoxColumn Count; private ComboBox comboBoxCards; private Label label1; + private DataGridViewTextBoxColumn ID; + private DataGridViewTextBoxColumn ComponentName; + private DataGridViewTextBoxColumn Count; } } \ No newline at end of file diff --git a/DiningRoom/DiningRoomView/FormDrinkComponent.Designer.cs b/DiningRoom/DiningRoomView/FormDrinkComponent.Designer.cs index c510395..e147549 100644 --- a/DiningRoom/DiningRoomView/FormDrinkComponent.Designer.cs +++ b/DiningRoom/DiningRoomView/FormDrinkComponent.Designer.cs @@ -41,9 +41,9 @@ labelComponent.AutoSize = true; labelComponent.Location = new Point(12, 9); labelComponent.Name = "labelComponent"; - labelComponent.Size = new Size(72, 15); + labelComponent.Size = new Size(56, 15); labelComponent.TabIndex = 0; - labelComponent.Text = "Компонент:"; + labelComponent.Text = "Продукт:"; // // labelCount // @@ -90,7 +90,7 @@ buttonSave.UseVisualStyleBackColor = true; buttonSave.Click += buttonSave_Click; // - // FormProductComponent + // FormDrinkComponent // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; @@ -101,8 +101,8 @@ Controls.Add(textBoxCount); Controls.Add(labelCount); Controls.Add(labelComponent); - Name = "FormProductComponent"; - Text = "Компонент"; + Name = "FormDrinkComponent"; + Text = "Продукт"; ResumeLayout(false); PerformLayout(); } diff --git a/DiningRoom/DiningRoomView/FormMain.Designer.cs b/DiningRoom/DiningRoomView/FormMain.Designer.cs index b29d720..4fe370f 100644 --- a/DiningRoom/DiningRoomView/FormMain.Designer.cs +++ b/DiningRoom/DiningRoomView/FormMain.Designer.cs @@ -245,7 +245,7 @@ Controls.Add(menuStrip1); MainMenuStrip = menuStrip1; Name = "FormMain"; - Text = "FormMain"; + Text = "Столовая \"Рога и Копыта\""; Load += FormMain_Load; ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit(); diff --git a/DiningRoom/DiningRoomView/FormMain.cs b/DiningRoom/DiningRoomView/FormMain.cs index c83e3a0..6b3e341 100644 --- a/DiningRoom/DiningRoomView/FormMain.cs +++ b/DiningRoom/DiningRoomView/FormMain.cs @@ -326,24 +326,5 @@ namespace DiningRoomView { LoadData(); } - - //private void ButtonCreateSale_Click(object sender, EventArgs e) - //{ - // var service = Program.ServiceProvider?.GetService(typeof(FormCreateSale)); - // if (service is FormCreateSale form) - // { - // form.ShowDialog(); - // LoadData(); - // } - //} - //private void ButtonCreateSupply_Click(object sender, EventArgs e) - //{ - // var service = Program.ServiceProvider?.GetService(typeof(FormCreateSupply)); - // if (service is FormCreateSupply form) - // { - // form.ShowDialog(); - // LoadData(); - // } - //} } } diff --git a/DiningRoom/DiningRoomView/FormOrders.Designer.cs b/DiningRoom/DiningRoomView/FormOrders.Designer.cs index 6e4a946..7c298b8 100644 --- a/DiningRoom/DiningRoomView/FormOrders.Designer.cs +++ b/DiningRoom/DiningRoomView/FormOrders.Designer.cs @@ -34,6 +34,7 @@ ButtonDel = new Button(); ButtonRef = new Button(); textBoxName = new TextBox(); + labelLogin = new Label(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); // @@ -63,7 +64,7 @@ ButtonUpd.Name = "ButtonUpd"; ButtonUpd.Size = new Size(225, 23); ButtonUpd.TabIndex = 2; - ButtonUpd.Text = "Изменить"; + ButtonUpd.Text = "Связать с блюдом"; ButtonUpd.UseVisualStyleBackColor = true; ButtonUpd.Click += ButtonCreateOrder_Click; // @@ -94,19 +95,29 @@ textBoxName.Size = new Size(225, 23); textBoxName.TabIndex = 5; // - // FormCards + // labelLogin + // + labelLogin.AutoSize = true; + labelLogin.Location = new Point(448, 12); + labelLogin.Name = "labelLogin"; + labelLogin.Size = new Size(99, 15); + labelLogin.TabIndex = 21; + labelLogin.Text = "Название заказа:"; + // + // FormOrders // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(668, 450); + Controls.Add(labelLogin); Controls.Add(textBoxName); Controls.Add(ButtonRef); Controls.Add(ButtonDel); Controls.Add(ButtonUpd); Controls.Add(ButtonAdd); Controls.Add(dataGridView); - Name = "FormCards"; - Text = "Изделия"; + Name = "FormOrders"; + Text = "Заказы"; Load += FormProducts_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); @@ -121,5 +132,6 @@ private System.Windows.Forms.Button ButtonDel; private System.Windows.Forms.Button ButtonRef; private TextBox textBoxName; + private Label labelLogin; } } \ No newline at end of file diff --git a/DiningRoom/DiningRoomView/FormProduct.Designer.cs b/DiningRoom/DiningRoomView/FormProduct.Designer.cs index fe8cac2..b472f64 100644 --- a/DiningRoom/DiningRoomView/FormProduct.Designer.cs +++ b/DiningRoom/DiningRoomView/FormProduct.Designer.cs @@ -34,15 +34,15 @@ textBoxPrice = new TextBox(); groupBox1 = new GroupBox(); dataGridView = new DataGridView(); - ID = new DataGridViewTextBoxColumn(); - ComponentName = new DataGridViewTextBoxColumn(); - Count = new DataGridViewTextBoxColumn(); ButtonRef = new Button(); ButtonDel = new Button(); ButtonUpd = new Button(); ButtonAdd = new Button(); ButtonSave = new Button(); ButtonCancel = new Button(); + ID = new DataGridViewTextBoxColumn(); + ComponentName = new DataGridViewTextBoxColumn(); + Count = new DataGridViewTextBoxColumn(); groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); @@ -91,7 +91,7 @@ groupBox1.Size = new Size(510, 338); groupBox1.TabIndex = 4; groupBox1.TabStop = false; - groupBox1.Text = "Компонент"; + groupBox1.Text = "Продукты"; // // dataGridView // @@ -104,24 +104,6 @@ dataGridView.Size = new Size(394, 311); dataGridView.TabIndex = 5; // - // ID - // - ID.HeaderText = "Id"; - ID.Name = "ID"; - ID.Visible = false; - ID.Width = 250; - // - // ComponentName - // - ComponentName.HeaderText = "Компоненте"; - ComponentName.Name = "ComponentName"; - ComponentName.Width = 250; - // - // Count - // - Count.HeaderText = "Количество"; - Count.Name = "Count"; - // // ButtonRef // ButtonRef.Location = new Point(400, 169); @@ -182,6 +164,24 @@ ButtonCancel.UseVisualStyleBackColor = true; ButtonCancel.Click += ButtonCancel_Click; // + // ID + // + ID.HeaderText = "Id"; + ID.Name = "ID"; + ID.Visible = false; + ID.Width = 250; + // + // ComponentName + // + ComponentName.HeaderText = "Продукты"; + ComponentName.Name = "ComponentName"; + ComponentName.Width = 250; + // + // Count + // + Count.HeaderText = "Количество"; + Count.Name = "Count"; + // // FormProduct // AutoScaleDimensions = new SizeF(7F, 15F); @@ -195,7 +195,7 @@ Controls.Add(labelPrice); Controls.Add(labelName); Name = "FormProduct"; - Text = "Создание изделия"; + Text = "Создание блюда"; Load += FormProduct_Load; groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); @@ -217,8 +217,8 @@ private System.Windows.Forms.Button ButtonAdd; private System.Windows.Forms.Button ButtonSave; private System.Windows.Forms.Button ButtonCancel; - private System.Windows.Forms.DataGridViewTextBoxColumn ID; - private System.Windows.Forms.DataGridViewTextBoxColumn ComponentName; - private System.Windows.Forms.DataGridViewTextBoxColumn Count; + private DataGridViewTextBoxColumn ID; + private DataGridViewTextBoxColumn ComponentName; + private DataGridViewTextBoxColumn Count; } } \ No newline at end of file diff --git a/DiningRoom/DiningRoomView/FormProductComponent.Designer.cs b/DiningRoom/DiningRoomView/FormProductComponent.Designer.cs index 630c91a..841e861 100644 --- a/DiningRoom/DiningRoomView/FormProductComponent.Designer.cs +++ b/DiningRoom/DiningRoomView/FormProductComponent.Designer.cs @@ -41,9 +41,9 @@ labelComponent.AutoSize = true; labelComponent.Location = new Point(12, 9); labelComponent.Name = "labelComponent"; - labelComponent.Size = new Size(72, 15); + labelComponent.Size = new Size(56, 15); labelComponent.TabIndex = 0; - labelComponent.Text = "Компонент:"; + labelComponent.Text = "Продукт:"; labelComponent.Click += labelComponent_Click; // // labelCount @@ -103,7 +103,7 @@ Controls.Add(labelCount); Controls.Add(labelComponent); Name = "FormProductComponent"; - Text = "Компонент"; + Text = "Продукт"; ResumeLayout(false); PerformLayout(); } diff --git a/DiningRoom/DiningRoomView/FormRegister.Designer.cs b/DiningRoom/DiningRoomView/FormRegister.Designer.cs index a24306b..600cbed 100644 --- a/DiningRoom/DiningRoomView/FormRegister.Designer.cs +++ b/DiningRoom/DiningRoomView/FormRegister.Designer.cs @@ -76,6 +76,7 @@ // textBoxPassword.Location = new Point(94, 75); textBoxPassword.Name = "textBoxPassword"; + textBoxPassword.PasswordChar = '*'; textBoxPassword.Size = new Size(235, 23); textBoxPassword.TabIndex = 11; // diff --git a/DiningRoom/DiningRoomView/FormReportComponentsByDate.Designer.cs b/DiningRoom/DiningRoomView/FormReportComponentsByDate.Designer.cs index 74ef81a..f9e5e1d 100644 --- a/DiningRoom/DiningRoomView/FormReportComponentsByDate.Designer.cs +++ b/DiningRoom/DiningRoomView/FormReportComponentsByDate.Designer.cs @@ -58,12 +58,12 @@ // buttonToPdf // buttonToPdf.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonToPdf.Location = new Point(878, 8); + buttonToPdf.Location = new Point(790, 8); buttonToPdf.Margin = new Padding(4, 3, 4, 3); buttonToPdf.Name = "buttonToPdf"; - buttonToPdf.Size = new Size(139, 27); + buttonToPdf.Size = new Size(227, 27); buttonToPdf.TabIndex = 5; - buttonToPdf.Text = "В Pdf"; + buttonToPdf.Text = "Отправить отчет на почту"; buttonToPdf.UseVisualStyleBackColor = true; buttonToPdf.Click += buttonGenerateAndSendPdf_Click; // @@ -134,7 +134,7 @@ Margin = new Padding(4, 3, 4, 3); Name = "FormReportComponentsByDate"; StartPosition = FormStartPosition.CenterScreen; - Text = "Заказы"; + Text = "Созданные продукты за период"; panel.ResumeLayout(false); panel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); diff --git a/DiningRoom/DiningRoomView/FormReportComponentsByDate.cs b/DiningRoom/DiningRoomView/FormReportComponentsByDate.cs index c769853..318f61d 100644 --- a/DiningRoom/DiningRoomView/FormReportComponentsByDate.cs +++ b/DiningRoom/DiningRoomView/FormReportComponentsByDate.cs @@ -2,22 +2,8 @@ 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; @@ -58,21 +44,35 @@ namespace DiningRoomView foreach (var group in groupedData) { - // Добавляем строку с именем компонента и его стоимостью + // Добавляем строку с именем продукта и его стоимостью displayData.Add(new GroupedComponentViewModel { ComponentName = group.Key, ComponentCost = group.First().ComponentCost }); - // Добавляем строки с названием карты и блюда + // Добавляем только уникальные названия блюд и карт + var uniqueProducts = new HashSet(); + var uniqueCards = new HashSet(); + foreach (var item in group) { - displayData.Add(new GroupedComponentViewModel + // Проверяем, есть ли название блюда и оно уникально + if (!string.IsNullOrEmpty(item.ProductName) && uniqueProducts.Add(item.ProductName)) { - CardName = item.CardName, - ProductName = item.ProductName - }); + displayData.Add(new GroupedComponentViewModel + { + ProductName = item.ProductName + }); + } + // Проверяем, есть ли название карты и оно уникально + if (!string.IsNullOrEmpty(item.CardName) && uniqueCards.Add(item.CardName)) + { + displayData.Add(new GroupedComponentViewModel + { + CardName = item.CardName + }); + } } } @@ -83,8 +83,8 @@ namespace DiningRoomView dataGridView.DataSource = displayData; // Форматирование столбцов - dataGridView.Columns["ComponentName"].HeaderText = "Название компонента"; - dataGridView.Columns["ComponentCost"].HeaderText = "Стоимость компонента"; + dataGridView.Columns["ComponentName"].HeaderText = "Название продукта"; + dataGridView.Columns["ComponentCost"].HeaderText = "Стоимость продукта"; dataGridView.Columns["CardName"].HeaderText = "Название карты"; dataGridView.Columns["ProductName"].HeaderText = "Название блюда"; @@ -107,6 +107,8 @@ namespace DiningRoomView + + private void ButtonToPdf_Click(object sender, EventArgs e) { System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); diff --git a/DiningRoom/DiningRoomView/FormReportProductComponents.Designer.cs b/DiningRoom/DiningRoomView/FormReportProductComponents.Designer.cs index 6f9ee9b..aa768d1 100644 --- a/DiningRoom/DiningRoomView/FormReportProductComponents.Designer.cs +++ b/DiningRoom/DiningRoomView/FormReportProductComponents.Designer.cs @@ -29,10 +29,10 @@ private void InitializeComponent() { dataGridView = new DataGridView(); - buttonSaveToExcel = new Button(); ColumnComponent = new DataGridViewTextBoxColumn(); ColumnProduct = new DataGridViewTextBoxColumn(); ColumnCount = new DataGridViewTextBoxColumn(); + buttonSaveToExcel = new Button(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); // @@ -56,17 +56,6 @@ dataGridView.Size = new Size(616, 510); dataGridView.TabIndex = 0; // - // buttonSaveToExcel - // - buttonSaveToExcel.Location = new Point(14, 14); - buttonSaveToExcel.Margin = new Padding(4, 3, 4, 3); - buttonSaveToExcel.Name = "buttonSaveToExcel"; - buttonSaveToExcel.Size = new Size(186, 27); - buttonSaveToExcel.TabIndex = 1; - buttonSaveToExcel.Text = "Сохранить в Excel"; - buttonSaveToExcel.UseVisualStyleBackColor = true; - buttonSaveToExcel.Click += ButtonSaveToExcel_Click; - // // ColumnComponent // ColumnComponent.HeaderText = "Продукт"; @@ -87,6 +76,17 @@ ColumnCount.Name = "ColumnCount"; ColumnCount.ReadOnly = true; // + // buttonSaveToExcel + // + buttonSaveToExcel.Location = new Point(14, 14); + buttonSaveToExcel.Margin = new Padding(4, 3, 4, 3); + buttonSaveToExcel.Name = "buttonSaveToExcel"; + buttonSaveToExcel.Size = new Size(186, 27); + buttonSaveToExcel.TabIndex = 1; + buttonSaveToExcel.Text = "Сохранить в Excel"; + buttonSaveToExcel.UseVisualStyleBackColor = true; + buttonSaveToExcel.Click += ButtonSaveToExcel_Click; + // // FormReportProductComponents // AutoScaleDimensions = new SizeF(7F, 15F); @@ -96,7 +96,7 @@ Controls.Add(dataGridView); Margin = new Padding(4, 3, 4, 3); Name = "FormReportProductComponents"; - Text = "Компоненты по изделиям"; + Text = "Заказы по продуктам"; Load += FormReportProductComponents_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); diff --git a/DiningRoom/DiningRoomView/ReportComponents.rdlc b/DiningRoom/DiningRoomView/ReportComponents.rdlc deleted file mode 100644 index 359f516..0000000 --- a/DiningRoom/DiningRoomView/ReportComponents.rdlc +++ /dev/null @@ -1,577 +0,0 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - 10791c83-cee8-4a38-bbd0-245fc17cefb3 - - - - - - DiningRoomContractsViewModels - /* Local Query */ - - - - Id - System.Int32 - - - DateCreate - System.DateTime - - - WoodName - System.String - - - Sum - System.Double - - - Status - System.String - - - - DiningRoomContracts.ViewModels - ReportOrdersViewModel - DiningRoomContracts.ViewModels.ReportOrdersViewModel, DiningRoomContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - - - - - - - true - true - - - - - Заказы - - - - Textbox2 - 0.6cm - 16.51cm - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.5cm - - - 2.5cm - - - 2.5cm - - - 2.5cm - - - 2.5cm - - - - - 0.6cm - - - - - true - true - - - - - ComponentId - - - 2pt - 2pt - 2pt - 2pt - - - true - - - - - - true - true - - - - - Date Create - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Wood Name - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Sum - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Status - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - =Fields!ComponentId.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!DateCreate.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!WoodName.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Sum.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Status.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSetOrders - 1.95474cm - 0.76412cm - 1.2cm - 12.5cm - 1 - - - - - - true - true - - - - - Итого: - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Sum(Fields!Sum.Value, "DataSetOrders") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ReportParameterPeriod.Value - - - - ReportParameterPeriod - 0.94932cm - 0.6cm - 16.51cm - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - 2in -