Exemple #1
0
 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;
     }
 }