public ActionResult Index(int?page, int PageSize = 10) { string UserId = User.Identity.GetUserId(); UserViewModel userDetail = generic.GetUserDetail(UserId); ViewBag.UserId = userDetail.SubscriberId; ViewData["UserProfile"] = userDetail; PopulatePaging(PageSize); ViewBag.Paging = PageSize; int pageSize = PageSize; int pageNumber = (page ?? 1); var resignation = ems.GetResignation(userDetail.UserId, "Admin").ToPagedList(pageNumber, pageSize); if (userDetail.Role == "Employee") { var empdetails = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault(); ViewData["EmpDetails"] = empdetails; ViewData["CompanyLogo"] = cms.GetCompanyLogo(userDetail.SubscriberId).FirstOrDefault(); resignation = ems.GetResignation(userDetail.UserId, "Admin").ToPagedList(pageNumber, pageSize); } else { resignation = ems.GetResignation(userDetail.SubscriberId, "Admin").ToPagedList(pageNumber, pageSize); } return(View(resignation)); }