示例#1
0
        public string GetInfoByErrorCode(int errorCode)
        {
            string info = "";

            try
            {
                FDBFileCheck();
#if true
                int           langId   = Thread.CurrentThread.CurrentUICulture.LCID;
                FbParameter[] fbParams = new FbParameter[4];
                fbParams[0]       = new FbParameter("@ERR_CODE", FbDbType.Integer);
                fbParams[0].Value = errorCode;
                fbParams[1]       = new FbParameter("@VENDER_ID", FbDbType.Integer);
                fbParams[1].Value = 0;
                fbParams[2]       = new FbParameter("@PID", FbDbType.Integer);
                fbParams[2].Value = 0;
                fbParams[3]       = new FbParameter("@LANG_ID", FbDbType.Integer);
                fbParams[3].Value = langId;

                var ret = firebird.ExecuteScalar(System.Data.CommandType.StoredProcedure, "GET_INFO_BY_CODE", fbParams);
                info = Convert.ToString(ret);
#else
                string sql = "SELECT * FROM ERROR_INFO WHERE 1=1";
                {
                    //int errCode;
                    //if (int.TryParse(errorCode, System.Globalization.NumberStyles.HexNumber, null, out errCode))
                    {
                        sql += " AND ERROR_CODE=" + errorCode;
                    }
                }
                DataTable tbErrorInfo = firebird.ExecuteDataTable(sql);
                info = tbErrorInfo.ToString();
#endif
            }
            catch (Exception ex)
            {
                info = "";
            }

            return(info);
        }