示例#1
0
        public InquiryFormByIndexDTO GetInquiryFormByIndex(long periodId, string inquirerEmployeeNo, long jobIndexId)
        {
            List <InquiryJobIndexPoint> inquryJobIndexPoints =
                inquiryService.GetAllInquiryJobIndexPointByIndex(new PeriodId(periodId), new EmployeeId(inquirerEmployeeNo, new PeriodId(periodId)), new AbstractJobIndexId(jobIndexId));
            var inquiryForm = new InquiryFormByIndexDTO
            {
                PeriodId           = periodId,
                JobIndexId         = jobIndexId,
                InquirerEmployeeNo = inquirerEmployeeNo
            };

            inquiryForm.EmployeeValueList = new List <EmployeeValueDTO>();
            foreach (var inquiryJobIndexPoint in inquryJobIndexPoints)
            {
                var inquirerJobPositionId       = inquiryJobIndexPoint.ConfigurationItemId.InquirerJobPositionId;
                var inquirerJobposition         = jobPositionRepository.GetBy(inquirerJobPositionId);
                var inquirySubjectId            = inquiryJobIndexPoint.ConfigurationItemId.InquirySubjectId;
                var inquirySubject              = employeeRepository.GetBy(inquirySubjectId);
                var inquirySubjectJobpositionId = inquiryJobIndexPoint.ConfigurationItemId.InquirySubjectJobPositionId;
                var inquirySubjectJobposition   = jobPositionRepository.GetBy(inquirySubjectJobpositionId);
                inquiryForm.EmployeeValueList.Add(new EmployeeValueDTO
                {
                    InquireEmployeeNo       = inquiryJobIndexPoint.ConfigurationItemId.InquirerId.EmployeeNo,
                    InquirerJobPositionId   = inquirerJobPositionId.SharedJobPositionId.Id,
                    InquirerJobPositionName = inquirerJobposition.Name,
                    EmployeeNo      = inquirySubject.Id.EmployeeNo,
                    FullName        = inquirySubject.FirstName + " " + inquirySubject.LastName,
                    JobPositionId   = inquirySubjectJobpositionId.SharedJobPositionId.Id,
                    JobPositionName = inquirySubjectJobposition.Name,
                    IndexValue      = inquiryJobIndexPoint.JobIndexValue
                });
            }
            return(inquiryForm);
        }