Example #1
0
 public bool editCategory(Category cat)
 {
     var db = new ProductContext();
     if(cat != null)
     {
         db.Entry(cat).State = EntityState.Modified;
         db.SaveChanges();
         return true;
     }
     return false;
 }
Example #2
0
 public bool addCategory(Category cat)
 {
     var db = new ProductContext();
     if(cat != null)
     {
         db.Categories.Add(cat);
         db.SaveChanges();
         return true;
     }
     return false;
 }
Example #3
0
 public bool editCategory(Category cat)
 {
     return db.editCategory(cat);
 }
Example #4
0
 public bool addCategory(Category cat)
 {
     return db.addCategory(cat);
 }