Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 public static void CreateJobIndexCategory(IJobIndexRepository jobIndexRepository)
 {
     if (jobIndexCategory == null)
     {
         jobIndexCategory = new JobIndexCategory(jobIndexRepository.GetNextId(), null, "شاخص های شغل/فردی",
                                                 "JobIndexCategory");
         jobIndexRepository.Add(jobIndexCategory);
     }
 }
Ejemplo n.º 4
0
        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);
        }