/// <summary> /// Method for adding a new pizza /// </summary> public void AddPizzaExecute() { try { AddPizzaWindow addPizzaWindow = new AddPizzaWindow(); addPizzaWindow.ShowDialog(); PizzaList = pizzaData.GetAllPizzas().ToList(); } catch (Exception) { MessageBoxResult dialog = MessageBox.Show("Currently cannot add the pizza...", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
/// <summary> /// Opens the Add Pizzawindow /// </summary> /// <param name="addPizzaOpen">Window that we open</param> public AddPizzaViewModel(AddPizzaWindow addPizzaOpen) { pizza = new tblPizza(); addPizzaWindow = addPizzaOpen; CanEdit = true; }