public ActionResult Index(int?id, int?mrNo) { try { //var userid = User.Identity.GetUserId(); // string[] roles = Roles.GetRolesForUser(User.Identity.GetUserName()); // bool isInRole = User.IsInRole("Receptionist"); int pageNo = id ?? 1; int pagesize = 10; var model = mrNo.HasValue ? obj.SeachPatientByMrNumber(mrNo ?? 0, out outmodel) : obj.SelectAll(pageNo, pagesize, out outmodel); PatientInfoPaging pmodel = new PatientInfoPaging(); pmodel.PageNo = pageNo; pmodel.Patients = model; pmodel.TotalRecords = outmodel.TotalRecords; pmodel.PageSize = pagesize; return(View(pmodel)); } catch (Exception ex) { throw ex; } }