示例#1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Recipe recipe = new Recipe();
            var    form   = new FormNewRecipe(recipe, false);

            form.ShowDialog();
        }
示例#2
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            int    id     = Convert.ToInt32(listViewRecipes.SelectedItems[0].Text);
            Recipe recipe = repository.GetById(id);
            var    form   = new FormNewRecipe(recipe, true);

            listViewRecipes.Items.Clear();
            form.ShowDialog();
            DisableButtons();
        }