public bool ToUpdateProductCategory(ProductCategory inventory)
 {
     using (UserDataBase userDataBase = new UserDataBase())
     {
         userDataBase.Entry(inventory).State = EntityState.Modified;
         userDataBase.SaveChanges();
         return(true);
     }
 }
 public bool ToRegisterProductCategory(ProductCategory inventory)
 {
     using (UserDataBase userDataBase = new UserDataBase())
     {
         userDataBase.productCategory.Add(inventory);
         userDataBase.SaveChanges();
         return(true);
     }
 }
Пример #3
0
 public bool ToUpdateCarousel(CarouselSlider carouselSlider)
 {
     using (UserDataBase userDataBase = new UserDataBase())
     {
         userDataBase.Entry(carouselSlider).State = EntityState.Modified;
         userDataBase.SaveChanges();
         return(true);
     }
 }
Пример #4
0
 public bool ToRegister(User user)
 {
     using (UserDataBase userDataBase = new UserDataBase())
     {
         userDataBase.user.Add(user);
         userDataBase.SaveChanges();
         return(true);
     }
 }
 public bool ToDeleteProductCategory(int CategoryId, ProductCategory inventory)
 {
     using (UserDataBase userDataBase = new UserDataBase())
     {
         inventory = userDataBase.productCategory.Where(model => model.CategoryId == CategoryId).FirstOrDefault();
         userDataBase.productCategory.Remove(inventory);
         userDataBase.SaveChanges();
         return(true);
     }
 }
Пример #6
0
 public bool ToDelete(int UserId, User user)
 {
     using (UserDataBase userDataBase = new UserDataBase())
     {
         user = userDataBase.user.Where(model => model.UserId == UserId).FirstOrDefault();
         userDataBase.user.Remove(user);
         userDataBase.SaveChanges();
         return(true);
     }
 }