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