예제 #1
0
        private void save()
        {
            if (!jobPositionInPeriod.Validate())
            {
                return;
            }

            ShowBusyIndicator();
            if (actionType == ActionType.AddJobPositionInPeriod)
            {
                jobPositionInPeriodService.AddJobPositionInPeriod((res, exp) => appController.BeginInvokeOnDispatcher(() =>
                {
                    HideBusyIndicator();
                    if (exp != null)
                    {
                        appController.HandleException(exp);
                    }
                    else
                    {
                        FinalizeAction();
                    }
                }), jobPositionInPeriod);
            }
            else if (actionType == ActionType.ModifyJobPositionInPeriod)
            {
                jobPositionInPeriodService.UpdateJobPositionInPeriod((res, exp) => appController.BeginInvokeOnDispatcher(() =>
                {
                    HideBusyIndicator();
                    if (exp != null)
                    {
                        appController.HandleException(exp);
                    }
                    else
                    {
                        FinalizeAction();
                    }
                }), jobPositionInPeriod);
            }
        }
예제 #2
0
        private void convertJobPosition_Rec(JobPositionIntegrationDTO sourceJobPositionDTO, long periodId, long?jobPositionParentIdParam)
        {
            var jobPosition = jobPositionService.GetByTransferId(sourceJobPositionDTO.TransferId);

            if (jobPosition == null)
            {
                var desJobPositionDTO = createDestinationJobPosition(sourceJobPositionDTO);
                jobPosition = jobPositionService.AddJobPosition(desJobPositionDTO);
            }
            var unit = unitList.Single(u => sourceJobPositionDTO.UnitIntegrationDTO.TransferId == u.TransferId);
            var job  = jobInPeriodList.Single(u => sourceJobPositionDTO.JobIntegrationDto.TransferId == u.TransferId);
            var jobPositionInPriodAssignment = createDestinationJobPositionInPeriod(jobPosition, periodId, unit.Id, job.Id, jobPositionParentIdParam);
            var res = jobPositionInPeriodServiceWrapper.AddJobPositionInPeriod(jobPositionInPriodAssignment);

            jobPositionList.Add(jobPosition);
            var jobPositionDataChildIdList = jobPositionDataProvider.GetChildIDs(sourceJobPositionDTO.ID);

            foreach (var jobPositionDataChildId in jobPositionDataChildIdList)
            {
                var jobPositiondataChid = jobPositionDataProvider.GetJobPositionDetail(jobPositionDataChildId);
                convertJobPosition_Rec(jobPositiondataChid, periodId, res.JobPositionId);
            }
            Console.WriteLine("JobPosition convert progress state: " + jobPositionList.Count + " From " + totalJobPositionsCount.ToString());
        }