Labs complited?

This commit is contained in:
Lazypr0ger 2024-12-04 15:04:24 +03:00
parent b4487e7ae0
commit c3fde5d3da
26 changed files with 190 additions and 11666 deletions

View File

@ -7,11 +7,11 @@ public class Product
public int Id { get; private set; } public int Id { get; private set; }
public string Name { get; private set; } public string Name { get; private set; }
public int Price { get; private set; } public int Price { get; private set; }
public int ProductionId { get; private set; } public string ProductionId { get; private set; }
public NameOfProductTypes ProductionType { get; private set; } public NameOfProductTypes ProductionTypeID { get; private set; }
public static Product CreateProducts(int id, string name, int price, int productionId, NameOfProductTypes productionType) public static Product CreateProducts(int id, string name, int price, string productionId, NameOfProductTypes productionType)
{ {
return new Product { Id = id, Name = name, Price = price, ProductionId = productionId, ProductionType = productionType }; return new Product { Id = id, Name = name, Price = price, ProductionId = productionId, ProductionTypeID = productionType };
} }
} }

View File

@ -6,11 +6,11 @@ public class Worker
{ {
public int Id { get; private set; } public int Id { get; private set; }
public string Name { get; private set; } = string.Empty; public string Name { get; private set; } = string.Empty;
public int Experience { get; private set; } public DateTime Experience { get; private set; }
public int Class { get; private set; } public int Class { get; private set; }
public int PlanWork { get; private set; } public int PlanWork { get; private set; }
public static Worker CreateWorker(int id, string name, int experience, int classOfWorker, int planWorkID) public static Worker CreateWorker(int id, string name, DateTime experience, int classOfWorker, int planWorkID)
{ {
return new Worker return new Worker
{ {

View File

@ -41,6 +41,7 @@
// //
// checkedListBoxMaterials // checkedListBoxMaterials
// //
checkedListBoxMaterials.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
checkedListBoxMaterials.FormattingEnabled = true; checkedListBoxMaterials.FormattingEnabled = true;
checkedListBoxMaterials.Location = new Point(12, 42); checkedListBoxMaterials.Location = new Point(12, 42);
checkedListBoxMaterials.Name = "checkedListBoxMaterials"; checkedListBoxMaterials.Name = "checkedListBoxMaterials";
@ -49,6 +50,7 @@
// //
// label1 // label1
// //
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new Point(12, 9); label1.Location = new Point(12, 9);
label1.Name = "label1"; label1.Name = "label1";
@ -58,6 +60,7 @@
// //
// label2 // label2
// //
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(12, 213); label2.Location = new Point(12, 213);
label2.Name = "label2"; label2.Name = "label2";
@ -67,6 +70,7 @@
// //
// numericUpDownCountMaterials // numericUpDownCountMaterials
// //
numericUpDownCountMaterials.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
numericUpDownCountMaterials.Location = new Point(136, 211); numericUpDownCountMaterials.Location = new Point(136, 211);
numericUpDownCountMaterials.Maximum = new decimal(new int[] { 300000, 0, 0, 0 }); numericUpDownCountMaterials.Maximum = new decimal(new int[] { 300000, 0, 0, 0 });
numericUpDownCountMaterials.Name = "numericUpDownCountMaterials"; numericUpDownCountMaterials.Name = "numericUpDownCountMaterials";
@ -75,6 +79,7 @@
// //
// dateTimePickerDateArrival // dateTimePickerDateArrival
// //
dateTimePickerDateArrival.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dateTimePickerDateArrival.Location = new Point(12, 271); dateTimePickerDateArrival.Location = new Point(12, 271);
dateTimePickerDateArrival.Name = "dateTimePickerDateArrival"; dateTimePickerDateArrival.Name = "dateTimePickerDateArrival";
dateTimePickerDateArrival.Size = new Size(300, 27); dateTimePickerDateArrival.Size = new Size(300, 27);
@ -91,6 +96,7 @@
// //
// buttonSave // buttonSave
// //
buttonSave.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonSave.Location = new Point(15, 309); buttonSave.Location = new Point(15, 309);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(146, 29); buttonSave.Size = new Size(146, 29);
@ -101,6 +107,7 @@
// //
// buttonCensel // buttonCensel
// //
buttonCensel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonCensel.Location = new Point(166, 309); buttonCensel.Location = new Point(166, 309);
buttonCensel.Name = "buttonCensel"; buttonCensel.Name = "buttonCensel";
buttonCensel.Size = new Size(146, 29); buttonCensel.Size = new Size(146, 29);

View File

@ -50,6 +50,7 @@ namespace ProductionInCehOTP.Forms
} }
numericUpDownCountMaterials.Value = arrival.Count; numericUpDownCountMaterials.Value = arrival.Count;
dateTimePickerDateArrival.Value = arrival.Date; dateTimePickerDateArrival.Value = arrival.Date;
_arrivalId = value;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -40,6 +40,7 @@
// dataGridViewData // dataGridViewData
// //
dataGridViewData.AllowUserToOrderColumns = true; dataGridViewData.AllowUserToOrderColumns = true;
dataGridViewData.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewData.Location = new Point(0, 0); dataGridViewData.Location = new Point(0, 0);
dataGridViewData.Name = "dataGridViewData"; dataGridViewData.Name = "dataGridViewData";
@ -51,6 +52,7 @@
// //
// ButtonAdd // ButtonAdd
// //
ButtonAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
ButtonAdd.Location = new Point(30, 30); ButtonAdd.Location = new Point(30, 30);
ButtonAdd.Name = "ButtonAdd"; ButtonAdd.Name = "ButtonAdd";
ButtonAdd.Size = new Size(94, 74); ButtonAdd.Size = new Size(94, 74);
@ -72,6 +74,7 @@
// //
// ButtonDel // ButtonDel
// //
ButtonDel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
ButtonDel.Location = new Point(30, 237); ButtonDel.Location = new Point(30, 237);
ButtonDel.Name = "ButtonDel"; ButtonDel.Name = "ButtonDel";
ButtonDel.Size = new Size(94, 74); ButtonDel.Size = new Size(94, 74);
@ -82,6 +85,7 @@
// //
// buttonUpdate // buttonUpdate
// //
buttonUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonUpdate.Location = new Point(30, 136); buttonUpdate.Location = new Point(30, 136);
buttonUpdate.Name = "buttonUpdate"; buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(94, 74); buttonUpdate.Size = new Size(94, 74);
@ -98,6 +102,7 @@
Controls.Add(dataGridViewData); Controls.Add(dataGridViewData);
Controls.Add(panel1); Controls.Add(panel1);
Name = "FormArrivalsOfMaterials"; Name = "FormArrivalsOfMaterials";
StartPosition = FormStartPosition.CenterScreen;
Text = "Поставки материалов"; Text = "Поставки материалов";
Load += FormArrivalsOfMaterials_Load; Load += FormArrivalsOfMaterials_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();

View File

@ -44,6 +44,7 @@
// //
// buttonSave // buttonSave
// //
buttonSave.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonSave.Location = new Point(118, 418); buttonSave.Location = new Point(118, 418);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(166, 57); buttonSave.Size = new Size(166, 57);
@ -54,6 +55,7 @@
// //
// buttonCencel // buttonCencel
// //
buttonCencel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonCencel.Location = new Point(290, 417); buttonCencel.Location = new Point(290, 417);
buttonCencel.Name = "buttonCencel"; buttonCencel.Name = "buttonCencel";
buttonCencel.Size = new Size(156, 58); buttonCencel.Size = new Size(156, 58);
@ -82,6 +84,7 @@
// //
// comboBoxNameOfMaterial // comboBoxNameOfMaterial
// //
comboBoxNameOfMaterial.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
comboBoxNameOfMaterial.FormattingEnabled = true; comboBoxNameOfMaterial.FormattingEnabled = true;
comboBoxNameOfMaterial.Location = new Point(220, 18); comboBoxNameOfMaterial.Location = new Point(220, 18);
comboBoxNameOfMaterial.Name = "comboBoxNameOfMaterial"; comboBoxNameOfMaterial.Name = "comboBoxNameOfMaterial";
@ -90,6 +93,7 @@
// //
// dataGridViewMaterialToProduct // dataGridViewMaterialToProduct
// //
dataGridViewMaterialToProduct.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dataGridViewMaterialToProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewMaterialToProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewMaterialToProduct.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnCountMaterial }); dataGridViewMaterialToProduct.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnCountMaterial });
dataGridViewMaterialToProduct.Location = new Point(6, 26); dataGridViewMaterialToProduct.Location = new Point(6, 26);
@ -126,6 +130,7 @@
// //
// comboBoxNomberArrials // comboBoxNomberArrials
// //
comboBoxNomberArrials.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
comboBoxNomberArrials.FormattingEnabled = true; comboBoxNomberArrials.FormattingEnabled = true;
comboBoxNomberArrials.Location = new Point(219, 61); comboBoxNomberArrials.Location = new Point(219, 61);
comboBoxNomberArrials.Name = "comboBoxNomberArrials"; comboBoxNomberArrials.Name = "comboBoxNomberArrials";
@ -145,6 +150,7 @@
Controls.Add(buttonCencel); Controls.Add(buttonCencel);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Name = "FormMaterial"; Name = "FormMaterial";
StartPosition = FormStartPosition.CenterScreen;
Text = "Материал"; Text = "Материал";
((System.ComponentModel.ISupportInitialize)dataGridViewMaterialToProduct).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridViewMaterialToProduct).EndInit();
groupBoxMaterialToProduct.ResumeLayout(false); groupBoxMaterialToProduct.ResumeLayout(false);

View File

@ -75,6 +75,7 @@
Controls.Add(dataGridViewData); Controls.Add(dataGridViewData);
Controls.Add(panel1); Controls.Add(panel1);
Name = "FormMaterials"; Name = "FormMaterials";
StartPosition = FormStartPosition.CenterScreen;
Text = "Материалы"; Text = "Материалы";
Load += FormMaterials_Load; Load += FormMaterials_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();

View File

@ -48,6 +48,7 @@
// //
// buttonCencel // buttonCencel
// //
buttonCencel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonCencel.Location = new Point(465, 409); buttonCencel.Location = new Point(465, 409);
buttonCencel.Name = "buttonCencel"; buttonCencel.Name = "buttonCencel";
buttonCencel.Size = new Size(148, 45); buttonCencel.Size = new Size(148, 45);
@ -58,6 +59,7 @@
// //
// buttonSave // buttonSave
// //
buttonSave.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonSave.Location = new Point(465, 469); buttonSave.Location = new Point(465, 469);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(148, 45); buttonSave.Size = new Size(148, 45);
@ -68,6 +70,7 @@
// //
// numericUpDownPlanWork // numericUpDownPlanWork
// //
numericUpDownPlanWork.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
numericUpDownPlanWork.Location = new Point(269, 61); numericUpDownPlanWork.Location = new Point(269, 61);
numericUpDownPlanWork.Name = "numericUpDownPlanWork"; numericUpDownPlanWork.Name = "numericUpDownPlanWork";
numericUpDownPlanWork.Size = new Size(344, 27); numericUpDownPlanWork.Size = new Size(344, 27);
@ -84,6 +87,7 @@
// //
// dateTimePickerPlanDate // dateTimePickerPlanDate
// //
dateTimePickerPlanDate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dateTimePickerPlanDate.Location = new Point(269, 107); dateTimePickerPlanDate.Location = new Point(269, 107);
dateTimePickerPlanDate.Name = "dateTimePickerPlanDate"; dateTimePickerPlanDate.Name = "dateTimePickerPlanDate";
dateTimePickerPlanDate.Size = new Size(344, 27); dateTimePickerPlanDate.Size = new Size(344, 27);
@ -117,6 +121,7 @@
// //
// comboBoxName // comboBoxName
// //
comboBoxName.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
comboBoxName.FormattingEnabled = true; comboBoxName.FormattingEnabled = true;
comboBoxName.Location = new Point(269, 12); comboBoxName.Location = new Point(269, 12);
comboBoxName.Name = "comboBoxName"; comboBoxName.Name = "comboBoxName";
@ -136,9 +141,9 @@
// //
// dataGridViewDatePlanWork // dataGridViewDatePlanWork
// //
dataGridViewDatePlanWork.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dataGridViewDatePlanWork.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewDatePlanWork.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewDatePlanWork.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnCreatedproduct }); dataGridViewDatePlanWork.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnCreatedproduct });
dataGridViewDatePlanWork.Dock = DockStyle.Fill;
dataGridViewDatePlanWork.Location = new Point(3, 23); dataGridViewDatePlanWork.Location = new Point(3, 23);
dataGridViewDatePlanWork.Name = "dataGridViewDatePlanWork"; dataGridViewDatePlanWork.Name = "dataGridViewDatePlanWork";
dataGridViewDatePlanWork.RowHeadersWidth = 51; dataGridViewDatePlanWork.RowHeadersWidth = 51;

View File

@ -123,10 +123,4 @@
<metadata name="ColumnCreatedproduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="ColumnCreatedproduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="ColumnProduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnCreatedproduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View File

@ -88,6 +88,7 @@
Controls.Add(panel1); Controls.Add(panel1);
Controls.Add(dataGridViewData); Controls.Add(dataGridViewData);
Name = "FormPlansWork"; Name = "FormPlansWork";
StartPosition = FormStartPosition.CenterScreen;
Text = "Список установленных планов"; Text = "Список установленных планов";
Load += FormPlansWork_Load; Load += FormPlansWork_Load;
panel1.ResumeLayout(false); panel1.ResumeLayout(false);

View File

@ -45,7 +45,7 @@
// //
Price.AutoSize = true; Price.AutoSize = true;
Price.Font = new Font("Segoe UI", 9F); Price.Font = new Font("Segoe UI", 9F);
Price.Location = new Point(12, 137); Price.Location = new Point(12, 144);
Price.Name = "Price"; Price.Name = "Price";
Price.Size = new Size(48, 20); Price.Size = new Size(48, 20);
Price.TabIndex = 2; Price.TabIndex = 2;
@ -53,6 +53,7 @@
// //
// textBoxNameOfProduct // textBoxNameOfProduct
// //
textBoxNameOfProduct.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
textBoxNameOfProduct.Location = new Point(373, 13); textBoxNameOfProduct.Location = new Point(373, 13);
textBoxNameOfProduct.Name = "textBoxNameOfProduct"; textBoxNameOfProduct.Name = "textBoxNameOfProduct";
textBoxNameOfProduct.Size = new Size(191, 27); textBoxNameOfProduct.Size = new Size(191, 27);
@ -60,10 +61,11 @@
// //
// buttonSave // buttonSave
// //
buttonSave.Font = new Font("Segoe UI", 13.8F, FontStyle.Regular, GraphicsUnit.Point, 204); buttonSave.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonSave.Location = new Point(12, 184); buttonSave.Font = new Font("Segoe UI", 10.8F);
buttonSave.Location = new Point(301, 191);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(240, 70); buttonSave.Size = new Size(137, 36);
buttonSave.TabIndex = 10; buttonSave.TabIndex = 10;
buttonSave.Text = "Сохранить"; buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true; buttonSave.UseVisualStyleBackColor = true;
@ -71,10 +73,11 @@
// //
// buttonCensel // buttonCensel
// //
buttonCensel.Font = new Font("Segoe UI", 13.8F, FontStyle.Regular, GraphicsUnit.Point, 204); buttonCensel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonCensel.Location = new Point(327, 184); buttonCensel.Font = new Font("Segoe UI", 10.8F);
buttonCensel.Location = new Point(444, 191);
buttonCensel.Name = "buttonCensel"; buttonCensel.Name = "buttonCensel";
buttonCensel.Size = new Size(239, 70); buttonCensel.Size = new Size(136, 36);
buttonCensel.TabIndex = 11; buttonCensel.TabIndex = 11;
buttonCensel.Text = "Отмена"; buttonCensel.Text = "Отмена";
buttonCensel.UseVisualStyleBackColor = true; buttonCensel.UseVisualStyleBackColor = true;
@ -82,7 +85,8 @@
// //
// numericUpDownPrice // numericUpDownPrice
// //
numericUpDownPrice.Location = new Point(375, 141); numericUpDownPrice.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
numericUpDownPrice.Location = new Point(373, 137);
numericUpDownPrice.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 }); numericUpDownPrice.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 });
numericUpDownPrice.Name = "numericUpDownPrice"; numericUpDownPrice.Name = "numericUpDownPrice";
numericUpDownPrice.Size = new Size(191, 27); numericUpDownPrice.Size = new Size(191, 27);
@ -92,7 +96,7 @@
// //
labelProductName.AutoSize = true; labelProductName.AutoSize = true;
labelProductName.Font = new Font("Segoe UI", 9F); labelProductName.Font = new Font("Segoe UI", 9F);
labelProductName.Location = new Point(12, 9); labelProductName.Location = new Point(12, 20);
labelProductName.Name = "labelProductName"; labelProductName.Name = "labelProductName";
labelProductName.Size = new Size(183, 20); labelProductName.Size = new Size(183, 20);
labelProductName.TabIndex = 16; labelProductName.TabIndex = 16;
@ -100,6 +104,7 @@
// //
// comboBoxProductType // comboBoxProductType
// //
comboBoxProductType.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
comboBoxProductType.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxProductType.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxProductType.FormattingEnabled = true; comboBoxProductType.FormattingEnabled = true;
comboBoxProductType.Location = new Point(373, 94); comboBoxProductType.Location = new Point(373, 94);
@ -111,7 +116,7 @@
// //
labelProductType.AutoSize = true; labelProductType.AutoSize = true;
labelProductType.Font = new Font("Segoe UI", 9F); labelProductType.Font = new Font("Segoe UI", 9F);
labelProductType.Location = new Point(12, 94); labelProductType.Location = new Point(12, 102);
labelProductType.Name = "labelProductType"; labelProductType.Name = "labelProductType";
labelProductType.Size = new Size(96, 20); labelProductType.Size = new Size(96, 20);
labelProductType.TabIndex = 20; labelProductType.TabIndex = 20;
@ -121,7 +126,7 @@
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Font = new Font("Segoe UI", 9F); label1.Font = new Font("Segoe UI", 9F);
label1.Location = new Point(12, 54); label1.Location = new Point(12, 57);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(315, 20); label1.Size = new Size(315, 20);
label1.TabIndex = 21; label1.TabIndex = 21;
@ -129,6 +134,7 @@
// //
// textBoxOficialID // textBoxOficialID
// //
textBoxOficialID.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
textBoxOficialID.Location = new Point(373, 50); textBoxOficialID.Location = new Point(373, 50);
textBoxOficialID.Name = "textBoxOficialID"; textBoxOficialID.Name = "textBoxOficialID";
textBoxOficialID.Size = new Size(191, 27); textBoxOficialID.Size = new Size(191, 27);
@ -138,7 +144,7 @@
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(589, 266); ClientSize = new Size(589, 239);
Controls.Add(textBoxOficialID); Controls.Add(textBoxOficialID);
Controls.Add(label1); Controls.Add(label1);
Controls.Add(labelProductType); Controls.Add(labelProductType);
@ -150,6 +156,7 @@
Controls.Add(textBoxNameOfProduct); Controls.Add(textBoxNameOfProduct);
Controls.Add(Price); Controls.Add(Price);
Name = "FormProduct"; Name = "FormProduct";
StartPosition = FormStartPosition.CenterScreen;
Text = "Продукт"; Text = "Продукт";
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).EndInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownPrice).EndInit();
ResumeLayout(false); ResumeLayout(false);

View File

@ -34,7 +34,8 @@ namespace ProductionInCehOTP.Forms
} }
textBoxNameOfProduct.Text = product.Name; textBoxNameOfProduct.Text = product.Name;
numericUpDownPrice.Value = product.Price; numericUpDownPrice.Value = product.Price;
comboBoxProductType.SelectedItem = product.ProductionType; comboBoxProductType.SelectedItem = product.ProductionTypeID;
textBoxOficialID.Text = product.ProductionId;
_productID = value; _productID = value;
} }
@ -58,7 +59,7 @@ namespace ProductionInCehOTP.Forms
{ {
try try
{ {
if (string.IsNullOrWhiteSpace(textBoxNameOfProduct.Text) || numericUpDownPrice.Value == null) if (string.IsNullOrWhiteSpace(textBoxNameOfProduct.Text))
{ {
throw new Exception("Имеются незаполненные поля"); throw new Exception("Имеются незаполненные поля");
@ -81,7 +82,7 @@ namespace ProductionInCehOTP.Forms
} }
} }
private Product CreateProducts(int id) => Product.CreateProducts(id, textBoxNameOfProduct.Text,Convert.ToInt32(numericUpDownPrice.Value), int.Parse(textBoxOficialID.Text), (NameOfProductTypes)comboBoxProductType.SelectedItem!); private Product CreateProducts(int id) => Product.CreateProducts(id, textBoxNameOfProduct.Text,Convert.ToInt32(numericUpDownPrice.Value), textBoxOficialID.Text,(NameOfProductTypes)comboBoxProductType.SelectedItem!);
private void ButtonCensel_Click(object sender, EventArgs e) => Close(); private void ButtonCensel_Click(object sender, EventArgs e) => Close();

View File

@ -111,7 +111,7 @@
Controls.Add(dataGridViewData); Controls.Add(dataGridViewData);
Controls.Add(panel1); Controls.Add(panel1);
Name = "FormProducts"; Name = "FormProducts";
StartPosition = FormStartPosition.CenterParent; StartPosition = FormStartPosition.CenterScreen;
Text = "Список продукции"; Text = "Список продукции";
Load += FormProduct_Load; Load += FormProduct_Load;
panel1.ResumeLayout(false); panel1.ResumeLayout(false);

View File

@ -28,7 +28,6 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProductionInIndustrial));
menuStrip1 = new MenuStrip(); menuStrip1 = new MenuStrip();
ListsToolStripMenuItem = new ToolStripMenuItem(); ListsToolStripMenuItem = new ToolStripMenuItem();
WorkerToolStripMenuItem = new ToolStripMenuItem(); WorkerToolStripMenuItem = new ToolStripMenuItem();
@ -43,67 +42,79 @@
// //
// menuStrip1 // menuStrip1
// //
menuStrip1.BackColor = Color.Turquoise;
menuStrip1.ImageScalingSize = new Size(20, 20); menuStrip1.ImageScalingSize = new Size(20, 20);
menuStrip1.Items.AddRange(new ToolStripItem[] { ListsToolStripMenuItem, OperationsToolStripMenuItem, отчетыToolStripMenuItem }); menuStrip1.Items.AddRange(new ToolStripItem[] { ListsToolStripMenuItem, OperationsToolStripMenuItem, отчетыToolStripMenuItem });
menuStrip1.Location = new Point(0, 0); menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1"; menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(882, 28); menuStrip1.Size = new Size(1082, 33);
menuStrip1.TabIndex = 0; menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1"; menuStrip1.Text = "menuStrip1";
// //
// ListsToolStripMenuItem // ListsToolStripMenuItem
// //
ListsToolStripMenuItem.BackColor = Color.Turquoise;
ListsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { WorkerToolStripMenuItem, ProductToolStripMenuItem, ArrivalToCaseToolStripMenuItem }); ListsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { WorkerToolStripMenuItem, ProductToolStripMenuItem, ArrivalToCaseToolStripMenuItem });
ListsToolStripMenuItem.Font = new Font("Segoe UI", 10.8F);
ListsToolStripMenuItem.Name = "ListsToolStripMenuItem"; ListsToolStripMenuItem.Name = "ListsToolStripMenuItem";
ListsToolStripMenuItem.Size = new Size(117, 24); ListsToolStripMenuItem.Size = new Size(137, 29);
ListsToolStripMenuItem.Text = "Справочники"; ListsToolStripMenuItem.Text = "Справочники";
// //
// WorkerToolStripMenuItem // WorkerToolStripMenuItem
// //
WorkerToolStripMenuItem.BackColor = Color.Turquoise;
WorkerToolStripMenuItem.Name = "WorkerToolStripMenuItem"; WorkerToolStripMenuItem.Name = "WorkerToolStripMenuItem";
WorkerToolStripMenuItem.Size = new Size(231, 26); WorkerToolStripMenuItem.Size = new Size(262, 30);
WorkerToolStripMenuItem.Text = "Работники"; WorkerToolStripMenuItem.Text = "Работники";
WorkerToolStripMenuItem.Click += WorkerToolStripMenuItem_Click; WorkerToolStripMenuItem.Click += WorkerToolStripMenuItem_Click;
// //
// ProductToolStripMenuItem // ProductToolStripMenuItem
// //
ProductToolStripMenuItem.BackColor = Color.Turquoise;
ProductToolStripMenuItem.Name = "ProductToolStripMenuItem"; ProductToolStripMenuItem.Name = "ProductToolStripMenuItem";
ProductToolStripMenuItem.Size = new Size(231, 26); ProductToolStripMenuItem.Size = new Size(262, 30);
ProductToolStripMenuItem.Text = "Продукция"; ProductToolStripMenuItem.Text = "Продукция";
ProductToolStripMenuItem.Click += ProductToolStripMenuItem_Click; ProductToolStripMenuItem.Click += ProductToolStripMenuItem_Click;
// //
// ArrivalToCaseToolStripMenuItem // ArrivalToCaseToolStripMenuItem
// //
ArrivalToCaseToolStripMenuItem.BackColor = Color.Turquoise;
ArrivalToCaseToolStripMenuItem.Name = "ArrivalToCaseToolStripMenuItem"; ArrivalToCaseToolStripMenuItem.Name = "ArrivalToCaseToolStripMenuItem";
ArrivalToCaseToolStripMenuItem.Size = new Size(231, 26); ArrivalToCaseToolStripMenuItem.Size = new Size(262, 30);
ArrivalToCaseToolStripMenuItem.Text = "Поставки на склады"; ArrivalToCaseToolStripMenuItem.Text = "Поставки на склады";
ArrivalToCaseToolStripMenuItem.Click += ArrivalToCaseToolStripMenuItem_Click; ArrivalToCaseToolStripMenuItem.Click += ArrivalToCaseToolStripMenuItem_Click;
// //
// OperationsToolStripMenuItem // OperationsToolStripMenuItem
// //
OperationsToolStripMenuItem.BackColor = Color.Turquoise;
OperationsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ArrivalMaterialsToProductToolStripMenuItem, PlanWorkToolStripMenuItem }); OperationsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ArrivalMaterialsToProductToolStripMenuItem, PlanWorkToolStripMenuItem });
OperationsToolStripMenuItem.Font = new Font("Segoe UI", 10.8F);
OperationsToolStripMenuItem.Name = "OperationsToolStripMenuItem"; OperationsToolStripMenuItem.Name = "OperationsToolStripMenuItem";
OperationsToolStripMenuItem.Size = new Size(95, 24); OperationsToolStripMenuItem.Size = new Size(110, 29);
OperationsToolStripMenuItem.Text = "Операции"; OperationsToolStripMenuItem.Text = "Операции";
// //
// ArrivalMaterialsToProductToolStripMenuItem // ArrivalMaterialsToProductToolStripMenuItem
// //
ArrivalMaterialsToProductToolStripMenuItem.BackColor = Color.Turquoise;
ArrivalMaterialsToProductToolStripMenuItem.Name = "ArrivalMaterialsToProductToolStripMenuItem"; ArrivalMaterialsToProductToolStripMenuItem.Name = "ArrivalMaterialsToProductToolStripMenuItem";
ArrivalMaterialsToProductToolStripMenuItem.Size = new Size(368, 26); ArrivalMaterialsToProductToolStripMenuItem.Size = new Size(424, 30);
ArrivalMaterialsToProductToolStripMenuItem.Text = "Поставки материалов на производство"; ArrivalMaterialsToProductToolStripMenuItem.Text = "Поставки материалов на производство";
ArrivalMaterialsToProductToolStripMenuItem.Click += ArrivalMaterialsToProductToolStripMenuItem_Click; ArrivalMaterialsToProductToolStripMenuItem.Click += ArrivalMaterialsToProductToolStripMenuItem_Click;
// //
// PlanWorkToolStripMenuItem // PlanWorkToolStripMenuItem
// //
PlanWorkToolStripMenuItem.BackColor = Color.Turquoise;
PlanWorkToolStripMenuItem.Name = "PlanWorkToolStripMenuItem"; PlanWorkToolStripMenuItem.Name = "PlanWorkToolStripMenuItem";
PlanWorkToolStripMenuItem.Size = new Size(368, 26); PlanWorkToolStripMenuItem.Size = new Size(424, 30);
PlanWorkToolStripMenuItem.Text = "Контроль производства"; PlanWorkToolStripMenuItem.Text = "Контроль производства";
PlanWorkToolStripMenuItem.Click += PlanWorkToolStripMenuItem_Click; PlanWorkToolStripMenuItem.Click += PlanWorkToolStripMenuItem_Click;
// //
// отчетыToolStripMenuItem // отчетыToolStripMenuItem
// //
отчетыToolStripMenuItem.BackColor = Color.Turquoise;
отчетыToolStripMenuItem.Font = new Font("Segoe UI", 10.8F);
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
отчетыToolStripMenuItem.Size = new Size(73, 24); отчетыToolStripMenuItem.Size = new Size(86, 29);
отчетыToolStripMenuItem.Text = "Отчеты"; отчетыToolStripMenuItem.Text = "Отчеты";
// //
// ProductionInIndustrial // ProductionInIndustrial
@ -111,8 +122,9 @@
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
AutoSize = true; AutoSize = true;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage"); BackColor = Color.Turquoise;
ClientSize = new Size(882, 553); BackgroundImage = Properties.Resources.background;
ClientSize = new Size(1082, 523);
Controls.Add(menuStrip1); Controls.Add(menuStrip1);
MainMenuStrip = menuStrip1; MainMenuStrip = menuStrip1;
Name = "ProductionInIndustrial"; Name = "ProductionInIndustrial";

File diff suppressed because it is too large Load Diff

View File

@ -28,86 +28,49 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
label1 = new Label();
label2 = new Label(); label2 = new Label();
label3 = new Label(); textBoxName = new TextBox();
textBoxFirstName = new TextBox();
textBoxSecondName = new TextBox();
textBoxLastName = new TextBox();
label5 = new Label(); label5 = new Label();
label6 = new Label(); label6 = new Label();
numericUpDownClassOfWorker = new NumericUpDown(); numericUpDownClassOfWorker = new NumericUpDown();
groupBox = new GroupBox();
monthCalendarExp = new MonthCalendar();
numericUpDownPlan = new NumericUpDown(); numericUpDownPlan = new NumericUpDown();
buttonSave = new Button(); buttonSave = new Button();
buttonCensel = new Button(); buttonCensel = new Button();
dateTimePickerExp = new DateTimePicker();
label4 = new Label();
((System.ComponentModel.ISupportInitialize)numericUpDownClassOfWorker).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownClassOfWorker).BeginInit();
groupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)numericUpDownPlan).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownPlan).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// label1
//
label1.AutoSize = true;
label1.Location = new Point(12, 60);
label1.Name = "label1";
label1.Size = new Size(39, 20);
label1.TabIndex = 0;
label1.Text = "Имя";
//
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(12, 19); label2.Location = new Point(12, 19);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(73, 20); label2.Size = new Size(45, 20);
label2.TabIndex = 1; label2.TabIndex = 1;
label2.Text = амилия"; label2.Text = "ФИО:";
// //
// label3 // textBoxName
// //
label3.AutoSize = true; textBoxName.Location = new Point(93, 12);
label3.Location = new Point(12, 105); textBoxName.Name = "textBoxName";
label3.Name = "label3"; textBoxName.Size = new Size(336, 27);
label3.Size = new Size(72, 20); textBoxName.TabIndex = 4;
label3.TabIndex = 2;
label3.Text = "Отчетсво";
//
// textBoxFirstName
//
textBoxFirstName.Location = new Point(93, 53);
textBoxFirstName.Name = "textBoxFirstName";
textBoxFirstName.Size = new Size(336, 27);
textBoxFirstName.TabIndex = 3;
//
// textBoxSecondName
//
textBoxSecondName.Location = new Point(93, 12);
textBoxSecondName.Name = "textBoxSecondName";
textBoxSecondName.Size = new Size(336, 27);
textBoxSecondName.TabIndex = 4;
//
// textBoxLastName
//
textBoxLastName.Location = new Point(93, 98);
textBoxLastName.Name = "textBoxLastName";
textBoxLastName.Size = new Size(336, 27);
textBoxLastName.TabIndex = 5;
// //
// label5 // label5
// //
label5.AutoSize = true; label5.AutoSize = true;
label5.Location = new Point(12, 153); label5.Location = new Point(12, 59);
label5.Name = "label5"; label5.Name = "label5";
label5.Size = new Size(57, 20); label5.Size = new Size(60, 20);
label5.TabIndex = 7; label5.TabIndex = 7;
label5.Text = "Разряд"; label5.Text = "Разряд:";
// //
// label6 // label6
// //
label6.AutoSize = true; label6.AutoSize = true;
label6.Location = new Point(12, 196); label6.Location = new Point(12, 102);
label6.Name = "label6"; label6.Name = "label6";
label6.Size = new Size(203, 20); label6.Size = new Size(203, 20);
label6.TabIndex = 8; label6.TabIndex = 8;
@ -115,41 +78,24 @@
// //
// numericUpDownClassOfWorker // numericUpDownClassOfWorker
// //
numericUpDownClassOfWorker.Location = new Point(288, 146); numericUpDownClassOfWorker.Location = new Point(288, 52);
numericUpDownClassOfWorker.Maximum = new decimal(new int[] { 8, 0, 0, 0 }); numericUpDownClassOfWorker.Maximum = new decimal(new int[] { 8, 0, 0, 0 });
numericUpDownClassOfWorker.Name = "numericUpDownClassOfWorker"; numericUpDownClassOfWorker.Name = "numericUpDownClassOfWorker";
numericUpDownClassOfWorker.Size = new Size(141, 27); numericUpDownClassOfWorker.Size = new Size(141, 27);
numericUpDownClassOfWorker.TabIndex = 10; numericUpDownClassOfWorker.TabIndex = 10;
// //
// groupBox
//
groupBox.Controls.Add(monthCalendarExp);
groupBox.Location = new Point(12, 229);
groupBox.Name = "groupBox";
groupBox.Size = new Size(417, 246);
groupBox.TabIndex = 11;
groupBox.TabStop = false;
groupBox.Text = "Дата трудоустройства";
//
// monthCalendarExp
//
monthCalendarExp.CalendarDimensions = new Size(2, 1);
monthCalendarExp.Location = new Point(12, 27);
monthCalendarExp.Name = "monthCalendarExp";
monthCalendarExp.TabIndex = 0;
//
// numericUpDownPlan // numericUpDownPlan
// //
numericUpDownPlan.Location = new Point(288, 189); numericUpDownPlan.Location = new Point(288, 95);
numericUpDownPlan.Name = "numericUpDownPlan"; numericUpDownPlan.Name = "numericUpDownPlan";
numericUpDownPlan.Size = new Size(141, 27); numericUpDownPlan.Size = new Size(141, 27);
numericUpDownPlan.TabIndex = 12; numericUpDownPlan.TabIndex = 12;
// //
// buttonSave // buttonSave
// //
buttonSave.Location = new Point(3, 481); buttonSave.Location = new Point(12, 212);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(218, 59); buttonSave.Size = new Size(209, 59);
buttonSave.TabIndex = 13; buttonSave.TabIndex = 13;
buttonSave.Text = "Сохранить"; buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true; buttonSave.UseVisualStyleBackColor = true;
@ -157,7 +103,7 @@
// //
// buttonCensel // buttonCensel
// //
buttonCensel.Location = new Point(227, 481); buttonCensel.Location = new Point(227, 212);
buttonCensel.Name = "buttonCensel"; buttonCensel.Name = "buttonCensel";
buttonCensel.Size = new Size(202, 59); buttonCensel.Size = new Size(202, 59);
buttonCensel.TabIndex = 14; buttonCensel.TabIndex = 14;
@ -165,28 +111,41 @@
buttonCensel.UseVisualStyleBackColor = true; buttonCensel.UseVisualStyleBackColor = true;
buttonCensel.Click += ButtonCensel_Click; buttonCensel.Click += ButtonCensel_Click;
// //
// dateTimePickerExp
//
dateTimePickerExp.Location = new Point(227, 142);
dateTimePickerExp.Name = "dateTimePickerExp";
dateTimePickerExp.Size = new Size(202, 27);
dateTimePickerExp.TabIndex = 15;
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(12, 147);
label4.Name = "label4";
label4.Size = new Size(163, 20);
label4.TabIndex = 16;
label4.Text = "Дата трудоустройства:";
//
// FormWorker // FormWorker
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(441, 545); ClientSize = new Size(441, 280);
Controls.Add(label4);
Controls.Add(dateTimePickerExp);
Controls.Add(buttonCensel); Controls.Add(buttonCensel);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(numericUpDownPlan); Controls.Add(numericUpDownPlan);
Controls.Add(label6); Controls.Add(label6);
Controls.Add(groupBox);
Controls.Add(numericUpDownClassOfWorker); Controls.Add(numericUpDownClassOfWorker);
Controls.Add(label5); Controls.Add(label5);
Controls.Add(textBoxLastName); Controls.Add(textBoxName);
Controls.Add(textBoxSecondName);
Controls.Add(textBoxFirstName);
Controls.Add(label3);
Controls.Add(label2); Controls.Add(label2);
Controls.Add(label1);
Name = "FormWorker"; Name = "FormWorker";
StartPosition = FormStartPosition.CenterScreen;
Text = "Рабочий"; Text = "Рабочий";
((System.ComponentModel.ISupportInitialize)numericUpDownClassOfWorker).EndInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownClassOfWorker).EndInit();
groupBox.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)numericUpDownPlan).EndInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownPlan).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
@ -198,15 +157,15 @@
private Label label2; private Label label2;
private Label label3; private Label label3;
private TextBox textBoxFirstName; private TextBox textBoxFirstName;
private TextBox textBoxSecondName; private TextBox textBoxName;
private TextBox textBoxLastName; private TextBox textBoxLastName;
private Label label5; private Label label5;
private Label label6; private Label label6;
private NumericUpDown numericUpDownClassOfWorker; private NumericUpDown numericUpDownClassOfWorker;
private GroupBox groupBox;
private MonthCalendar monthCalendarExp;
private NumericUpDown numericUpDownPlan; private NumericUpDown numericUpDownPlan;
private Button buttonSave; private Button buttonSave;
private Button buttonCensel; private Button buttonCensel;
private DateTimePicker dateTimePickerExp;
private Label label4;
} }
} }

View File

@ -35,13 +35,8 @@ namespace ProductionInCehOTP.Forms
{ {
throw new InvalidDataException(nameof(worker)); throw new InvalidDataException(nameof(worker));
} }
string firstname = textBoxFirstName.Text; textBoxName.Text = worker.Name;
string lastname = textBoxLastName.Text; dateTimePickerExp.Value = worker.Experience;
string Secondname = textBoxSecondName.Text;
string name = String.Concat(firstname, " ", Secondname, " ", lastname);
name = worker.Name;
int ExperienceYear = DateTime.Now.Year - monthCalendarExp.SelectionStart.Year;
ExperienceYear = worker.Experience;
numericUpDownClassOfWorker.Value = worker.Class; numericUpDownClassOfWorker.Value = worker.Class;
numericUpDownPlan.Value = worker.PlanWork; numericUpDownPlan.Value = worker.PlanWork;
@ -58,7 +53,7 @@ namespace ProductionInCehOTP.Forms
{ {
try try
{ {
if(string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxSecondName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text)) if(string.IsNullOrWhiteSpace(textBoxName.Text))
{ {
throw new Exception("Имеются незаполненные поля"); throw new Exception("Имеются незаполненные поля");
} }
@ -82,6 +77,6 @@ namespace ProductionInCehOTP.Forms
private void ButtonCensel_Click(object sender, EventArgs e) => Close(); private void ButtonCensel_Click(object sender, EventArgs e) => Close();
private Worker CreateWorker(int workerID) => private Worker CreateWorker(int workerID) =>
Worker.CreateWorker(workerID, String.Concat(textBoxSecondName.Text, " ", textBoxFirstName.Text," ", textBoxLastName.Text), DateTime.Now.Year - monthCalendarExp.SelectionStart.Year, Convert.ToInt32(numericUpDownClassOfWorker.Value), Convert.ToInt32(numericUpDownPlan.Value)); Worker.CreateWorker(workerID, textBoxName.Text,dateTimePickerExp.Value, Convert.ToInt32(numericUpDownClassOfWorker.Value), Convert.ToInt32(numericUpDownPlan.Value));
} }
} }

View File

@ -99,6 +99,7 @@
Controls.Add(dataGridViewData); Controls.Add(dataGridViewData);
Controls.Add(panel1); Controls.Add(panel1);
Name = "FormWorkers"; Name = "FormWorkers";
StartPosition = FormStartPosition.CenterScreen;
Text = "Рабочие"; Text = "Рабочие";
Load += FormWorkers_Load; Load += FormWorkers_Load;
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();

View File

@ -60,6 +60,16 @@ namespace ProductionInCehOTP.Properties {
} }
} }
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap background {
get {
object obj = ResourceManager.GetObject("background", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap. /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary> /// </summary>
@ -69,5 +79,15 @@ namespace ProductionInCehOTP.Properties {
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap OTP {
get {
object obj = ResourceManager.GetObject("OTP", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View File

@ -121,4 +121,10 @@
<data name="BackGroundOTP" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="BackGroundOTP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\BackGroundOTP.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\BackGroundOTP.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="OTP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OTP.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="background" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\background.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@ -48,12 +48,17 @@ VALUES (@DATE, @NAME, @COUNT)";
_logger.LogDebug("Объект: {id}", id); _logger.LogDebug("Объект: {id}", id);
try try
{ {
using var connection = new using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
NpgsqlConnection(_connectionString.ConnectionString); connection.Open();
var queryDelete = @" using var transaction = connection.BeginTransaction();
DELETE FROM ARRIVAL_MATERIALS
WHERE Id=@id"; var deleteChildQuery = "DELETE FROM MATERIAL WHERE arrivalmaterialid = @id";
connection.Execute(queryDelete, new { id }); connection.Execute(deleteChildQuery, new { id }, transaction);
var deleteParentQuery = "DELETE FROM ARRIVAL_MATERIALS WHERE id = @id";
connection.Execute(deleteParentQuery, new { id }, transaction);
transaction.Commit();
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -62,6 +67,7 @@ WHERE Id=@id";
} }
} }
public IEnumerable<ArrivalMaterials> GetArrivalMaterials() public IEnumerable<ArrivalMaterials> GetArrivalMaterials()
{ {
_logger.LogInformation("Получение всех объектов"); _logger.LogInformation("Получение всех объектов");
@ -122,7 +128,6 @@ WHERE Id=@id";
var queryUpdate = @" var queryUpdate = @"
UPDATE ARRIVAL_MATERIALS UPDATE ARRIVAL_MATERIALS
SET SET
ID=@ID,
DATE=@DATE, DATE=@DATE,
NAME=@NAME, NAME=@NAME,
COUNT=@COUNT COUNT=@COUNT

View File

@ -28,7 +28,7 @@ public class PlanWorkRepository : IPlanWorkRepository
connection.Open(); connection.Open();
using var transaction = connection.BeginTransaction(); using var transaction = connection.BeginTransaction();
var queryInsert = @" var queryInsert = @"
INSERT INTO PLANWORK (Plan, Date,WorkerID) INSERT INTO PLANWORK (Plan,Date,WorkerID)
VALUES (@Plan, @Date, @WorkerID); VALUES (@Plan, @Date, @WorkerID);
SELECT MAX(Id) FROM PLANWORK"; SELECT MAX(Id) FROM PLANWORK";
var PlanWorkID = var PlanWorkID =
@ -65,7 +65,7 @@ VALUES (@PLANWORKID,@PRODUCTID, @COUNT)";
NpgsqlConnection(_connectionString.ConnectionString); NpgsqlConnection(_connectionString.ConnectionString);
var queryDelete = @" var queryDelete = @"
DELETE FROM PlanWork DELETE FROM PlanWork
WHERE Id=@id"; WHERE Id=@planId";
connection.Execute(queryDelete, new { planId }); connection.Execute(queryDelete, new { planId });
} }
catch (Exception ex) catch (Exception ex)

View File

@ -27,7 +27,7 @@ public class ProductRepository : IProductRepository
connecntion.Open(); connecntion.Open();
var queryInsert = @" var queryInsert = @"
INSERT INTO PRODUCT (NAME,PRICE,PRODUCTIONID, PRODUCTIONTYPEID) INSERT INTO PRODUCT (NAME,PRICE,PRODUCTIONID, PRODUCTIONTYPEID)
VALUES (@NAME, @PRICE, @PRODUCTIONID, @PRODUCTIONTYPE)"; VALUES (@NAME, @PRICE, @PRODUCTIONID, @PRODUCTIONTYPEID)";
connecntion.Execute(queryInsert, product); connecntion.Execute(queryInsert, product);
} }
catch (Exception ex) catch (Exception ex)
@ -119,7 +119,7 @@ SET
NAME=@Name, NAME=@Name,
PRICE=@Price, PRICE=@Price,
PRODUCTIONID=@ProductionId, PRODUCTIONID=@ProductionId,
PRODUCTIONTYPEDID=@ProductionType PRODUCTIONTYPEID=@ProductionTypeID
WHERE Id=@Id"; WHERE Id=@Id";
connection.Execute(queryUpdate, product); connection.Execute(queryUpdate, product);
} }

View File

@ -43,12 +43,16 @@ VALUES (@NAME, @EXPERIENCE, @CLASS, @PLANWORK)";
_logger.LogDebug("Объект: {id}", Id); _logger.LogDebug("Объект: {id}", Id);
try try
{ {
using var connection = new using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
NpgsqlConnection(_connectionString.ConnectionString); connection.Open();
var queryDelete = @"
DELETE FROM WORKER
WHERE ID=@Id"; var queryDeletePlanwork = "DELETE FROM planwork WHERE workerid = @Id";
connection.Execute(queryDelete, new { Id }); connection.Execute(queryDeletePlanwork, new { Id });
var queryDeleteWorker = "DELETE FROM worker WHERE id = @Id";
connection.Execute(queryDeleteWorker, new { Id });
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -57,6 +61,7 @@ WHERE ID=@Id";
} }
} }
public Worker GetWorkerById(int Id) public Worker GetWorkerById(int Id)
{ {
_logger.LogInformation("Получение объекта по идентификатору"); _logger.LogInformation("Получение объекта по идентификатору");
@ -68,7 +73,10 @@ WHERE ID=@Id";
var querySelect = @" var querySelect = @"
SELECT * FROM WORKER SELECT * FROM WORKER
WHERE ID=@Id"; WHERE ID=@Id";
var worker = connection.QueryFirstOrDefault<Worker>(querySelect, new { id = Id }); var worker = connection.QueryFirstOrDefault<Worker>(querySelect, new
{
Id
});
_logger.LogDebug("Найденный объект: {json}", _logger.LogDebug("Найденный объект: {json}",
JsonConvert.SerializeObject(worker)); JsonConvert.SerializeObject(worker));
return worker; return worker;
@ -112,8 +120,7 @@ WHERE ID=@Id";
var queryUpdate = @" var queryUpdate = @"
UPDATE WORKER UPDATE WORKER
SET SET
ID=@Id NAME=@NAME,
NAME=@Name,
EXPERIENCE=@Experience, EXPERIENCE=@Experience,
CLASS=@Class, CLASS=@Class,
PLANWORK=@PlanWork PLANWORK=@PlanWork

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB