Beispiel #1
0
        public DataTable GetVehicleInf(string hphm, string hpzl, out string code, out string message)
        {
            code    = "";
            message = "";
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");        //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("QueryCondition"); //创建一个<Node>节点
                XmlElement xe2  = xmldoc.CreateElement("hphm");           //创建一个<Node>节点
                xe2.InnerText = XmlOperation.encodeGBK(hphm);
                XmlElement xe3 = xmldoc.CreateElement("hpzl");            //创建一个<Node>节点
                xe3.InnerText = hpzl;
                XmlElement xe4 = xmldoc.CreateElement("bm");              //创建一个<Node>节点
                xe4.InnerText = "gbk";
                xe1.AppendChild(xe2);
                xe1.AppendChild(xe3);
                xe1.AppendChild(xe4);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringGBK(xmldoc);
                IOControl.saveXmlLogInf("GetVehicleInf_Send:  Xtlb:" + Xtlb + "|Jkid:18C91|Yhdh:" + Yhdh + "|Jkxh:" + Jkxh + "\r\n" + send_xml + "\r\n");

                StringBuilder receiveXml = new StringBuilder();
                receiveXml.Length = 10240;
                gxDll.queryObjectOut(Xtlb, "18C91", send_xml, Yhdh, Jkxh, receiveXml);
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml.ToString() + "\r\n");

                return(XmlOperation.ReadXmlToDatatable(receiveXml.ToString(), out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleInf_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }