private void cmdAdd_Click(object sender, EventArgs e) { try { this.Hide(); using (Form editForm = new EditRecipe()) { editForm.ShowDialog(); } this.OnLoad(); this.Show(); } catch (Exception exception) { ExceptionHelper exceptionhelper = new ExceptionHelper(); exceptionhelper.WriteToLogFile(exception); } }
private void cmdEditRecipes_Click(object sender, EventArgs e) { try { this.Hide(); Recipe toSend = recipes.Find(n => n.Title == lstRecipe.SelectedItem.ToString()); using (Form editForm = new EditRecipe(toSend)) { editForm.ShowDialog(); } this.OnLoad(); this.Show(); } catch (Exception exception) { ExceptionHelper exceptionhelper = new ExceptionHelper(); exceptionhelper.WriteToLogFile(exception); } }