示例#1
0
        /// <summary>
        /// Add an execution error, with an error parameter.
        /// </summary>
        /// <param name="errCode"></param>
        /// <param name="paramKey"></param>
        /// <param name="paramValue"></param>
        /// <returns></returns>
        public ExprError AddErrorExec(ErrorCode errCode, string paramKey, string paramValue)
        {
            ExprError error = new ExprError();

            error.ErrorType = ErrorType.Exec;
            error.Code      = errCode;

            if (string.IsNullOrEmpty(paramKey))
            {
                paramKey = "Param1";
            }
            if (string.IsNullOrEmpty(paramValue))
            {
                paramKey = "(null)";
            }

            ErrorParam errorParam = new ErrorParam();

            errorParam.Key   = paramKey;
            errorParam.Value = paramValue;

            error.ListErrorParam.Add(errorParam);
            ListError.Add(error);
            return(error);
        }
示例#2
0
        public void AddParam(string key, string value)
        {
            ErrorParam errorParam = new ErrorParam();
            errorParam.Key = key;
            errorParam.Value = value;

            ListErrorParam.Add(errorParam);
        }
示例#3
0
        public static ExprError CreateError(ErrorCode errCode, string paramKey, string paramValue)
        {
            ExprError error = new ExprError();
            error.Code = errCode;


            if (string.IsNullOrEmpty(paramKey))
                paramKey = "Param1";
            if (string.IsNullOrEmpty(paramValue))
                paramKey = "(null)";

            ErrorParam errorParam = new ErrorParam();
            errorParam.Key = paramKey;
            errorParam.Value = paramValue;
            //error.Param = param;

            error.ListErrorParam.Add(errorParam);
            return error;
        }
示例#4
0
        public ExprError AddErrorExec(ErrorCode errCode, string paramKey, string paramValue, string paramKey2, string paramValue2)
        {
            ExprError error = AddErrorExec(errCode, paramKey, paramValue);

            if (string.IsNullOrEmpty(paramKey2))
            {
                paramKey = "Param2";
            }
            if (string.IsNullOrEmpty(paramValue2))
            {
                paramKey = "(null)";
            }

            ErrorParam errorParam = new ErrorParam();

            errorParam.Key   = paramKey2;
            errorParam.Value = paramValue2;

            error.ListErrorParam.Add(errorParam);
            return(error);
        }