Exemple #1
0
 public static bool ToMultiAccountExceptionDTO(MultiAccountException input, MultiAccountExceptionDTO output)
 {
     if (input == null)
     {
         return(false);
     }
     output.AccountId      = input.AccountId;
     output.ExceptionId    = input.ExceptionId;
     output.ExceptionLimit = input.ExceptionLimit;
     return(true);
 }
Exemple #2
0
        public MultiAccountExceptionDTO Insert(MultiAccountExceptionDTO exception)
        {
            try
            {
                using (OpenNosContext context = DataAccessHelper.CreateContext())
                {
                    MultiAccountException entity = new MultiAccountException();
                    context.MultiAccountException.Add(entity);
                    context.SaveChanges();
                    if (Mapper.Mappers.MultiAccountExceptionMapper.ToMultiAccountExceptionDTO(entity, exception))
                    {
                        return(exception);
                    }

                    return(null);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
                return(null);
            }
        }