Beispiel #1
0
        public static List <string> dealCodeXml(string sty, string _code, string _descript)
        {
            List <string> code_descrip = new List <string>();
            string        descrip_value = "", code_value = "";

            sty = sty.ToLower();
            string      startPath = Sh_ApplicationStartup.Application_Startup(Application.StartupPath); //因为错误编号和错误解释是放在软件运行路径下的,所以读取的时候需要路径,又是由mldnwl调用的,所以直接用 Application.StartupPath
            XmlDocument xd = new XmlDocument();                                                         //创建文档

            xd.Load(startPath + "\\ErrorCode_Description.xml");                                         //Data_errorcode); //加载文档
            if (xd.DocumentElement != null && xd.DocumentElement.Name == "ErrorCode_Description")
            {
                //if (sty.Length == 0)
                //{
                //    code_value = xd.SelectSingleNode("/ErrorCode_Description/_common/code").InnerText.ToString();
                //    descrip_value = xd.SelectSingleNode("/ErrorCode_Description/_common/descript").InnerText.ToString();
                //    code_descrip.Add(code_value);
                //    code_descrip.Add(descrip_value);
                //}
                if (sty.Length > 0)//(sty == "_http" || sty == "_sql" || sty == "_merge_add_tods")
                {
                    code_descrip = errorDescript(xd.OuterXml, sty + "s/" + sty, _code);
                    if (code_descrip.Count == 0)
                    {
                        code_descrip = new List <string>();
                        code_descrip = errorDescript(xd.OuterXml, "_keywords/_keyword", _code, _descript);
                    }
                }
                if (code_descrip.Count == 0)
                {
                    code_descrip  = new List <string>();
                    code_value    = xd.SelectSingleNode("/ErrorCode_Description/_commons/_common/code").InnerText.ToString();
                    descrip_value = xd.SelectSingleNode("/ErrorCode_Description/_commons/_common/descript").InnerText.ToString();
                    code_descrip.Add(code_value);
                    code_descrip.Add(descrip_value);
                }
            }
            else
            {
                code_descrip = new List <string>();
                code_descrip.Add("NotFoundFile");
                code_descrip.Add("没有找到安装路径下的错误代号、错误描述对照文件!");
            }
            return(code_descrip);
        }
Beispiel #2
0
        public string SystemBatchQuery_xml = "";                                                                       //SystemBatchQuery.xml
        public Sh_ReadXml(string _Application_Startup, string _Login_user_Data_Name, string _Login_user_Now_WareHouse) //whid是主货站好,whid_new是异地代办货站号
        {
            string Application_Startup = Sh_ApplicationStartup.Application_Startup(_Application_Startup);

            if (_Login_user_Data_Name != _Login_user_Now_WareHouse)
            {
                NowXmlBase  = Application_Startup + _Login_user_Now_WareHouse + "SystemParameterAdd.xml";
                XmlBase_set = Application_Startup + _Login_user_Now_WareHouse + "SystemParameterSet.xml";
            }
            else
            {
                NowXmlBase  = Application_Startup + _Login_user_Data_Name + "SystemParameterAdd.xml";
                XmlBase_set = Application_Startup + _Login_user_Data_Name + "SystemParameterSet.xml";
            }
            DataXmlBase     = Application_Startup + _Login_user_Data_Name + "SystemParameterAdd.xml";
            DataXmlBase_set = Application_Startup + _Login_user_Data_Name + "SystemParameterSet.xml";
            XmlBase_global  = Application_Startup + "\\SystemParameterAdd.xml";
            //Data_errorcode = Application_Startup + "ErrorCode_Description.xml";
            SystemBatchQuery_xml = Application_Startup + "\\SystemBatchQuery.xml";//分批查询对应的某功能最大查询数量,以及每页查询多少
        }