Пример #1
0
 public void Cleanup()
 {
     using (basicEntities be = new basicEntities())
     {
         if (be.Businesses.Find(Businessid) != null)
         {
             be.Businesses.Remove(be.Businesses.Find(Businessid));
             be.SaveChanges();
             TestOwner.RemoveOwner(owners);
             TestAdmin.RemoveAdmin(admins);
         }
     }
 }
Пример #2
0
        public static void RemoveBusinesses(string BusinessID)
        {
            using (basicEntities be = new basicEntities())
            {
                Business BusinessesToRemove = be.Businesses.Find(BusinessID);
                string   owner = BusinessesToRemove.Admin.UserName;
                string   admin = BusinessesToRemove.Owner.UserName;
                be.Businesses.Remove(BusinessesToRemove);

                be.SaveChanges();
                TestOwner.RemoveOwner(owner);
                TestAdmin.RemoveAdmin(admin);
                be.SaveChanges();
            }
        }
Пример #3
0
        public static void DeleteAllOwners()
        {
            using (basicEntities be = new basicEntities())
            {
                var query = from b in be.Users
                            select b;

                foreach (Coupon.User item in query)
                {
                    if (item is Coupon.Owner)
                    {
                        TestOwner.RemoveOwner(item.UserName);
                    }
                }
            }
        }