private void EditProductButton_Click(object sender, EventArgs e) { try { ProductWorkingForm productWorkingForm = new ProductWorkingForm(productsList.FirstOrDefault(x => x.id == (int)ProductDataGridView.CurrentRow.Cells[0].Value)); productWorkingForm.ShowDialog(); } catch (Exception) { MessageBox.Show("Выберите товар для редактирования", "Ошибка"); } }
private void AddProductButton_Click(object sender, EventArgs e) { ProductWorkingForm productWorkingForm = new ProductWorkingForm(); productWorkingForm.ShowDialog(); }