Exemplo n.º 1
0
 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();
         }
     }
 }
Exemplo n.º 2
0
 public SetNorm(AddEditDishForm main, string nameProduct)
 {
     this.main        = main;
     this.nameProduct = nameProduct;
     InitializeComponent();
 }
Exemplo n.º 3
0
        private void ButAddDish_Click(object sender, EventArgs e)
        {
            AddEditDishForm addForm = new AddEditDishForm(this);

            addForm.Show();
        }