Exemple #1
0
 public JobIndex UpdateJobIndex(AbstractJobIndexId jobIndexId, AbstractJobIndexId categoryId, string name
                                , string dictionaryName, IList <CustomFieldTypeId> customFieldTypeIdList)
 {
     try
     {
         using (var scope = new TransactionScope())
         {
             if (categoryId == null)
             {
                 throw new ArgumentException("CategoryId is null");
             }
             var category             = jobIndexRep.GetJobIndexCategory(categoryId);
             var jobIndex             = jobIndexRep.GetJobIndex(jobIndexId);
             var jobIndexCustomFields = customFieldRep.GetAll(EntityTypeEnum.JobIndex)
                                        .Where(c => customFieldTypeIdList.Contains(c.Id)).ToList();
             jobIndex.Update(name, dictionaryName, category, jobIndexCustomFields);
             jobIndexRep.Update(jobIndex);
             scope.Complete();
             return(jobIndex);
         }
     }
     catch (Exception exp)
     {
         var res = jobIndexRep.TryConvertException(exp);
         if (res == null)
         {
             throw;
         }
         throw res;
     }
 }