// // private void insert_new_product_button_Click(object sender, EventArgs e)// добавляем новый товар { FormNewProduct newProduct = new FormNewProduct(false, "", "", "", "", "", "", "", "", "", "", ""); if (newProduct.ShowDialog() != DialogResult.OK) { RefreshDGVProduct(); comboBoxCategory.SelectedIndex = 0; comboBoxStatus.SelectedIndex = 0; } }
private void update_product_button_Click(object sender, EventArgs e) // кнопка обновление товара { FormNewProduct newProduct = new FormNewProduct(true, dataGridViewProduct.CurrentRow.Cells[0].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[1].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[2].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[3].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[4].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[5].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[6].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[7].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[8].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[9].Value.ToString(), dataGridViewProduct.CurrentRow.Cells[10].Value.ToString()); if (newProduct.ShowDialog() != DialogResult.OK) { RefreshDGVProduct(); comboBoxCategory.SelectedIndex = 0; comboBoxStatus.SelectedIndex = 0; } }