public ActionResult SaveRecords(FormCollection model)
 {
     if (ModelState.IsValid)
     {
         using (BusinessCategoryCtl db = new BusinessCategoryCtl())
         {
             var BusinesscategoryidArray = model.GetValues("item.Businesscategoryid");
             var BusinessidArray         = model.GetValues("item.Businessid");
             var CategoryidArray         = model.GetValues("item.Categoryid");
             for (Int32 i = 0; i < BusinesscategoryidArray.Length; i++)
             {
                 BusinessCategoryClass obj_update = db.selectById(Convert.ToInt32(BusinesscategoryidArray[i]));
                 if (!string.IsNullOrEmpty(Convert.ToString(BusinesscategoryidArray)))
                 {
                     obj_update.Businesscategoryid = Convert.ToInt32(BusinesscategoryidArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(BusinessidArray)))
                 {
                     obj_update.Businessid = Convert.ToInt32(BusinessidArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(CategoryidArray)))
                 {
                     obj_update.Categoryid = Convert.ToInt32(CategoryidArray[i]);
                 }
                 db.update(obj_update);
             }
         }
     }
     return(RedirectToAction("EditTable"));
 }
 public ActionResult Details(Int32?Businesscategoryid)
 {
     using (BusinessCategoryCtl db = new BusinessCategoryCtl())
     {
         BusinessCategoryClass obj_BusinessCategory = db.selectById(Businesscategoryid);
         return(View(obj_BusinessCategory));
     }
 }
 public ActionResult Edit(Int32?Businesscategoryid)
 {
     using (BusinessCategoryCtl db = new BusinessCategoryCtl())
     {
         BusinessCategoryClass obj_BusinessCategory = db.selectById(Businesscategoryid);
         Session["EditPreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer);
         return(View(obj_BusinessCategory));
     }
 }