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); } }
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); }
public void ShowJobIndexCustomFieldManageView(JobIndexDTO jobIndex, ActionType action) { var view = ServiceLocator.Current.GetInstance <IJobIndexCustomFieldManageView>(); ((JobIndexCustomFieldManageVM)view.ViewModel).Load(jobIndex, action); viewManager.ShowInDialog(view); }
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); }
public JobIndexCustomFieldManageVM() { BasicInfoAppLocalizedResources = new BasicInfoAppLocalizedResources(); init(); JobIndex = new JobIndexDTO { Name = "شغل یک" }; }
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)); }
public void DoAction(JobIndexTreeVM vm) { var jobIndex = new JobIndexDTO(); if (vm.SelectedJobIndex != null) { jobIndex.ParentId = vm.SelectedJobIndex.Data.Id; } basicInfoController.ShowJobIndexView(jobIndex, ActionType.AddJobIndex); }
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; }
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"); }
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); }
private void init() { JobIndex = new JobIndexDTO(); DisplayName = BasicInfoAppLocalizedResources.JobIndexCustomFieldManageViewTitle; }
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)); }
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)); }
public JobIndexVM() { JobIndex = new JobIndexDTO { Name = "شاخص یک", DictionaryName = "JobIndex1" }; }
public void Load(JobIndexDTO jobIndexParam, ActionType actionTypeParam) { actionType = actionTypeParam; JobIndex = jobIndexParam; }
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)); }