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); }
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); }