public IEnumerable <Employee> get() { List <Employee> employees = new List <Employee>(); employees = employeeModule.GetEmployees(); return(employees); }
public ActionResult GetEmployeesData([DataSourceRequest] DataSourceRequest request, string Name, int IdDepartment) { List <Employee> emplist; if (String.IsNullOrEmpty(Name)) { Name = null; } emplist = _employeeModule.GetEmployees(request.Page, request.PageSize, Name, IdDepartment); int numberOfEmployees = _employeeModule.GetNumberOfEmployees(Name, IdDepartment); var result = new DataSourceResult() { Data = emplist, Total = numberOfEmployees }; return(Json(result, JsonRequestBehavior.AllowGet)); }