public ActionResult Delete(int id)
 {
     using (HISDBEntities db = new HISDBEntities())
     {
         BrandSubCategory scat = db.BrandSubCategories.Where(x => x.SubCategoryID == id).FirstOrDefault <BrandSubCategory>();
         db.BrandSubCategories.Remove(scat);
         db.SaveChanges();
         return(Json(new { success = true, message = "Deleted Successfully" }, JsonRequestBehavior.AllowGet));
     }
 }
 public ActionResult AddModify(BrandSubCategory p)
 {
     using (HISDBEntities db = new HISDBEntities())
     {
         if (p.SubCategoryID == 0)
         {
             db.BrandSubCategories.Add(p);
             db.SaveChanges();
             return(Json(new { success = true, message = "Saved Successfully" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             db.Entry(p).State = EntityState.Modified;
             db.SaveChanges();
             return(Json(new { success = true, message = "Updated Successfully" }, JsonRequestBehavior.AllowGet));
         }
     }
 }