private void addInquirer() { if (SelectedEmployee == null || SelectedInquirySubjectWithInquirers.CustomInquirers.Select(c => c.EmployeeNo).Contains(SelectedEmployee.PersonnelNo)) { return; } employeeService.GetEmployeeJobPositionsInPeriod((res, exp) => appController.BeginInvokeOnDispatcher(() => { if (exp == null) { foreach (var jobPosition in res.EmployeeJobPositionAssignmentList) { var customInquirer = new InquirerDTO() { EmployeeNo = SelectedEmployee.PersonnelNo, FullName = SelectedEmployee.FirstName + " " + SelectedEmployee.LastName, EmployeeJobPositionId = jobPosition.JobPositionId, EmployeeJobPositionName = jobPosition.JobPositionName }; if (!SelectedInquirySubjectWithInquirers.Inquirers.Any(r => r.EmployeeNo == customInquirer.EmployeeNo && r.EmployeeJobPositionId == customInquirer.EmployeeJobPositionId) && !SelectedInquirySubjectWithInquirers.CustomInquirers.Any(r => r.EmployeeNo == customInquirer.EmployeeNo && r.EmployeeJobPositionId == customInquirer.EmployeeJobPositionId)) { SelectedInquirySubjectWithInquirers.CustomInquirers.Add(customInquirer); } } } else { appController.HandleException(exp); } }), SelectedEmployee.PersonnelNo, period.Id); }
private void getEmployeeJobPositions() { employeeService.GetEmployeeJobPositionsInPeriod((res, exp) => appController.BeginInvokeOnDispatcher(() => { if (exp == null) { EmployeeJobPositions = res; if (EmployeeJobPositions.EmployeeJobPositionAssignmentList == null) { EmployeeJobPositions.EmployeeJobPositionAssignmentList = new ObservableCollection <EmployeeJobPositionAssignmentDTO>(); } } else { appController.HandleException(exp); } }), employee.PersonnelNo, period.Id); }