Beispiel #1
0
        /// <summary>
        /// QC Issue # 2123
        /// will retrieve the Ref_ExceptionError.BusinessDescription column value given the Ref_Exception.ExceptionErrorCode
        /// from the logging database and add it to the List.
        /// </summary>
        /// <param name="repsonseMessageList">List that the exception error will be added to.</param>
        /// <param name="exceptionErrorCode">value corresponding to the Ref_ExceptionError.ExceptionErrorCode in the logging database</param>
        /// <param name="messageArgumentList">String Array holding the the message mrguments </param>
        /// <returns>Boolean - true/message added, false/failed to add message to list, instead "No Description Found" error was added </returns>
        public bool AddMessage(ResponseMessageList responseMessageList, string exceptionErrorCode, params object[] messageArgumentList)
        {
            Log.Debug("Entering AddMessage() ...");
            bool            success = true;
            ResponseMessage responseMessage;

            string description = GetExceptionDescriptionByErrorCode(exceptionErrorCode);

            if (description == null)
            {
                Log.Error("IErrorLookupHelper.GetExceptionDescriptionByErrorCode returned an null description.");
                string Msg = String.Format("No Description Found for exception Error Code {0} ", exceptionErrorCode);
                responseMessage = new ResponseMessage(Msg);

                success = false;
            }
            else
            {
                String formatMsg;
                formatMsg       = String.Format(description, messageArgumentList);
                responseMessage = new ResponseMessage(exceptionErrorCode, formatMsg);
            }

            responseMessageList.Add(responseMessage);

            return(success);
        }
Beispiel #2
0
        /// <summary>
        /// QC Issue # 2123
        /// will retrieve the Ref_ExceptionError.BusinessDescription column value given the Ref_Exception.ExceptionErrorCode
        /// from the logging database and add it to the List.
        /// </summary>
        /// <param name="repsonseMessageList">List that the exception error will be added to.</param>
        /// <param name="messageDetails">string which contains the message details to be added to the response message list</param>
        /// <returns>Boolean - true/message added, false/failed to add message to list, instead "No Description Found" error was added </returns>
        public bool AddMessageDetails(ResponseMessageList responseMessageList, string messageDetails)
        {
            Log.Debug("Entering AddMessage() ...");
            bool            success = true;
            ResponseMessage responseMessage;

            if (messageDetails == String.Empty)
            {
                Log.Error("message Details Argument is empty.");
                string Msg = String.Format("Message Details argument is empty. ");
                responseMessage = new ResponseMessage(Msg);
                success         = false;
            }
            else
            {
                responseMessage = new ResponseMessage(messageDetails);
            }


            responseMessageList.Add(responseMessage);

            return(success);
        }