public ActionResult Edit(CartDepartment model)
 {
     if (ModelState.IsValid)
     {
         department_Service.editDepartment(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
 public bool deleteDepartment(CartDepartment model)
 {
     try
     {
         db.Cartdepartments.Remove(model);
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     { return(false); }
 }
 public bool editDepartment(CartDepartment model)
 {
     try
     {
         db.Entry(model).State = EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     { return(false); }
 }