public ActionResult Edit(Int32 Userid)
 {
     using (usersCtl db = new usersCtl()){
         usersClass obj_users = db.selectById(Userid);
         Session["EditPreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer);
         return(View(obj_users));
     }
 }
 public ActionResult SaveRecords(FormCollection model)
 {
     if (ModelState.IsValid)
     {
         using (usersCtl db = new usersCtl()){
             var UseridArray     = model.GetValues("item.Userid");
             var EmailArray      = model.GetValues("item.Email");
             var PasswordArray   = model.GetValues("item.Password");
             var DevicetypeArray = model.GetValues("item.Devicetype");
             var DeviceidArray   = model.GetValues("item.Deviceid");
             var IsactiveArray   = model.GetValues("item.Isactive");
             for (Int32 i = 0; i < UseridArray.Length; i++)
             {
                 usersClass obj_update = db.selectById(Convert.ToInt32(UseridArray[i]));
                 if (!string.IsNullOrEmpty(Convert.ToString(UseridArray)))
                 {
                     obj_update.Userid = Convert.ToInt32(UseridArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(EmailArray)))
                 {
                     obj_update.Email = Convert.ToString(EmailArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(PasswordArray)))
                 {
                     obj_update.Password = Convert.ToString(PasswordArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(DevicetypeArray)))
                 {
                     obj_update.Devicetype = Convert.ToString(DevicetypeArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(DeviceidArray)))
                 {
                     obj_update.Deviceid = Convert.ToString(DeviceidArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(IsactiveArray)))
                 {
                     obj_update.Isactive = Convert.ToBoolean(IsactiveArray[i]);
                 }
                 db.update(obj_update);
             }
         }
     }
     return(RedirectToAction("EditTable"));
 }
 public ActionResult Details(Int32 Userid)
 {
     using (usersCtl db = new usersCtl()){ usersClass obj_users = db.selectById(Userid);
                                           return(View(obj_users)); }
 }