//Modify customer public void ModifyAction() { Console.WriteLine("Tryin To Modify......."); addCustomer = false; addModifyCustomer = new Lab5_CustomerMaintenenceWPF.Views.AddModifyPage(); AddModifyWrap.LoadAddModify(); addModifyCustomer.Show(); Console.WriteLine("YOU CAN'T ADD ANTHING!"); }
//Add customer public void AddAction() { addCustomer = true; addModifyCustomer = new Lab5_CustomerMaintenenceWPF.Views.AddModifyPage(); AddModifyWrap.LoadAddModify(); addModifyCustomer.Show(); // selectedWrap.NameNotify = "JORDAN"; Console.WriteLine("YOU CAN'T ADD ANTHING!"); //addCustomer = false; }
public void deleteFromDatabase(Customer customer) { try { dbContext.Customers.Remove(customer); dbContext.SaveChanges(); this.ClearControls(); } catch (DbUpdateConcurrencyException ex) { ex.Entries.Single().Reload(); MessageBox.Show("Another user has updated " + "that customer.", "Concurrency Error"); AddModifyWrap.ReloadViewWithCorrectValues(AddModifyWrap.modified); } catch (ArgumentNullException e) { MessageBox.Show("Another user has deleted " + "that customer.", "Concurrency Error"); this.ClearControls(); } }