示例#1
0
        //public void Load(JobInPrdField jobInPrdFieldParam, ActionType actionTypeParam)
        public void Load(long periodId, JobInPeriodDTO jobInPeriod, ActionType actionTypeParam)
        {
            if (jobInPeriod == null)
            {
                return;
            }

            actionType = actionTypeParam;
            preLoad(periodId);
            ShowBusyIndicator("در حال دریافت اطلاعات...");
            jobService.GetJob((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                HideBusyIndicator();
                if (exp == null)
                {
                    Job = res;
                    JobCustomFieldDescriptionList = new List <AbstractCustomFieldDescriptionDTO>(Job.CustomFields
                                                                                                 .Select(f => new AbstractCustomFieldDescriptionDTO()
                    {
                        Name = f.Name, Id = f.Id
                    }).ToList());

                    jobCustomFieldDescriptionList.Where(allFields => jobInPeriod.CustomFields.Select(f => f.Id).Contains(allFields.Id))
                    .ToList()
                    .ForEach(field => field.IsChecked = true);
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), jobInPeriod.JobId);
        }
示例#2
0
        private JobDTO GetJob(long ID)
        {
            JobDTO Result = new JobDTO();

            jobService.GetJob((res, exp) =>
            {
                if (exp == null)
                {
                    //System.Threading.Thread.Sleep(100);
                    Result = res;
                }
                else
                {
                    throw new Exception("Error in Get Job From Repository!");
                }
            }, ID);

            return(Result);
        }
示例#3
0
 public void DoAction(JobListVM vm)
 {
     jobService.GetJob((res, exp) => pmsController.BeginInvokeOnDispatcher(() =>
     {
         if (exp == null)
         {
             if (res != null)
             {
                 basicInfoController.ShowJobView(res, ActionType.ModifyJob);
             }
             else
             {
                 pmsController.ShowMessage("اطلاعات شغل جهت ارسال به صفحه ویرایش معتبر نمی باشد");
             }
         }
         else
         {
             pmsController.HandleException(exp);
         }
     }), vm.SelectedJob.Id);
 }
示例#4
0
文件: JobVM.cs 项目: mehabadi/HPMS
 public void Load(JobDTO jobParam, ActionType actionTypeParam)
 {
     actionType = actionTypeParam;
     if (actionType == ActionType.ModifyJob)
     {
         ShowBusyIndicator();
         jobService.GetJob((res, exp) => appController.BeginInvokeOnDispatcher(() =>
         {
             HideBusyIndicator();
             if (exp == null)
             {
                 Job = res;
             }
             else
             {
                 appController.HandleException(exp);
             }
         }),
                           jobParam.Id);
     }
 }