private void DGVDishesList_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 6) { AddEditDishForm addEdit = new AddEditDishForm((DishDTO)dGVDishesList.CurrentRow.Tag, this); addEdit.Show(); } if (e.ColumnIndex == 7) { DishDTO dish = (DishDTO)dGVDishesList.CurrentRow.Tag; if (MessageBox.Show("Удалить " + dish.Name + " ?", "Подтверждение удаления", MessageBoxButtons.YesNo) == DialogResult.Yes) { MainForm.DB.Dishes.Delete(dish.Id); MainForm.DB.Save(); LoggingService.AddLog("Удаление блюда: " + dish.ToString()); ReloadData(); } } }
public SetNorm(AddEditDishForm main, string nameProduct) { this.main = main; this.nameProduct = nameProduct; InitializeComponent(); }
private void ButAddDish_Click(object sender, EventArgs e) { AddEditDishForm addForm = new AddEditDishForm(this); addForm.Show(); }