public void Load(JobIndexInPeriodDTO jobIndexInPeriodParam, ActionType actionTypeParam) { actionType = actionTypeParam; JobIndexInPeriod = jobIndexInPeriodParam; if (actionType == ActionType.ModifyJobIndexInPeriod) { JobIndexIsReadOnly = false; ShowBusyIndicator("در حال دریافت اطلاعات..."); jobIndexService.GetJobIndex((res, exp) => appController.BeginInvokeOnDispatcher(() => { HideBusyIndicator(); if (exp == null) { JobIndexList = new List <JobIndexDTO>() { res }; SelectedJobIndex = res; } else { appController.HandleException(exp); } }), JobIndexInPeriod.JobIndexId); } else { preLoad(); } }
public void ConvertJobIndex(Period period) { Console.WriteLine("Starting job index convert progress..."); var jobIndexInperiodList = new List <JobIndexInPeriodDTO>(); var jobIndexList = new List <JobIndexDTO>(); var sourceJobIndexListId = jobIndexDataProvider.GetJobIndexListId(); foreach (var sourceJobIndexId in sourceJobIndexListId) { var sourceJobIndexDTO = jobIndexDataProvider.GetBy(sourceJobIndexId); var jobIndexWithCf = jobIndexService.GetByTransferId(sourceJobIndexDTO.TransferId); if (jobIndexWithCf == null) { var desJobIndexDTO = createDestinationJobIndex(sourceJobIndexDTO); var jobIndexWithOutCf = jobIndexService.AddJobIndex(desJobIndexDTO); jobIndexWithCf = jobIndexService.GetJobIndex(jobIndexWithOutCf.Id); } jobIndexList.Add(jobIndexWithCf); var periodJobIndexDTO = createPeriodJobIndexDTO(jobIndexWithCf, period, sourceJobIndexDTO); periodJobIndexDTO.CustomFields[0].Value = sourceJobIndexDTO.Coefficient.ToString(); var res = jobIndexAssignmentService.AddJobIndexInPeriod(periodJobIndexDTO); jobIndexInperiodList.Add(res); Console.WriteLine("Job index convert progress state: " + jobIndexInperiodList.Count + " From " + sourceJobIndexListId.Count); } publisher.Publish(new JobIndexConverted(jobIndexInperiodList, jobIndexList)); }
public void DoAction(JobIndexTreeVM vm) { jobIndexService.GetJobIndex((res, exp) => pmsController.BeginInvokeOnDispatcher(() => { if (exp == null) { if (res != null) { basicInfoController.ShowJobIndexView(res, ActionType.ModifyJobIndex); } else { pmsController.ShowMessage("اطلاعات فیلد جهت ارسال به صفحه ویرایش معتبر نمی باشد"); } } else { pmsController.HandleException(exp); } }), vm.SelectedJobIndex.Data.Id); }