Example #1
0
 public BusinessExceptionDto(BusinessExceptionEnum type, string message, string error, string stackTrace)
 {
     ExceptionType = type;
     Message       = message;
     StackTrace    = stackTrace;
     Error         = error;
 }
Example #2
0
 public ExceptionNotifierViewModel(string message, string stackTrace, BusinessExceptionEnum type)
 {
     View               = new ExceptionNotifierView();
     ExceptionMsg       = message;
     ExceptionCallStack = stackTrace;
     ExceptionType      = type;
     View.DataContext   = this;
     ImageFilePath      = GetImagePath(type);
     TitleMessage       = GetTitleMessage(type);
     View.ShowDialog();
 }
Example #3
0
        private static string GetImagePath(BusinessExceptionEnum type)
        {
            switch (type)
            {
            case BusinessExceptionEnum.Default:
            case BusinessExceptionEnum.Operational:
                return(@"\Resources\Images\Exception.png");

            case BusinessExceptionEnum.Validation:
                return(@"\Resources\Images\Warning.png");

            default:
                throw new ApplicationException("Invalid exception type was passed, image could not be found");
            }
        }
Example #4
0
        private static string GetTitleMessage(BusinessExceptionEnum type)
        {
            switch (type)
            {
            case BusinessExceptionEnum.Default:
            case BusinessExceptionEnum.Operational:
                return("Exception Message");

            case BusinessExceptionEnum.Validation:
                return("Warning/Validation Message");

            default:
                throw new ApplicationException("Invalid exception type was passed, image could not be found");
            }
        }
 public BusinessException(BusinessExceptionEnum type, string message)
     : base(message)
 {
     ExceptionType = type;
 }
Example #6
0
 public BusinessException(BusinessExceptionEnum businessExceptionType, string message)
     : base(message)
 {
     ExceptionType = businessExceptionType;
 }
 public BusinessExceptionDto(BusinessExceptionEnum type, string message, string stackTrace)
 {
     ExceptionType = type;
     Message = message;
     StackTrace = stackTrace;
 }