private void save() { employeeService.AssignJobPositionsToEmployee((res, exp) => appController.BeginInvokeOnDispatcher(() => { if (exp == null) { EmployeeJobPositions = EmployeeJobPositions; appController.ShowMessage("عملیات با موفقیت انجام شد"); OnRequestClose(); } else { appController.HandleException(exp); } }), Period.Id, Employee.PersonnelNo, EmployeeJobPositions); }
public void ConvertEmployees(Period period, List <JobPositionDTO> jobPositionInPeriodList) { Console.WriteLine("Starting employees Convert progress..."); jobPositionList = jobPositionInPeriodList; var employeeIdList = employeeDataProvider.GetIds(); totalEmployeesCount = employeeIdList.Count; foreach (var id in employeeIdList) { var sourceEmployeeDTO = employeeDataProvider.GetEmployeeDetails(id); var desEmployeeDTO = createDestinationEmployee(sourceEmployeeDTO, period); var employee = employeeService.AddEmployee(desEmployeeDTO); var jobPosition = jobPositionList.Single(c => c.TransferId == sourceEmployeeDTO.JobPositionTransferId); var employeeJobPositionDTO = createEmployeeJobPositionDTO(period, employee, jobPosition);//Selected jobPosition employeeService.AssignJobPositionsToEmployee(period.Id, employee.PersonnelNo, employeeJobPositionDTO); employeeList.Add(employee); Console.WriteLine("Employee convert progress state: " + employeeList.Count + " From " + totalEmployeesCount); } publisher.Publish(new EmployeeConverted(employeeList)); }