Beispiel #1
0
        private void AddCustomFoodButton_Click(object sender, EventArgs e)
        {
            NC_CreateFood form = new NC_CreateFood(new FoodModel {
                IsCustom = true
            });

            if (form.ShowDialog(this) != DialogResult.OK && form.updateData)
            {
                UpdateData();
            }

            form.Dispose();
        }
Beispiel #2
0
        private void EditCustomFoodButton_Click(object sender, EventArgs e)
        {
            if (customFoodListBox.SelectedItem != null)
            {
                NC_CreateFood form = new NC_CreateFood(AvailableCustomFood[int.Parse(customFoodListBox.SelectedValue.ToString())]);

                if (form.ShowDialog(this) != DialogResult.OK && form.updateData)
                {
                    UpdateData();
                }

                form.Dispose();
            }
        }