public bool DeleteRole(Role role) { var context = new BrandShopContext(); context.Entry(role).State = System.Data.Entity.EntityState.Deleted; return(context.SaveChanges() > 0); }
public bool DeleteBrand(Brand brand) { var context = new BrandShopContext(); context.Entry(brand).State = System.Data.Entity.EntityState.Deleted; return(context.SaveChanges() > 0); }
public bool DeleteSupplier(Supplier supplier) { var context = new BrandShopContext(); context.Entry(supplier).State = System.Data.Entity.EntityState.Deleted; return(context.SaveChanges() > 0); }
public bool UpdateUser(User user) { var context = new BrandShopContext(); context.Entry(user).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges() > 0); }
public bool DeleteMenu(MainMenu mainMenu) { var context = new BrandShopContext(); context.Entry(mainMenu).State = System.Data.Entity.EntityState.Deleted; return(context.SaveChanges() > 0); }
public bool UpdateTag(Tag tag) { var context = new BrandShopContext(); context.Entry(tag).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges() > 0); }
public bool DeleteProduct(Product product) { var context = new BrandShopContext(); context.Entry(product).State = System.Data.Entity.EntityState.Deleted; return(context.SaveChanges() > 0); }
public bool UpdateSubMenu(SubMenu subMenu) { var context = new BrandShopContext(); var exitingSubMenu = context.SubMenus.Find(subMenu.SubMenuID); context.SubMenuPictures.RemoveRange(exitingSubMenu.SubMenuPictures); context.Entry(exitingSubMenu).CurrentValues.SetValues(subMenu); context.SubMenuPictures.AddRange(subMenu.SubMenuPictures); //context.Entry(subMenu).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges() > 0); }