public JobIndexCategory AddJobIndexCategory(AbstractJobIndexId parentId, string name, string dictionaryName) { try { using (var scope = new TransactionScope()) { var id = jobIndexRep.GetNextId(); JobIndexCategory parent = null; if (parentId != null) { parent = jobIndexRep.GetJobIndexCategory(new AbstractJobIndexId(parentId.Id)); } var jobIndexCategory = new JobIndexCategory(id, parent, name, dictionaryName); jobIndexRep.Add(jobIndexCategory); scope.Complete(); return(jobIndexCategory); } } catch (Exception exp) { var res = jobIndexRep.TryConvertException(exp); if (res == null) { throw; } throw res; } }
public JobIndexGroup AddJobIndexGroup(PeriodId periodId, AbstractJobIndexId parentId, string name, string dictionaryName) { try { using (var tr = new TransactionScope()) { var id = jobIndexRep.GetNextId(); var period = periodRep.GetById(periodId); JobIndexGroup parent = null; if (parentId != null) { parent = jobIndexRep.GetJobIndexGroupById(new AbstractJobIndexId(parentId.Id)); } var jobIndexGroup = new JobIndexGroup(id, period, parent, name, dictionaryName); jobIndexRep.Add(jobIndexGroup); tr.Complete(); return(jobIndexGroup); } } catch (Exception exp) { var res = jobIndexRep.TryConvertException(exp); if (res == null) { throw; } throw res; } }
public static JobIndexGroup CreateJobIndexGroup(IJobIndexRepository jobIndexRepository, string name, string dictionaryName) { var jobIndexGroup = new JobIndexGroup(jobIndexRepository.GetNextId(), Period, null, name, dictionaryName); jobIndexRepository.Add(jobIndexGroup); return(jobIndexGroup); }
public static void CreateJobIndex(IJobIndexRepository jobIndexRepository, string name, string dictionaryName, string group) { if (jobIndexCategory == null) { jobIndexCategory = new JobIndexCategory(jobIndexRepository.GetNextId(), null, "شاخص های شغل/فردی", "JobIndices"); jobIndexRepository.Add(jobIndexCategory); } var jobIndex = new JobIndex(jobIndexRepository.GetNextId(), jobIndexCategory, name, dictionaryName); jobIndex.AssignCustomFields(DefinedCustomFields.Where(dc => dc.EntityId == EntityTypeEnum.JobIndex).ToList()); jobIndexRepository.Add(jobIndex); JobIndices.Add(jobIndex, group); }
private void setInitData(Period period) { //todo:Damn fu.... very bad code for this section var behaviaralId = jobIndexRepository.GetNextId(); var behaviaralJobIndexGroup = new JobIndexGroup(behaviaralId, period, null, "شاخص های رفتاری", "BehaviouralGroup"); jobIndexRepository.Add(behaviaralJobIndexGroup); var performanceId = jobIndexRepository.GetNextId(); var performanceJobIndexGroup = new JobIndexGroup(performanceId, period, null, "شاخص های عملکردی", "PerformanceGroup"); jobIndexRepository.Add(performanceJobIndexGroup); var uniGroupId = unitIndexRepository.GetNextId(); var unitIndexGroup = new UnitIndexGroup(uniGroupId, period, null, "گروه شاخص های سازمانی", "OrganizationUnitGroup"); unitIndexRepository.Add(unitIndexGroup); }
public static void CreateJobIndexCategory(IJobIndexRepository jobIndexRepository) { if (jobIndexCategory == null) { jobIndexCategory = new JobIndexCategory(jobIndexRepository.GetNextId(), null, "شاخص های شغل/فردی", "JobIndexCategory"); jobIndexRepository.Add(jobIndexCategory); } }
public static void CreateJobIndex(IJobIndexRepository jobIndexRepository, PMSAdmin.Domain.Model.JobIndices.JobIndex adminJobIndex, JobIndexGroup jobIndexGroup, bool isInquireable, Dictionary <PMSAdmin.Domain.Model.CustomFieldTypes.CustomFieldType, string> customFieldsDictionary, long clacLevel) { var sharedJobIndex = new SharedJobIndex(new SharedJobIndexId(adminJobIndex.Id.Id), adminJobIndex.Name, adminJobIndex.DictionaryName); var jobIndex = new JobIndex(jobIndexRepository.GetNextId(), Period, sharedJobIndex, jobIndexGroup, isInquireable, clacLevel); var sharedCustomFieldsDic = customFieldsDictionary.ToDictionary( c => new SharedJobIndexCustomField(new SharedJobIndexCustomFieldId(c.Key.Id.Id), c.Key.Name, c.Key.DictionaryName, c.Key.MinValue, c.Key.MaxValue), c => c.Value); jobIndex.UpdateCustomFields(sharedCustomFieldsDic); jobIndexRepository.Add(jobIndex); jobIndices.Add(jobIndex); }