public ActionResult Index() { int EmpCode = Convert.ToInt32(Session["Empcode"]); try { LeaveApplicationModel Result = new LeaveApplicationModel(); Result.LeaveApplication = _LeaveAddAdmin.LeaveApplicationSearch(); // List <int> OfficeFilterList = _officeService.MyAccessOfficeList(); Result.LeaveApplicationDetails = _LeaveAddAdmin.LeaveapplicationList().Where(x => x.LeaveEmpCode > 0 && OfficeFilterList.Contains(x.EmployeeDetail.EmpOfficeId)).Take(100).ToList(); return(View(Result)); } catch (Exception Ex) { Session["error"] = Ex.Message; return(View()); } }
public ActionResult Index() { try { LeaveApplicationModel Result = new LeaveApplicationModel(); int EmpCode = Convert.ToInt32(Session["EmpCode"]); Result.LeaveApplication = _LeaveAddAdmin.LeaveApplicationSearch(); Result.LeaveApplicationDetails = _LeaveAddAdmin.LeaveapplicationList().Where(x => x.LeaveEmpCode == EmpCode).Take(50).OrderByDescending(x => x.LeaveStartDate); return(View(Result)); } catch (Exception Ex) { Session["error"] = Ex.Message; return(View()); } }