public static EmployeeInfoResponse ToDTO(this CCHR_Employee entity) { EmployeeInfoResponse response = new EmployeeInfoResponse(); response.EmpID = entity.EmpID; response.EmpNo = entity.EmpNo; response.EmpName = entity.EmpName; response.DomainAccount = entity.DomainAccount; response.JobLevel = entity.JobLevel; response.InCompanyDate = entity.InCompanyDate.ToDate(); response.ContractName = entity.ContractName; response.CompanyName = entity.ContractType; return(response); }
private Task <EmployeeInfoResponse> GetEmployeeInfo(EmployeeInfoRequest request) { EmployeeInfoResponse response = new EmployeeInfoResponse(); if (request.ID == "1") { response.Id = "1"; response.Name = "Baljinder Singh"; } else if (request.ID == "2") { response.Id = "2"; response.Name = "Another Employee 2"; } return(Task.FromResult <EmployeeInfoResponse>(response)); }
/// <summary> /// 获取员工信息(包括合同信息) /// </summary> /// <param name="DingUserId"></param> /// <returns></returns> public EmployeeInfoResponse GetEmployeeInfoByEmpID(string EmpID) { EmployeeInfoResponse response = new EmployeeInfoResponse(); var cCHR_Employee = cCHR_EmployeeRepository.GetCCHR_Employee(EmpID); //response.DingUserID = DingUserId; response = cCHR_Employee.ToDTO(); //response.SigningType = cCHR_Employee.InCompanyDate.AddYears(10) < DateTime.Now?"无固定":"普通";//签约类型 response.DingUserID = userSyncRepository.GetUserSyncByEmpID(response.EmpID).UserID; var PositionRole = cCHR_EmployeePositionRoleRepository.GetCCHR_EmployeePositionRole(cCHR_Employee.EmpID); var Position = cCHR_PositionRepository.Get(PositionRole.PositionID); var Department = cCHR_DepartmentRepository.GetCCHR_Department(Position.DeptID); response.DeptID = Department.DeptID; response.DeptName = Department.DeptName; response.DeptFullName = Department.FullName; response.PositionID = Position.PositionID; response.PositionName = PositionRole.PositionName; return(response); }