Compare commits

...

2 Commits

Author SHA1 Message Date
Anitonchik
46658bd340 Merge branch 'LabWork_1' into LabWork_2 2024-11-15 12:16:02 +04:00
Anitonchik
b409d201d5 Лабораторная работа №1 2024-11-15 12:15:16 +04:00
9 changed files with 62 additions and 156 deletions

View File

@ -30,13 +30,11 @@
{ {
labelName = new Label(); labelName = new Label();
labelType = new Label(); labelType = new Label();
labelOptovik = new Label();
textBoxName = new TextBox(); textBoxName = new TextBox();
buttonSave = new Button(); buttonSave = new Button();
buttonCancel = new Button(); buttonCancel = new Button();
radioButtonOptYes = new RadioButton();
radioButtonOptNo = new RadioButton();
comboBoxClientType = new ComboBox(); comboBoxClientType = new ComboBox();
checkBoxOptYes = new CheckBox();
SuspendLayout(); SuspendLayout();
// //
// labelName // labelName
@ -57,15 +55,6 @@
labelType.TabIndex = 1; labelType.TabIndex = 1;
labelType.Text = "Тип клиента:"; labelType.Text = "Тип клиента:";
// //
// labelOptovik
//
labelOptovik.AutoSize = true;
labelOptovik.Location = new Point(38, 179);
labelOptovik.Name = "labelOptovik";
labelOptovik.Size = new Size(75, 20);
labelOptovik.TabIndex = 2;
labelOptovik.Text = "Оптовик?";
//
// textBoxName // textBoxName
// //
textBoxName.Location = new Point(157, 36); textBoxName.Location = new Point(157, 36);
@ -95,28 +84,6 @@
buttonCancel.UseVisualStyleBackColor = false; buttonCancel.UseVisualStyleBackColor = false;
buttonCancel.Click += ButtonCancel_Click; buttonCancel.Click += ButtonCancel_Click;
// //
// radioButtonOptYes
//
radioButtonOptYes.AutoSize = true;
radioButtonOptYes.Location = new Point(157, 177);
radioButtonOptYes.Name = "radioButtonOptYes";
radioButtonOptYes.Size = new Size(48, 24);
radioButtonOptYes.TabIndex = 8;
radioButtonOptYes.TabStop = true;
radioButtonOptYes.Text = "Да";
radioButtonOptYes.UseVisualStyleBackColor = true;
//
// radioButtonOptNo
//
radioButtonOptNo.AutoSize = true;
radioButtonOptNo.Location = new Point(227, 177);
radioButtonOptNo.Name = "radioButtonOptNo";
radioButtonOptNo.Size = new Size(55, 24);
radioButtonOptNo.TabIndex = 9;
radioButtonOptNo.TabStop = true;
radioButtonOptNo.Text = "Нет";
radioButtonOptNo.UseVisualStyleBackColor = true;
//
// comboBoxClientType // comboBoxClientType
// //
comboBoxClientType.FormattingEnabled = true; comboBoxClientType.FormattingEnabled = true;
@ -125,18 +92,27 @@
comboBoxClientType.Size = new Size(125, 28); comboBoxClientType.Size = new Size(125, 28);
comboBoxClientType.TabIndex = 10; comboBoxClientType.TabIndex = 10;
// //
// checkBoxOptYes
//
checkBoxOptYes.AutoSize = true;
checkBoxOptYes.CheckAlign = ContentAlignment.MiddleRight;
checkBoxOptYes.Location = new Point(45, 185);
checkBoxOptYes.Name = "checkBoxOptYes";
checkBoxOptYes.Size = new Size(90, 24);
checkBoxOptYes.TabIndex = 12;
checkBoxOptYes.Text = "Оптивик";
checkBoxOptYes.UseVisualStyleBackColor = true;
//
// FormClient // FormClient
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(329, 324); ClientSize = new Size(329, 324);
Controls.Add(checkBoxOptYes);
Controls.Add(comboBoxClientType); Controls.Add(comboBoxClientType);
Controls.Add(radioButtonOptNo);
Controls.Add(radioButtonOptYes);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(textBoxName); Controls.Add(textBoxName);
Controls.Add(labelOptovik);
Controls.Add(labelType); Controls.Add(labelType);
Controls.Add(labelName); Controls.Add(labelName);
Name = "FormClient"; Name = "FormClient";
@ -150,12 +126,10 @@
private Label labelName; private Label labelName;
private Label labelType; private Label labelType;
private Label labelOptovik;
private TextBox textBoxName; private TextBox textBoxName;
private Button buttonSave; private Button buttonSave;
private Button buttonCancel; private Button buttonCancel;
private RadioButton radioButtonOptYes;
private RadioButton radioButtonOptNo;
private ComboBox comboBoxClientType; private ComboBox comboBoxClientType;
private CheckBox checkBoxOptYes;
} }
} }

View File

@ -32,11 +32,7 @@ namespace ProjectCompanyFurniture.Forms
comboBoxClientType.SelectedItem = client.ClientType; comboBoxClientType.SelectedItem = client.ClientType;
if (client.Optovik) if (client.Optovik)
{ {
radioButtonOptYes.Checked = true; checkBoxOptYes.Checked = true;
}
else
{
radioButtonOptNo.Checked = true;
} }
_clientId = value; _clientId = value;
} }
@ -60,7 +56,7 @@ namespace ProjectCompanyFurniture.Forms
try try
{ {
if (string.IsNullOrWhiteSpace(textBoxName.Text) if (string.IsNullOrWhiteSpace(textBoxName.Text)
|| (radioButtonOptYes.Checked == false && radioButtonOptNo.Checked == false) || checkBoxOptYes.Checked == false
|| comboBoxClientType.SelectedIndex < 1) || comboBoxClientType.SelectedIndex < 1)
{ {
throw new Exception("Имеются незаполненные поля"); throw new Exception("Имеются незаполненные поля");
@ -85,6 +81,6 @@ namespace ProjectCompanyFurniture.Forms
private void ButtonCancel_Click(object sender, EventArgs e) => Close(); private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Client CreateClient(int id) => Client.CreateEntity(id, textBoxName.Text, private Client CreateClient(int id) => Client.CreateEntity(id, textBoxName.Text,
(ClientType)comboBoxClientType.SelectedItem!, radioButtonOptYes.Checked); (ClientType)comboBoxClientType.SelectedItem!, checkBoxOptYes.Checked);
} }
} }

View File

@ -28,8 +28,6 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
label5 = new Label();
dateTimePickerDateInvoice = new DateTimePicker();
buttonCancel = new Button(); buttonCancel = new Button();
buttonSave = new Button(); buttonSave = new Button();
groupBoxProducts = new GroupBox(); groupBoxProducts = new GroupBox();
@ -37,41 +35,23 @@
ColumnProduct = new DataGridViewComboBoxColumn(); ColumnProduct = new DataGridViewComboBoxColumn();
ColumnCount = new DataGridViewTextBoxColumn(); ColumnCount = new DataGridViewTextBoxColumn();
labelClientName = new Label(); labelClientName = new Label();
radioButtonPromYes = new RadioButton();
radioButtonPromNot = new RadioButton();
label1 = new Label();
label2 = new Label(); label2 = new Label();
numericUpDownDiscPercentage = new NumericUpDown(); numericUpDownDiscPercentage = new NumericUpDown();
comboBoxClient = new ComboBox(); comboBoxClient = new ComboBox();
label3 = new Label(); label3 = new Label();
numericUpDownSellingPrice = new NumericUpDown(); numericUpDownSellingPrice = new NumericUpDown();
checkBoxPromYes = new CheckBox();
groupBoxProducts.SuspendLayout(); groupBoxProducts.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridViewProducts).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridViewProducts).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownDiscPercentage).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownDiscPercentage).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSellingPrice).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownSellingPrice).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// label5
//
label5.AutoSize = true;
label5.Location = new Point(27, 251);
label5.Name = "label5";
label5.Size = new Size(44, 20);
label5.TabIndex = 4;
label5.Text = "Дата:";
//
// dateTimePickerDateInvoice
//
dateTimePickerDateInvoice.Location = new Point(216, 246);
dateTimePickerDateInvoice.Name = "dateTimePickerDateInvoice";
dateTimePickerDateInvoice.Size = new Size(151, 27);
dateTimePickerDateInvoice.TabIndex = 10;
//
// buttonCancel // buttonCancel
// //
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.BackColor = Color.FromArgb(192, 255, 192); buttonCancel.BackColor = Color.FromArgb(192, 255, 192);
buttonCancel.Location = new Point(270, 691); buttonCancel.Location = new Point(270, 548);
buttonCancel.Name = "buttonCancel"; buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(102, 29); buttonCancel.Size = new Size(102, 29);
buttonCancel.TabIndex = 11; buttonCancel.TabIndex = 11;
@ -83,7 +63,7 @@
// //
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.BackColor = Color.FromArgb(192, 255, 192); buttonSave.BackColor = Color.FromArgb(192, 255, 192);
buttonSave.Location = new Point(24, 691); buttonSave.Location = new Point(24, 548);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(102, 29); buttonSave.Size = new Size(102, 29);
buttonSave.TabIndex = 12; buttonSave.TabIndex = 12;
@ -95,9 +75,9 @@
// //
groupBoxProducts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; groupBoxProducts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
groupBoxProducts.Controls.Add(dataGridViewProducts); groupBoxProducts.Controls.Add(dataGridViewProducts);
groupBoxProducts.Location = new Point(24, 306); groupBoxProducts.Location = new Point(24, 236);
groupBoxProducts.Name = "groupBoxProducts"; groupBoxProducts.Name = "groupBoxProducts";
groupBoxProducts.Size = new Size(348, 366); groupBoxProducts.Size = new Size(348, 291);
groupBoxProducts.TabIndex = 13; groupBoxProducts.TabIndex = 13;
groupBoxProducts.TabStop = false; groupBoxProducts.TabStop = false;
groupBoxProducts.Text = "Продукты"; groupBoxProducts.Text = "Продукты";
@ -111,7 +91,7 @@
dataGridViewProducts.Location = new Point(3, 23); dataGridViewProducts.Location = new Point(3, 23);
dataGridViewProducts.Name = "dataGridViewProducts"; dataGridViewProducts.Name = "dataGridViewProducts";
dataGridViewProducts.RowHeadersWidth = 51; dataGridViewProducts.RowHeadersWidth = 51;
dataGridViewProducts.Size = new Size(342, 340); dataGridViewProducts.Size = new Size(342, 265);
dataGridViewProducts.TabIndex = 0; dataGridViewProducts.TabIndex = 0;
// //
// ColumnProduct // ColumnProduct
@ -137,37 +117,6 @@
labelClientName.TabIndex = 14; labelClientName.TabIndex = 14;
labelClientName.Text = "ФИО клиента:"; labelClientName.Text = "ФИО клиента:";
// //
// radioButtonPromYes
//
radioButtonPromYes.AutoSize = true;
radioButtonPromYes.Location = new Point(213, 89);
radioButtonPromYes.Name = "radioButtonPromYes";
radioButtonPromYes.Size = new Size(48, 24);
radioButtonPromYes.TabIndex = 16;
radioButtonPromYes.TabStop = true;
radioButtonPromYes.Text = "Да";
radioButtonPromYes.UseVisualStyleBackColor = true;
//
// radioButtonPromNot
//
radioButtonPromNot.AutoSize = true;
radioButtonPromNot.Location = new Point(309, 89);
radioButtonPromNot.Name = "radioButtonPromNot";
radioButtonPromNot.Size = new Size(55, 24);
radioButtonPromNot.TabIndex = 17;
radioButtonPromNot.TabStop = true;
radioButtonPromNot.Text = "Нет";
radioButtonPromNot.UseVisualStyleBackColor = true;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(27, 93);
label1.Name = "label1";
label1.Size = new Size(156, 20);
label1.TabIndex = 18;
label1.Text = "Наличие промокода:";
//
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
@ -209,25 +158,32 @@
numericUpDownSellingPrice.Size = new Size(151, 27); numericUpDownSellingPrice.Size = new Size(151, 27);
numericUpDownSellingPrice.TabIndex = 23; numericUpDownSellingPrice.TabIndex = 23;
// //
// checkBoxPromYes
//
checkBoxPromYes.AutoSize = true;
checkBoxPromYes.CheckAlign = ContentAlignment.MiddleRight;
checkBoxPromYes.Location = new Point(27, 94);
checkBoxPromYes.Name = "checkBoxPromYes";
checkBoxPromYes.Size = new Size(175, 24);
checkBoxPromYes.TabIndex = 24;
checkBoxPromYes.Text = "Наличие промокода";
checkBoxPromYes.UseVisualStyleBackColor = true;
//
// FormInvoice // FormInvoice
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(403, 747); ClientSize = new Size(403, 589);
Controls.Add(checkBoxPromYes);
Controls.Add(numericUpDownSellingPrice); Controls.Add(numericUpDownSellingPrice);
Controls.Add(label3); Controls.Add(label3);
Controls.Add(comboBoxClient); Controls.Add(comboBoxClient);
Controls.Add(numericUpDownDiscPercentage); Controls.Add(numericUpDownDiscPercentage);
Controls.Add(label2); Controls.Add(label2);
Controls.Add(label1);
Controls.Add(radioButtonPromNot);
Controls.Add(radioButtonPromYes);
Controls.Add(labelClientName); Controls.Add(labelClientName);
Controls.Add(groupBoxProducts); Controls.Add(groupBoxProducts);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(dateTimePickerDateInvoice);
Controls.Add(label5);
Name = "FormInvoice"; Name = "FormInvoice";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "Накладная"; Text = "Накладная";
@ -240,8 +196,6 @@
} }
#endregion #endregion
private Label label5;
private DateTimePicker dateTimePickerDateInvoice;
private Button buttonCancel; private Button buttonCancel;
private Button buttonSave; private Button buttonSave;
private GroupBox groupBoxProducts; private GroupBox groupBoxProducts;
@ -250,12 +204,10 @@
private DataGridViewTextBoxColumn ColumnCount; private DataGridViewTextBoxColumn ColumnCount;
private Label label2; private Label label2;
private Label labelClientName; private Label labelClientName;
private RadioButton radioButtonPromYes;
private RadioButton radioButtonPromNot;
private Label label1;
private NumericUpDown numericUpDownDiscPercentage; private NumericUpDown numericUpDownDiscPercentage;
private ComboBox comboBoxClient; private ComboBox comboBoxClient;
private Label label3; private Label label3;
private NumericUpDown numericUpDownSellingPrice; private NumericUpDown numericUpDownSellingPrice;
private CheckBox checkBoxPromYes;
} }
} }

View File

@ -36,29 +36,26 @@ namespace ProjectCompanyFurniture.Forms
{ {
try try
{ {
if (dataGridViewProducts.RowCount < 1 || comboBoxClient.SelectedIndex < 0 || if (dataGridViewProducts.RowCount < 1 || comboBoxClient.SelectedIndex < 0 || checkBoxPromYes.Checked == false)
(radioButtonPromYes.Checked == false && radioButtonPromNot.Checked == false))
{ {
throw new Exception("Имеются незаполненные поля"); throw new Exception("Имеются незаполненные поля");
} }
if (radioButtonPromYes.Checked && numericUpDownDiscPercentage.Value == 0) if (checkBoxPromYes.Checked && numericUpDownDiscPercentage.Value == 0)
{ {
throw new Exception("Не указан процент скидки"); throw new Exception("Не указан процент скидки");
} }
if (radioButtonPromYes.Checked) if (checkBoxPromYes.Checked)
{ {
_invoiceRepository.CreateInvoice(Invoice.CreateOperation(0, _invoiceRepository.CreateInvoice(Invoice.CreateOperation(0,
(int)comboBoxClient.SelectedValue!, 1, Convert.ToInt32(numericUpDownDiscPercentage.Value), (int)comboBoxClient.SelectedValue!, 1, Convert.ToInt32(numericUpDownDiscPercentage.Value),
Convert.ToInt32(numericUpDownSellingPrice.Value), Convert.ToInt32(numericUpDownSellingPrice.Value), CreateListInvoiceProductFromDataGrid()));
/*dateTimePickerDateInvoice.Value,*/
CreateListInvoiceProductFromDataGrid()));
} }
else else
{ {
_invoiceRepository.CreateInvoice(Invoice.CreateOperation(0, _invoiceRepository.CreateInvoice(Invoice.CreateOperation(0,
(int)comboBoxClient.SelectedValue!, 0, 0, Convert.ToInt32(numericUpDownSellingPrice.Value), (int)comboBoxClient.SelectedValue!, 0, 0, Convert.ToInt32(numericUpDownSellingPrice.Value),
/*dateTimePickerDateInvoice.Value,*/ CreateListInvoiceProductFromDataGrid())); CreateListInvoiceProductFromDataGrid()));
} }
Close(); Close();

View File

@ -123,10 +123,4 @@
<metadata name="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="ColumnCount.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="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View File

@ -30,8 +30,6 @@
{ {
labelProductID = new Label(); labelProductID = new Label();
labelMovement = new Label(); labelMovement = new Label();
labelDate = new Label();
dateTimePickerProductMovementDate = new DateTimePicker();
buttonCancel = new Button(); buttonCancel = new Button();
buttonSave = new Button(); buttonSave = new Button();
checkedListBoxMovement = new CheckedListBox(); checkedListBoxMovement = new CheckedListBox();
@ -56,27 +54,11 @@
labelMovement.TabIndex = 1; labelMovement.TabIndex = 1;
labelMovement.Text = "Тип движения:"; labelMovement.Text = "Тип движения:";
// //
// labelDate
//
labelDate.AutoSize = true;
labelDate.Location = new Point(31, 232);
labelDate.Name = "labelDate";
labelDate.Size = new Size(44, 20);
labelDate.TabIndex = 2;
labelDate.Text = "Дата:";
//
// dateTimePickerProductMovementDate
//
dateTimePickerProductMovementDate.Enabled = false;
dateTimePickerProductMovementDate.Location = new Point(267, 232);
dateTimePickerProductMovementDate.Name = "dateTimePickerProductMovementDate";
dateTimePickerProductMovementDate.Size = new Size(181, 27);
dateTimePickerProductMovementDate.TabIndex = 3;
//
// buttonCancel // buttonCancel
// //
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.BackColor = Color.FromArgb(255, 192, 192); buttonCancel.BackColor = Color.FromArgb(255, 192, 192);
buttonCancel.Location = new Point(286, 296); buttonCancel.Location = new Point(286, 232);
buttonCancel.Name = "buttonCancel"; buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(162, 29); buttonCancel.Size = new Size(162, 29);
buttonCancel.TabIndex = 6; buttonCancel.TabIndex = 6;
@ -86,8 +68,9 @@
// //
// buttonSave // buttonSave
// //
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.BackColor = Color.FromArgb(255, 192, 192); buttonSave.BackColor = Color.FromArgb(255, 192, 192);
buttonSave.Location = new Point(31, 296); buttonSave.Location = new Point(31, 232);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(162, 29); buttonSave.Size = new Size(162, 29);
buttonSave.TabIndex = 7; buttonSave.TabIndex = 7;
@ -116,13 +99,11 @@
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(485, 399); ClientSize = new Size(485, 290);
Controls.Add(comboBoxProduct); Controls.Add(comboBoxProduct);
Controls.Add(checkedListBoxMovement); Controls.Add(checkedListBoxMovement);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(dateTimePickerProductMovementDate);
Controls.Add(labelDate);
Controls.Add(labelMovement); Controls.Add(labelMovement);
Controls.Add(labelProductID); Controls.Add(labelProductID);
Name = "FormProductMovement"; Name = "FormProductMovement";
@ -136,8 +117,6 @@
private Label labelProductID; private Label labelProductID;
private Label labelMovement; private Label labelMovement;
private Label labelDate;
private DateTimePicker dateTimePickerProductMovementDate;
private Button buttonCancel; private Button buttonCancel;
private Button buttonSave; private Button buttonSave;
private CheckedListBox checkedListBoxMovement; private CheckedListBox checkedListBoxMovement;

View File

@ -50,7 +50,7 @@ namespace ProjectCompanyFurniture.Forms
movement |= (Movement)elem; movement |= (Movement)elem;
} }
_productMovementRepository.CreateProductMovement(ProductMovement.CreateOperation(0, _productMovementRepository.CreateProductMovement(ProductMovement.CreateOperation(0,
(int)comboBoxProduct.SelectedValue!, movement)); //dateTimePickerProductMovementDate.Value)); (int)comboBoxProduct.SelectedValue!, movement));
Close(); Close();
} }

View File

@ -111,6 +111,7 @@
Name = "FormProducts"; Name = "FormProducts";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "Продукты"; Text = "Продукты";
Load += FormProducts_Load;
panel1.ResumeLayout(false); panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
ResumeLayout(false); ResumeLayout(false);

View File

@ -25,6 +25,19 @@ namespace ProjectCompanyFurniture.Forms
_productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository));
} }
private void FormProducts_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e) private void ButtonAdd_Click(object sender, EventArgs e)
{ {
try try