Exemplo n.º 1
0
 public override AbstractIndex MapToModel(AbstractJobIndex entity)
 {
     if (entity is JobIndex)
     {
         var res = new JobIndexDTO()
         {
             Id             = entity.Id.Id,
             Name           = entity.Name,
             DictionaryName = entity.DictionaryName,
             TransferId     = entity.TransferId,
             ParentId       = ((JobIndex)entity).Category.Id.Id,
         };
         return(res);
     }
     else
     {
         var res = new JobIndexCategoryDTO()
         {
             Id             = entity.Id.Id,
             Name           = entity.Name,
             DictionaryName = entity.DictionaryName,
         };
         if (((JobIndexCategory)entity).Parent != null)
         {
             res.ParentId = ((JobIndexCategory)entity).Parent.Id.Id;
         }
         return(res);
     }
 }
Exemplo n.º 2
0
        private JobIndexDTO createDestinationJobIndex(JobIndexIntegrationDTO sourceJobIndex)
        {
            var res = new JobIndexDTO
            {
                Name         = sourceJobIndex.Title,
                ParentId     = PMSCostantData.JobIndexCategoryId,
                CustomFields = new List <CustomFieldDTO>
                {
                    new CustomFieldDTO
                    {
                        Id             = PMSCostantData.JobIndexFieldId,
                        Name           = "اهمیت",
                        DictionaryName = "JobIndexCustomFieldCoefficient ",
                        EntityId       = 1,
                        MaxValue       = 10,
                        MinValue       = 1,
                        TypeId         = "string",
                    }
                },
                DictionaryName = sourceJobIndex.TransferId.ToString(),
                TransferId     = sourceJobIndex.TransferId
            };

            return(res);
        }
Exemplo n.º 3
0
        public void ShowJobIndexCustomFieldManageView(JobIndexDTO jobIndex, ActionType action)
        {
            var view = ServiceLocator.Current.GetInstance <IJobIndexCustomFieldManageView>();

            ((JobIndexCustomFieldManageVM)view.ViewModel).Load(jobIndex, action);
            viewManager.ShowInDialog(view);
        }
Exemplo n.º 4
0
        private async Task <int> GetExclusiveJobIndexesAsync(PeriodDTO periodDto)
        {
            var ExclusiveIndexesList = jobIndexDataProvider.GetExclusiveJobIndexes();

            foreach (var TempExclusiveIndex in ExclusiveIndexesList)
            {
                //var personDetail = employeeDataProvider.GetEmployeeDetails(id);
                var desExclusiveJobIndex = new JobIndexDTO();
                desExclusiveJobIndex.Name = TempExclusiveIndex.IndexTitle;

                desExclusiveJobIndex.CustomFields = new List <CustomFieldDTO>();

                jobIndexService.AddJobIndex(
                    (r, e) =>
                {
                    if (e != null)
                    {
                        throw new Exception("Error In Exclusive Job Indexes Converting");
                    }
                    ProgressCount++;
                }, desExclusiveJobIndex);
                //System.Threading.Thread.Sleep(500);
            }
            return(ProgressCount);
        }
Exemplo n.º 5
0
 public JobIndexCustomFieldManageVM()
 {
     BasicInfoAppLocalizedResources = new BasicInfoAppLocalizedResources();
     init();
     JobIndex = new JobIndexDTO {
         Name = "شغل یک"
     };
 }
Exemplo n.º 6
0
        public AbstractIndex UpdateJobIndex(JobIndexDTO jobIndexDto)
        {
            var jobIndex = jobIndexService.UpdateJobIndex(new AbstractJobIndexId(jobIndexDto.Id)
                                                          , new AbstractJobIndexId(jobIndexDto.ParentId.Value), jobIndexDto.Name, jobIndexDto.DictionaryName
                                                          , jobIndexDto.CustomFields.Select(c => new CustomFieldTypeId(c.Id)).ToList()
                                                          );

            return(jobIndexMapper.MapToModel(jobIndex));
        }
Exemplo n.º 7
0
        public void DoAction(JobIndexTreeVM vm)
        {
            var jobIndex = new JobIndexDTO();

            if (vm.SelectedJobIndex != null)
            {
                jobIndex.ParentId = vm.SelectedJobIndex.Data.Id;
            }
            basicInfoController.ShowJobIndexView(jobIndex, ActionType.AddJobIndex);
        }
Exemplo n.º 8
0
 public JobIndexVM(IJobIndexServiceWrapper jobIndexService,
                   ICustomFieldServiceWrapper customFieldService,
                   IPMSController appController,
                   IBasicInfoAppLocalizedResources basicInfoAppLocalizedResources)
 {
     this.jobIndexService           = jobIndexService;
     this.customFieldService        = customFieldService;
     this.appController             = appController;
     BasicInfoAppLocalizedResources = basicInfoAppLocalizedResources;
     JobIndex    = new JobIndexDTO();
     DisplayName = BasicInfoAppLocalizedResources.JobIndexViewTitle;
 }
Exemplo n.º 9
0
 public void Load(JobIndexDTO jobIndexParam, ActionType actionTypeParam)
 {
     actionType = actionTypeParam;
     JobIndex   = jobIndexParam;
     ShowBusyIndicator();
     customFieldService.GetAllCustomFieldsDescription((res, exp) => appController.BeginInvokeOnDispatcher(() =>
     {
         if (exp == null)
         {
             JobIndexCustomFieldDescriptionList = res;
             if (actionType == ActionType.ManageJobIndexCustomFields)
             {
                 setCurrentJobCustomFields();
             }
             HideBusyIndicator();
         }
         else
         {
             HideBusyIndicator();
             appController.HandleException(exp);
         }
     }), "JobIndex");
 }
Exemplo n.º 10
0
        private JobIndexInPeriodDTO createPeriodJobIndexDTO(JobIndexDTO jobIndex, Period period,
                                                            JobIndexIntegrationDTO sourceJobIndexDTO)
        {
            var res = new JobIndexInPeriodDTO
            {
                //todo: Kharabe

                CalculationOrder = 1,
                IsInquireable    = true,
                Name             = jobIndex.Name,
                DictionaryName   = jobIndex.DictionaryName,
                JobIndexId       = jobIndex.Id,
                PeriodId         = period.Id,
                CustomFields     = jobIndex.CustomFields.Select(c => new AbstractCustomFieldDescriptionDTO
                {
                    Id    = c.Id,
                    Name  = "fake",
                    Value = "1"
                }).ToList()
            };

            if (sourceJobIndexDTO.IndexType == PMSIntegrationCoreConstantData.IntegrationBehaviaralJobIndexId)
            {
                res.ParentId         = PMSCostantData.JobIndexGroupBehaviaral;
                res.CalculationLevel = 1;
            }
            else if (sourceJobIndexDTO.IndexType == PMSIntegrationCoreConstantData.IntegrationPerformanceJobIndexId)
            {
                res.ParentId         = PMSCostantData.JobIndexGroupPerformance;
                res.CalculationLevel = 2;
            }
            else
            {
                throw new Exception("Invalid index type in source job index (employee management system)");
            }
            return(res);
        }
Exemplo n.º 11
0
 private void init()
 {
     JobIndex    = new JobIndexDTO();
     DisplayName = BasicInfoAppLocalizedResources.JobIndexCustomFieldManageViewTitle;
 }
Exemplo n.º 12
0
        public void UpdateJobIndex(Action <JobIndexDTO, Exception> action, JobIndexDTO jobIndex)
        {
            var url = string.Format(apiAddress + "?Id=" + jobIndex.Id);

            WebClientHelper.Put(new Uri(url, UriKind.Absolute), action, jobIndex, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }
Exemplo n.º 13
0
        public void AddJobIndex(Action <JobIndexDTO, Exception> action, JobIndexDTO jobIndex)
        {
            var url = string.Format(apiAddress);

            WebClientHelper.Post(new Uri(url, PMSClientConfig.UriKind), action, jobIndex, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }
Exemplo n.º 14
0
 public JobIndexVM()
 {
     JobIndex = new JobIndexDTO {
         Name = "شاخص یک", DictionaryName = "JobIndex1"
     };
 }
Exemplo n.º 15
0
 public void Load(JobIndexDTO jobIndexParam, ActionType actionTypeParam)
 {
     actionType = actionTypeParam;
     JobIndex   = jobIndexParam;
 }
Exemplo n.º 16
0
 public JobIndexDTO AddJobIndex(JobIndexDTO jobIndex)
 {
     return(IntegrationHttpClient.Post <JobIndexDTO, JobIndexDTO>(apiUri, endpoint, jobIndex));
     //var url = string.Format(apiAddress);
     //IntegrationWebClient.Post(new Uri(url, PMSClientConfig.UriKind), action, jobIndex, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
 }