コード例 #1
0
 //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!");
 }
コード例 #2
0
        //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;
        }
コード例 #3
0
        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();
            }
        }