// GET: Employee public ActionResult Index(int page = 1, string searchValue = "", string country = "") { var model = new Models.EmployeePaginationResult() { SearchValue = searchValue, Country = country, Page = page, PageSize = AppSettings.DefaultPagesize, RowCount = HumanResourceBLL.Employee_Count(searchValue, country), Data = HumanResourceBLL.Employee_List(page, AppSettings.DefaultPagesize, searchValue, country) }; return(View(model)); }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult Index(int page = 1, string searchValue = "") { HttpCookie requestCookie = Request.Cookies["userInfo"]; int idCookie = Convert.ToInt32(requestCookie["AccountID"]); var model = new Models.EmployeePaginationResult() { Page = page, PageSize = AppSettings.DefaultPageSize, RowCount = HumanResourceBLL.Employee_Count(searchValue, idCookie), Data = HumanResourceBLL.Employee_List(page, AppSettings.DefaultPageSize, searchValue, idCookie), SearchValue = searchValue, }; return(View(model)); }
/// <summary> /// Danh sách SelectListItem cho Employee /// </summary> /// <param name="allowSelectAll"></param> /// <returns></returns> public static List <SelectListItem> Employees(bool allowSelectAll = true) { List <SelectListItem> list = new List <SelectListItem>(); if (allowSelectAll) { list.Add(new SelectListItem() { Value = "0", Text = "-- All Employee FullName --" }); } foreach (var employee in HumanResourceBLL.Employee_List()) { list.Add(new SelectListItem() { Value = employee.EmployeeID.ToString(), Text = employee.LastName + employee.FirstName, }); } return(list); }