From 6b8329bbe9143b257f74171d5279ba4fab7745ed Mon Sep 17 00:00:00 2001 From: Ctepa Date: Thu, 19 Dec 2024 09:07:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B0=D1=83=D1=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Publication/Entites/PrintingHouses.cs | 6 +++++- Publication/Forms/FormMaterial.Designer.cs | 20 +++++++++---------- Publication/Forms/FormMaterial.cs | 8 ++++---- .../Forms/FormPrintingHouse.Designer.cs | 2 +- Publication/Forms/FormPrintingHouse.cs | 1 + .../Forms/FormPrintingHouses.Designer.cs | 2 +- .../Forms/FormPublishingHouses.Designer.cs | 2 +- 7 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Publication/Entites/PrintingHouses.cs b/Publication/Entites/PrintingHouses.cs index d71f890..81bf026 100644 --- a/Publication/Entites/PrintingHouses.cs +++ b/Publication/Entites/PrintingHouses.cs @@ -9,9 +9,11 @@ public class PrintingHouses public int MaterialsId { get; set; } + public DateTime Date { get; set; } + public IEnumerable printingHouseOrder { get; set; } = []; - public static PrintingHouses CreateEntity(int id, string title, string phone, string address,IEnumerable printingHouseOrders) + public static PrintingHouses CreateEntity(int id, string title, string phone, string address, int materialsId, IEnumerable printingHouseOrders) { return new PrintingHouses @@ -20,6 +22,8 @@ public class PrintingHouses Title = title, Phone = phone, Address = address, + MaterialsId = materialsId, + Date = DateTime.Now, printingHouseOrder = printingHouseOrders }; } diff --git a/Publication/Forms/FormMaterial.Designer.cs b/Publication/Forms/FormMaterial.Designer.cs index d5462f0..1ccdcc8 100644 --- a/Publication/Forms/FormMaterial.Designer.cs +++ b/Publication/Forms/FormMaterial.Designer.cs @@ -31,7 +31,7 @@ labelDateMaterials = new Label(); labelCount = new Label(); labelTypeMaterials = new Label(); - checkedListBox1 = new CheckedListBox(); + checkedListBox = new CheckedListBox(); dateTimePickerDateMaterial = new DateTimePicker(); numericUpDownCount = new NumericUpDown(); buttonSave = new Button(); @@ -66,13 +66,13 @@ labelTypeMaterials.TabIndex = 2; labelTypeMaterials.Text = "Тип материала"; // - // checkedListBox1 + // checkedListBox // - checkedListBox1.FormattingEnabled = true; - checkedListBox1.Location = new Point(168, 140); - checkedListBox1.Name = "checkedListBox1"; - checkedListBox1.Size = new Size(164, 114); - checkedListBox1.TabIndex = 3; + checkedListBox.FormattingEnabled = true; + checkedListBox.Location = new Point(168, 140); + checkedListBox.Name = "checkedListBox"; + checkedListBox.Size = new Size(164, 114); + checkedListBox.TabIndex = 3; // // dateTimePickerDateMaterial // @@ -119,13 +119,13 @@ Controls.Add(buttonSave); Controls.Add(numericUpDownCount); Controls.Add(dateTimePickerDateMaterial); - Controls.Add(checkedListBox1); + Controls.Add(checkedListBox); Controls.Add(labelTypeMaterials); Controls.Add(labelCount); Controls.Add(labelDateMaterials); Name = "FormMaterial"; StartPosition = FormStartPosition.CenterScreen; - Text = "FormMaterials"; + Text = "Материалы"; Load += FormMaterials_Load; ((System.ComponentModel.ISupportInitialize)numericUpDownCount).EndInit(); ResumeLayout(false); @@ -137,7 +137,7 @@ private Label labelDateMaterials; private Label labelCount; private Label labelTypeMaterials; - private CheckedListBox checkedListBox1; + private CheckedListBox checkedListBox; private DateTimePicker dateTimePickerDateMaterial; private NumericUpDown numericUpDownCount; private Button buttonSave; diff --git a/Publication/Forms/FormMaterial.cs b/Publication/Forms/FormMaterial.cs index 69c98a8..fb6784a 100644 --- a/Publication/Forms/FormMaterial.cs +++ b/Publication/Forms/FormMaterial.cs @@ -37,7 +37,7 @@ public partial class FormMaterial : Form if ((elem & material.Material) != 0) { - checkedListBox1.SetItemChecked(checkedListBox1.Items.IndexOf(elem), true); + checkedListBox.SetItemChecked(checkedListBox.Items.IndexOf(elem), true); } } material.DateMaterials = dateTimePickerDateMaterial.Value.Date; @@ -58,7 +58,7 @@ public partial class FormMaterial : Form InitializeComponent(); foreach (var item in Enum.GetValues(typeof(TypeMaterials))) { - checkedListBox1.Items.Add(item); + checkedListBox.Items.Add(item); } } @@ -71,7 +71,7 @@ public partial class FormMaterial : Form { try { - if (int.Parse(numericUpDownCount.Value.ToString()) <= 0 || dateTimePickerDateMaterial.Value.Date < DateTime.Now || checkedListBox1.SelectedItems.Count == 0) + if (int.Parse(numericUpDownCount.Value.ToString()) <= 0 || dateTimePickerDateMaterial.Value.Date < DateTime.Now || checkedListBox.SelectedItems.Count == 0) { throw new Exception("Имеются незаполненные поля"); } @@ -99,7 +99,7 @@ public partial class FormMaterial : Form private Materials CreateMaterials(int id) { TypeMaterials typeMaterials = TypeMaterials.None; - foreach (var elem in checkedListBox1.CheckedItems) + foreach (var elem in checkedListBox.CheckedItems) { typeMaterials |= (TypeMaterials)elem; } diff --git a/Publication/Forms/FormPrintingHouse.Designer.cs b/Publication/Forms/FormPrintingHouse.Designer.cs index a3d22a9..ded5e1f 100644 --- a/Publication/Forms/FormPrintingHouse.Designer.cs +++ b/Publication/Forms/FormPrintingHouse.Designer.cs @@ -188,7 +188,7 @@ Controls.Add(labelTitle); Name = "FormPrintingHouse"; StartPosition = FormStartPosition.CenterScreen; - Text = "FormPrintingHousecs"; + Text = "Печать"; groupBoxGridView.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ResumeLayout(false); diff --git a/Publication/Forms/FormPrintingHouse.cs b/Publication/Forms/FormPrintingHouse.cs index 50063a1..24a90b1 100644 --- a/Publication/Forms/FormPrintingHouse.cs +++ b/Publication/Forms/FormPrintingHouse.cs @@ -49,6 +49,7 @@ public partial class FormPrintingHouse : Form textBoxTitle.Text, textBoxPhone.Text, textBoxAddress.Text, + (int)comboBoxMaterials.SelectedValue!, CreateListPrintingHouseOrdersFromDataGrid() ) ); diff --git a/Publication/Forms/FormPrintingHouses.Designer.cs b/Publication/Forms/FormPrintingHouses.Designer.cs index 2563676..889fd93 100644 --- a/Publication/Forms/FormPrintingHouses.Designer.cs +++ b/Publication/Forms/FormPrintingHouses.Designer.cs @@ -97,7 +97,7 @@ Controls.Add(panel1); Name = "FormPrintingHouses"; StartPosition = FormStartPosition.CenterScreen; - Text = "FormPrintingHouses"; + Text = "Печати"; Load += FormPrintingHouses_Load; panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); diff --git a/Publication/Forms/FormPublishingHouses.Designer.cs b/Publication/Forms/FormPublishingHouses.Designer.cs index 460a3ff..ad4594a 100644 --- a/Publication/Forms/FormPublishingHouses.Designer.cs +++ b/Publication/Forms/FormPublishingHouses.Designer.cs @@ -110,7 +110,7 @@ Controls.Add(panel1); Name = "FormPublishingHouses"; StartPosition = FormStartPosition.CenterScreen; - Text = "FormPublishingHouses"; + Text = "Издательства"; Load += FormPublishingHouses_Load; panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();