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 string Name { get; private set; }
public int Price { get; private set; }
public int ProductionId { get; private set; }
public NameOfProductTypes ProductionType { get; private set; }
public string ProductionId { 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 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 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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,8 @@ namespace ProductionInCehOTP.Forms
}
textBoxNameOfProduct.Text = product.Name;
numericUpDownPrice.Value = product.Price;
comboBoxProductType.SelectedItem = product.ProductionType;
comboBoxProductType.SelectedItem = product.ProductionTypeID;
textBoxOficialID.Text = product.ProductionId;
_productID = value;
}
@ -58,7 +59,7 @@ namespace ProductionInCehOTP.Forms
{
try
{
if (string.IsNullOrWhiteSpace(textBoxNameOfProduct.Text) || numericUpDownPrice.Value == null)
if (string.IsNullOrWhiteSpace(textBoxNameOfProduct.Text))
{
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();

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -35,13 +35,8 @@ namespace ProductionInCehOTP.Forms
{
throw new InvalidDataException(nameof(worker));
}
string firstname = textBoxFirstName.Text;
string lastname = textBoxLastName.Text;
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;
textBoxName.Text = worker.Name;
dateTimePickerExp.Value = worker.Experience;
numericUpDownClassOfWorker.Value = worker.Class;
numericUpDownPlan.Value = worker.PlanWork;
@ -58,7 +53,7 @@ namespace ProductionInCehOTP.Forms
{
try
{
if(string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxSecondName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text))
if(string.IsNullOrWhiteSpace(textBoxName.Text))
{
throw new Exception("Имеются незаполненные поля");
}
@ -82,6 +77,6 @@ namespace ProductionInCehOTP.Forms
private void ButtonCensel_Click(object sender, EventArgs e) => Close();
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(panel1);
Name = "FormWorkers";
StartPosition = FormStartPosition.CenterScreen;
Text = "Рабочие";
Load += FormWorkers_Load;
((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>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
@ -69,5 +79,15 @@ namespace ProductionInCehOTP.Properties {
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">
<value>..\Resources\BackGroundOTP.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</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>

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB