Exemplo n.º 1
0
 public static void InitDatabase()
 {
     // Init DB
     CustomerDAL.initData();
     PastryDAL.initData();
     BranchDAL.initData();
     OrderdDAL.initData();
 }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }