private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            int rid = (int)App.Current.Properties["RecipeID"];

            App.Current.Properties["rid"] = rid;

            EditRecipe win = new EditRecipe();

            win.ShowDialog();
            UpdateWindow();
            isDeleted = (bool)App.Current.Properties["isDeleted"];
            if (isDeleted == true)
            {
                ViewAllRecipes winvar = new ViewAllRecipes();
                closeWindowTimer();
                winvar.Show();
                //this.Close();
            }
        }
Пример #2
0
        private void btnCreate_Click(object sender, RoutedEventArgs e)
        {
            FoodProjectDataSetTableAdapters.RecipeTableAdapter rta
                = new FoodProjectDataSetTableAdapters.RecipeTableAdapter();

            if (String.IsNullOrWhiteSpace(txtName.Text) == false)
            {
                int rid = (int)rta.InsertRecipe(txtName.Text);

                App.Current.Properties["rid"] = rid;

                EditRecipe win = new EditRecipe();
                win.ShowDialog();

                this.Close();
            }
            else
            {
                MessageBox.Show("Vinsamlegast veljið nafn.");
            }
        }