123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Text;
- using cognosdotnet_10_2;
- namespace SamplesCommon
- {
-
-
-
-
- public class HeaderExceptionHelper
- {
- private CAMException _exception = null;
-
-
-
-
- public HeaderExceptionHelper( contentManagerService1 cmService )
- {
-
- _exception = cmService.biBusHeaderValue.CAM.exception;
- }
-
-
-
- public string Severity {
- get {
- return _exception.severity.ToString();
- }
- }
-
-
-
- public string ErrorCode {
- get {
- return _exception.errorCodeString;
- }
- }
-
-
-
- public string[] Details {
- get {
- string[] retval = new string[_exception.messages.Length];
- for( int idx = 0; idx < _exception.messages.Length; idx++ ) {
- retval[idx] = _exception.messages[idx].messageString;
- }
- return retval;
- }
- }
-
-
-
-
- public promptInfo PromptInfo {
- get {
- return _exception.promptInfo;
- }
- }
-
-
-
-
- public override string ToString() {
- StringBuilder str = new StringBuilder();
-
- str.AppendFormat( "Severity: {0}\n", Severity );
- str.AppendFormat( "ErrorCode: {0}\n", ErrorCode );
- str.AppendFormat( "Details:\n" );
- foreach( string s in Details ) {
- str.AppendFormat( "\t{0}\n", s );
- }
- return str.ToString();
- }
-
-
-
-
-
-
-
-
- static public string ConvertToString( contentManagerService1 cmService ) {
- HeaderExceptionHelper exception = new HeaderExceptionHelper( cmService );
- return exception.ToString();
- }
- }
- }
|