public static void DeleteEmployee(int employeeId, int deletedBy) { using (var serviceClient = new EmployeeServicesClient()) { serviceClient.DeleteEmployee(employeeId, deletedBy); } }
public static int UpdateEmployee(Employee employee) { using (var serviceClient = new EmployeeServicesClient()) { var employeeId = serviceClient.UpdateEmployee(ConvertEmployeeEntityToDTO(employee)); return(employeeId); } }
public static List <Employee> GetEmployees(int pageIndex, int pageSize, int?departemntId, string keyword, string columnName, bool orderASC) { var empList = new List <Employee>(); using (var serviceClient = new EmployeeServicesClient()) { var empDTO = serviceClient.GetEmployees(pageIndex, pageSize, departemntId, keyword, columnName, orderASC).ToList(); empDTO.ForEach(dto => empList.Add(ConvertEmployeeDTOToEntity(dto)) ); } return(empList); }
public static List <Department> GetDepartment() { using (var serviceClient = new EmployeeServicesClient()) { var departmentList = new List <Department>(); var departmentDto = serviceClient.GetDepartment().ToList(); if (departmentDto != null) { departmentDto.ForEach(x => { departmentList.Add(new Department() { DepartmentID = x.DepartmentID, DepartmentName = x.DepartmentName }); }); } return(departmentList); } }