Exemplo n.º 1
0
 private void preLoad()
 {
     ShowBusyIndicator("در حال دریافت اطلاعات...");
     jobPositionInPeriodService.GetAllJobPositions(
         (res, exp) => appController.BeginInvokeOnDispatcher(() =>
     {
         if (exp == null)
         {
             JobPositionTree = SilverLightTreeViewHelper <JobPositionInPeriodDTO> .prepareListForTreeView(res);
             HideBusyIndicator();
         }
         else
         {
             HideBusyIndicator();
             appController.HandleException(exp);
         }
     }), Period.Id);
 }
Exemplo n.º 2
0
 private void getJobPositions(AutoResetEvent trigger)
 {
     jobPositionService.GetAllJobPositions((res, exp) => appController.BeginInvokeOnDispatcher(() =>
     {
         trigger.Set();
         if (exp == null)
         {
             appController.BeginInvokeOnDispatcher(() =>
             {
                 JobPositionList = res;
             });
         }
         else
         {
             appController.HandleException(exp);
         }
     }), Calculation.PeriodId);
 }
Exemplo n.º 3
0
        private void loadJobPositions()
        {
            ShowBusyIndicator("در حال دریافت اطلاعات");
            jobPositionService.GetAllJobPositions((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                HideBusyIndicator();
                if (exp == null)
                {
                    jobPositionInPeriodService.GetAllJobPositions((jobPositionInPeriods, exp1) => appController.BeginInvokeOnDispatcher(() =>
                    {
                        ParentJobPositions = new ObservableCollection <JobPositionInPeriodDTO>(jobPositionInPeriods);
                        //foreach (var jobPositionInPeriodDTO in jobPositionInPeriods)
                        //{
                        //    //if (jobPositionInPeriodDTO.Unitid == JobPositionInPeriod.UnitId)
                        //    //{
                        //        var modifiedJobPosition = jobPositionInPeriodDTO;
                        //        modifiedJobPosition.Name = jobPositionInPeriodDTO.Name + "-" + jobPositionInPeriodDTO.UnitName;
                        //        ParentJobPositions.Add(modifiedJobPosition);
                        //    //}

                        //}
                        if (actionType == ActionType.AddJobPositionInPeriod)
                        {
                            JobPositions =
                                res.Where(r => !jobPositionInPeriods.Select(j => j.JobPositionId).Contains(r.Id))
                                .ToList();
                        }
                        else
                        {
                            JobPositions = res;
                        }
                    }), jobPositionInPeriod.PeriodId);
                }

                else
                {
                    appController.HandleException(exp);
                }
            }));
        }