public IEnumerable <Employee> get()
        {
            List <Employee> employees = new List <Employee>();

            employees = employeeModule.GetEmployees();
            return(employees);
        }
Пример #2
0
        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));
        }