public JobIndexCategory UpdateJobIndexCategory(AbstractJobIndexId jobIndexCatId, AbstractJobIndexId parentId, string name, string dictionaryName) { //todo:(medium)Update not working try { using (var scope = new TransactionScope()) { JobIndexCategory parent = null; if (parentId != null) { parent = jobIndexRep.GetJobIndexCategory(parentId); } var jobIndexCategory = new JobIndexCategory(jobIndexCatId, parent, name, dictionaryName); jobIndexRep.Update(jobIndexCategory); scope.Complete(); return(jobIndexCategory); } } catch (Exception exp) { var res = jobIndexRep.TryConvertException(exp); if (res == null) { throw; } throw res; } }
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 static void CreateJobIndexCategory(IJobIndexRepository jobIndexRepository) { if (jobIndexCategory == null) { jobIndexCategory = new JobIndexCategory(jobIndexRepository.GetNextId(), null, "شاخص های شغل/فردی", "JobIndexCategory"); jobIndexRepository.Add(jobIndexCategory); } }
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); }