Exemplo n.º 1
0
 public static void RemoveCoupon(int CouponID)
 {
     using (basicEntities be = new basicEntities())
     {
         Coupon.Coupon CouponToRemove = be.Coupons.Find(CouponID);
         string        Businessid     = CouponToRemove.Business.BusinessID;
         be.Coupons.Remove(CouponToRemove);
         be.SaveChanges();
         TestBusiness.RemoveBusinesses(Businessid);
         be.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void Cleanup()
 {
     using (basicEntities be = new basicEntities())
     {
         if (be.Coupons.Find(coupon) != null)
         {
             be.Coupons.Remove(be.Coupons.Find(coupon));
             be.SaveChanges();
             TestBusiness.RemoveBusinesses(Businessid);
             be.SaveChanges();
         }
     }
 }
Exemplo n.º 3
0
        public static void DeleteAllBusiness()
        {
            using (basicEntities be = new basicEntities())
            {
                var query = from b in be.Businesses
                            select b;

                foreach (Coupon.Business item in query)
                {
                    TestBusiness.RemoveBusinesses(item.BusinessID);
                }
            }
        }