Beispiel #1
0
        public void ShowJobIndexGroupInPeriodView(JobIndexGroupInPeriodDTO jobIndexGroupInPeriod, ActionType action)
        {
            var view = ServiceLocator.Current.GetInstance <IJobIndexGroupInPeriodView>();

            ((JobIndexGroupInPeriodVM)view.ViewModel).Load(jobIndexGroupInPeriod, action);
            viewManager.ShowInDialog(view);
        }
Beispiel #2
0
 public override AbstractIndexInPeriodDTO MapToModel(AbstractJobIndex entity)
 {
     if (entity is JobIndex)
     {
         var res = new JobIndexInPeriodDTO()
         {
             Id               = entity.Id.Id,
             PeriodId         = entity.PeriodId.Id,
             Name             = ((JobIndex)entity).Name,
             DictionaryName   = ((JobIndex)entity).DictionaryName,
             ParentId         = ((JobIndex)entity).Group.Id.Id,
             JobIndexId       = ((JobIndex)entity).SharedJobIndexId.Id,
             IsInquireable    = ((JobIndex)entity).IsInquireable,
             CalculationLevel = ((JobIndex)entity).CalculationLevel,
             CalculationOrder = ((JobIndex)entity).CalculationOrder
         };
         return(res);
     }
     else
     {
         var res = new JobIndexGroupInPeriodDTO()
         {
             Id             = entity.Id.Id,
             PeriodId       = entity.PeriodId.Id,
             Name           = ((JobIndexGroup)entity).Name,
             DictionaryName = ((JobIndexGroup)entity).DictionaryName,
         };
         if (((JobIndexGroup)entity).Parent != null)
         {
             res.ParentId = ((JobIndexGroup)entity).Parent.Id.Id;
         }
         return(res);
     }
 }
Beispiel #3
0
 public JobIndexGroupInPeriodVM()
 {
     PeriodMgtAppLocalizedResources = new PeriodMgtAppLocalizedResources();
     init();
     JobIndexGroupInPeriod = new JobIndexGroupInPeriodDTO {
         Name = "دوره اول"
     };
 }
Beispiel #4
0
        public AbstractIndexInPeriodDTO AddJobIndexGroup(JobIndexGroupInPeriodDTO abstractIndex)
        {
            var jobIndexGroup = jobIndexService.AddJobIndexGroup(new PeriodId(abstractIndex.PeriodId),
                                                                 (abstractIndex.ParentId == null) ? null : new AbstractJobIndexId(abstractIndex.ParentId.Value),
                                                                 abstractIndex.Name, abstractIndex.DictionaryName);

            return(jobIndexMapper.MapToModel(jobIndexGroup));
        }
Beispiel #5
0
        public AbstractIndexInPeriodDTO UpdateJobIndexGroup(JobIndexGroupInPeriodDTO abstractIndex)
        {
            var jobIndexGroup = jobIndexService.UpdateJobIndexGroup(new AbstractJobIndexId(abstractIndex.Id)
                                                                    , (abstractIndex.ParentId.HasValue) ? new AbstractJobIndexId(abstractIndex.ParentId.Value) : null
                                                                    , abstractIndex.Name, abstractIndex.DictionaryName);

            return(jobIndexMapper.MapToModel(jobIndexGroup));
        }
Beispiel #6
0
 public void Load(JobIndexGroupInPeriodDTO jobIndexGroupInPeriodParam, ActionType actionTypeParam)
 {
     actionType            = actionTypeParam;
     JobIndexGroupInPeriod = jobIndexGroupInPeriodParam;
     //if (actionType == ActionType.ModifyPeriod)
     //{
     //    ShowBusyIndicator();
     //    jobIndexService.GetPeriod((res, exp) =>
     //        {
     //            HideBusyIndicator();
     //            if (exp == null)
     //                JobIndexGroupInPeriod = res;
     //            else
     //                appController.HandleException(exp);
     //        },
     //                            periodParam.Id);
     //}
 }
        public void DoAction(JobIndexInPeriodTreeVM vm)
        {
            var jobIndexGroupInPeriod = new JobIndexGroupInPeriodDTO
            {
                PeriodId = vm.Period.Id
            };

            if (vm.SelectedAbstractIndexInPeriod == null)
            {
                jobIndexGroupInPeriod.ParentId = null;
            }
            else
            {
                jobIndexGroupInPeriod.ParentId = vm.SelectedAbstractIndexInPeriod.Data.Id;
            }


            periodController.ShowJobIndexGroupInPeriodView(jobIndexGroupInPeriod, ActionType.AddJobIndexGroupInPeriod);
        }
Beispiel #8
0
        public void UpdateJobIndexGroupInPeriod(Action <JobIndexGroupInPeriodDTO, Exception> action, JobIndexGroupInPeriodDTO jobIndexGroupInPeriod)
        {
            var url = string.Format(baseAddress + makeApiAdress(jobIndexGroupInPeriod.PeriodId));

            WebClientHelper.Put(new Uri(url, PMSClientConfig.UriKind), action, jobIndexGroupInPeriod, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }
Beispiel #9
0
 private void init()
 {
     JobIndexGroupInPeriod = new JobIndexGroupInPeriodDTO();
     DisplayName           = PeriodMgtAppLocalizedResources.JobIndexGroupInPeriodViewTitle;
 }