示例#1
0
 private void btnEditFoods_Click(object sender, EventArgs e)
 {
     if (showAllFood == null || showAllFood.IsDisposed)
     {
         showAllFood = new ShowAllFood();
     }
     showAllFood.Show();
     Hide();
 }
示例#2
0
        private void OK_Click(object sender, EventArgs e)
        {
            if (!ControlsOK())
            {
                return;
            }
            int errorCode = FoodDB.EditFood(
                id: FoodToEdit.Id,
                Name: FoodName.Text,
                Ingredients: RecipeString,
                SelfService: FoodSelfService.Checked,
                Category: FoodCategory.Text,
                Details: FoodDetails.Text
                );

            if (errorCode == 0)
            {
                ShowAllFood showAllFood = (ShowAllFood)Owner;
                showAllFood.FillList();
                showAllFood.FoodTable_RowEnter(null, null);
                Close();
            }
        }