Beispiel #1
0
 public static void DeleteEmployee(int employeeId, int deletedBy)
 {
     using (var serviceClient = new EmployeeServicesClient())
     {
         serviceClient.DeleteEmployee(employeeId, deletedBy);
     }
 }
Beispiel #2
0
 public static int UpdateEmployee(Employee employee)
 {
     using (var serviceClient = new EmployeeServicesClient())
     {
         var employeeId = serviceClient.UpdateEmployee(ConvertEmployeeEntityToDTO(employee));
         return(employeeId);
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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);
     }
 }