слияние

This commit is contained in:
Ctepa 2024-12-19 09:26:21 +04:00
commit 74ce114390
6 changed files with 22 additions and 18 deletions

View File

@ -9,9 +9,11 @@ public class PrintingHouses
public int MaterialsId { get; set; } public int MaterialsId { get; set; }
public DateTime Date { get; set; }
public IEnumerable<PrintingHouseOrders> printingHouseOrder { get; set; } = []; public IEnumerable<PrintingHouseOrders> printingHouseOrder { get; set; } = [];
public static PrintingHouses CreateEntity(int id, string title, string phone, string address,int materialsId,IEnumerable<PrintingHouseOrders> printingHouseOrders) public static PrintingHouses CreateEntity(int id, string title, string phone, string address, int materialsId, IEnumerable<PrintingHouseOrders> printingHouseOrders)
{ {
return new PrintingHouses return new PrintingHouses
@ -20,7 +22,8 @@ public class PrintingHouses
Title = title, Title = title,
Phone = phone, Phone = phone,
Address = address, Address = address,
MaterialsId=materialsId, MaterialsId = materialsId,
Date = DateTime.Now,
printingHouseOrder = printingHouseOrders printingHouseOrder = printingHouseOrders
}; };
} }

View File

@ -31,7 +31,7 @@
labelDateMaterials = new Label(); labelDateMaterials = new Label();
labelCount = new Label(); labelCount = new Label();
labelTypeMaterials = new Label(); labelTypeMaterials = new Label();
checkedListBox1 = new CheckedListBox(); checkedListBox = new CheckedListBox();
dateTimePickerDateMaterial = new DateTimePicker(); dateTimePickerDateMaterial = new DateTimePicker();
numericUpDownCount = new NumericUpDown(); numericUpDownCount = new NumericUpDown();
buttonSave = new Button(); buttonSave = new Button();
@ -66,13 +66,13 @@
labelTypeMaterials.TabIndex = 2; labelTypeMaterials.TabIndex = 2;
labelTypeMaterials.Text = "Тип материала"; labelTypeMaterials.Text = "Тип материала";
// //
// checkedListBox1 // checkedListBox
// //
checkedListBox1.FormattingEnabled = true; checkedListBox.FormattingEnabled = true;
checkedListBox1.Location = new Point(168, 140); checkedListBox.Location = new Point(168, 140);
checkedListBox1.Name = "checkedListBox1"; checkedListBox.Name = "checkedListBox";
checkedListBox1.Size = new Size(164, 114); checkedListBox.Size = new Size(164, 114);
checkedListBox1.TabIndex = 3; checkedListBox.TabIndex = 3;
// //
// dateTimePickerDateMaterial // dateTimePickerDateMaterial
// //
@ -119,13 +119,14 @@
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(numericUpDownCount); Controls.Add(numericUpDownCount);
Controls.Add(dateTimePickerDateMaterial); Controls.Add(dateTimePickerDateMaterial);
Controls.Add(checkedListBox1); Controls.Add(checkedListBox);
Controls.Add(labelTypeMaterials); Controls.Add(labelTypeMaterials);
Controls.Add(labelCount); Controls.Add(labelCount);
Controls.Add(labelDateMaterials); Controls.Add(labelDateMaterials);
Name = "FormMaterial"; Name = "FormMaterial";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "FormMaterials"; Text = "Материалы";
Load += FormMaterials_Load;
((System.ComponentModel.ISupportInitialize)numericUpDownCount).EndInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownCount).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
@ -136,7 +137,7 @@
private Label labelDateMaterials; private Label labelDateMaterials;
private Label labelCount; private Label labelCount;
private Label labelTypeMaterials; private Label labelTypeMaterials;
private CheckedListBox checkedListBox1; private CheckedListBox checkedListBox;
private DateTimePicker dateTimePickerDateMaterial; private DateTimePicker dateTimePickerDateMaterial;
private NumericUpDown numericUpDownCount; private NumericUpDown numericUpDownCount;
private Button buttonSave; private Button buttonSave;

View File

@ -37,7 +37,7 @@ public partial class FormMaterial : Form
if ((elem & material.Material) != 0) if ((elem & material.Material) != 0)
{ {
checkedListBox1.SetItemChecked(checkedListBox1.Items.IndexOf(elem), true); checkedListBox.SetItemChecked(checkedListBox.Items.IndexOf(elem), true);
} }
} }
MessageBox.Show(material.DateMaterials.ToString()); MessageBox.Show(material.DateMaterials.ToString());
@ -59,7 +59,7 @@ MessageBoxButtons.OK, MessageBoxIcon.Error);
InitializeComponent(); InitializeComponent();
foreach (var item in Enum.GetValues(typeof(TypeMaterials))) foreach (var item in Enum.GetValues(typeof(TypeMaterials)))
{ {
checkedListBox1.Items.Add(item); checkedListBox.Items.Add(item);
} }
} }
@ -97,7 +97,7 @@ MessageBoxButtons.OK, MessageBoxIcon.Error);
private Materials CreateMaterials(int id) private Materials CreateMaterials(int id)
{ {
TypeMaterials typeMaterials = TypeMaterials.None; TypeMaterials typeMaterials = TypeMaterials.None;
foreach (var elem in checkedListBox1.CheckedItems) foreach (var elem in checkedListBox.CheckedItems)
{ {
typeMaterials |= (TypeMaterials)elem; typeMaterials |= (TypeMaterials)elem;
} }

View File

@ -189,7 +189,7 @@
Controls.Add(labelTitle); Controls.Add(labelTitle);
Name = "FormPrintingHouse"; Name = "FormPrintingHouse";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "FormPrintingHousecs"; Text = "Печать";
groupBoxGridView.ResumeLayout(false); groupBoxGridView.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false); ResumeLayout(false);

View File

@ -97,7 +97,7 @@
Controls.Add(panel1); Controls.Add(panel1);
Name = "FormPrintingHouses"; Name = "FormPrintingHouses";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "FormPrintingHouses"; Text = "Печати";
Load += FormPrintingHouses_Load; Load += FormPrintingHouses_Load;
panel1.ResumeLayout(false); panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();

View File

@ -110,7 +110,7 @@
Controls.Add(panel1); Controls.Add(panel1);
Name = "FormPublishingHouses"; Name = "FormPublishingHouses";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "FormPublishingHouses"; Text = "Издательства";
Load += FormPublishingHouses_Load; Load += FormPublishingHouses_Load;
panel1.ResumeLayout(false); panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();