示例#1
0
 public static void InitDatabase()
 {
     // Init DB
     CustomerDAL.initData();
     PastryDAL.initData();
     BranchDAL.initData();
     OrderdDAL.initData();
 }
示例#2
0
        public static void DeleteCustomer(string customerIDToRemove)
        {
            //using (PastryContext Contexts.DB = new PastryContext())
            {
                var customer = GetCustomer(customerIDToRemove);
                OrderdDAL.DeleteAllRelatedOrders(customer.allRelatedOrders);
                Contexts.DB.Entry(customer).State = EntityState.Deleted;

                int num = Contexts.DB.SaveChanges();
            }
        }
示例#3
0
        public static void DeletePastry(Pastery PastryToRemove)
        {
            //using (PastryContext Contexts.DB = new PastryContext())
            {
                var pastry = GetPatry(PastryToRemove.ID);
                OrderdDAL.DeleteAllRelatedDetails(pastry.OrdersDetailes);
                Contexts.DB.Entry(pastry).State = EntityState.Deleted;

                int num = Contexts.DB.SaveChanges();
            }
        }