Пример #1
0
        /// <summary>
        /// 获取待检列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetVehicleList()
        {
            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("jylsh");          //创建一个<Node>节点
                XmlElement xe3  = xmldoc.CreateElement("jyjgbh");         //创建一个<Node>节点
                XmlElement xe4  = xmldoc.CreateElement("hphm");           //创建一个<Node>节点
                XmlElement xe5  = xmldoc.CreateElement("hpzl");           //创建一个<Node>节点
                xe1.AppendChild(xe2);
                xe1.AppendChild(xe3);
                xe1.AppendChild(xe4);
                xe1.AppendChild(xe5);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetVehicleList_Send:  18R47\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectOut(Xtlb, Jkxlh, "18R47", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string code, msg;
                return(XmlOperation.ReadXmlToDatatable(receiveXml, out code, out msg));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleList_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// 获取平台时间
        /// </summary>
        /// <param name="babh"></param>
        /// <returns></returns>
        public DataTable GetSystemDatetime(string babh)
        {
            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("babh");           //创建一个<Node>节点
                xe2.InnerText = babh;
                xe1.AppendChild(xe2);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetSystemDatetime_Send: XTLB:" + Xtlb + "|JKXLH:" + Jkxlh + "|JKID:18C50\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectOut(Xtlb, Jkxlh, "18C50", Cjbh, Dwjgdm, Dwmc, Yhbz, Yhxm, Zdbs, send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string code, msg;
                return(XmlOperation.ReadXmlToDatatable(receiveXml, out code, out msg));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetSystemDatetime_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jylsh"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public DataTable GetTestResultBy18J17(string jylsh, out string code, out string message)
        {
            code    = "0";
            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("jylsh");          //创建一个<Node>节点
                xe2.InnerText = jylsh;
                xe1.AppendChild(xe2);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetTestResultBy18J17_Send:  18J17\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectOut(Xtlb, Jkxlh, "18J17", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                return(XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetTestResultBy18J17_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jylsh"></param>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="vin"></param>
        /// <param name="dt_waitcar_info"></param>
        /// <param name="error_msg"></param>
        /// <returns></returns>
        public bool getVehicleInfo(string jylsh, string hphm, string hpzl, string vin, out DataTable dt_waitcar_info, out string error_msg)
        {
            dt_waitcar_info = new DataTable();
            error_msg       = "";
            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 xe11 = xmldoc.CreateElement("jyjgbh");         //创建一个<Node>节点
                xe11.InnerText = station_id;
                XmlElement xe12 = xmldoc.CreateElement("jylsh");          //创建一个<Node>节点
                xe12.InnerText = jylsh;
                XmlElement xe13 = xmldoc.CreateElement("hphm");           //创建一个<Node>节点
                xe13.InnerText = XmlOperation.encodeUTF8(hphm);
                XmlElement xe14 = xmldoc.CreateElement("hpzl");           //创建一个<Node>节点
                xe14.InnerText = hpzl;
                XmlElement xe15 = xmldoc.CreateElement("clsbdh");         //创建一个<Node>节点
                xe15.InnerText = vin;
                XmlElement xe16 = xmldoc.CreateElement("sqip");           //创建一个<Node>节点
                xe16.InnerText = local_ip;

                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);
                xe1.AppendChild(xe15);
                xe1.AppendChild(xe16);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("getVehicleInfo_Send:   18R13\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(upload_interface.queryObjectOut(xtlb, jkxlh, "18R13", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string code, message;
                dt_waitcar_info = XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message);
                if (dt_waitcar_info != null && code == "1")
                {
                    return(true);
                }
                else
                {
                    IOControl.saveXmlLogInf("获取待检车辆信息失败:" + message + "\r\n");
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("getVehicleInfo_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="clsbdh"></param>
        /// <param name="dly"></param>
        /// <param name="dlysfzh"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public DataTable GetVehicleInfBy18J52(string hphm, string hpzl, string clsbdh, string dly, string dlysfzh, 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 = hphm;
                XmlElement xe3 = xmldoc.CreateElement("hpzl");            //创建一个<Node>节点
                if (hpzl.Contains("("))
                {
                    xe3.InnerText = hpzl.Split('(')[1].Split(')')[0];
                }
                else
                {
                    xe3.InnerText = hpzl;
                }
                XmlElement xe4 = xmldoc.CreateElement("clsbdh");  //创建一个<Node>节点
                xe4.InnerText = clsbdh;
                XmlElement xe5 = xmldoc.CreateElement("dly");     //创建一个<Node>节点
                xe5.InnerText = dly;
                XmlElement xe6 = xmldoc.CreateElement("dlysfzh"); //创建一个<Node>节点
                xe6.InnerText = dlysfzh;
                xe1.AppendChild(xe2);
                xe1.AppendChild(xe3);
                xe1.AppendChild(xe4);
                xe1.AppendChild(xe5);
                xe1.AppendChild(xe6);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetVehicleInfBy18J52_Send:  18J52\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectOut(Xtlb, Jkxlh, "18J52", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                return(XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleInfBy18J52_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Пример #6
0
        /// <summary>
        /// 101101——获取平台时间
        /// </summary>
        /// <param name="InternetTime">平台时间</param>
        /// <returns>是否成功获取</returns>
        public DataTable GetDatetime()
        {
            try
            {
                IOControl.saveXmlLogInf("GetDatetime_Send: 101101\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.UploadObjectOut(101101, "null", "null"));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string code, message;
                return(XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetDatetime_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Пример #7
0
        public bool getSystemTime(string babh, out string systime)
        {
            systime = "";
            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("babh");           //创建一个<Node>节点
                xe2.InnerText = babh;
                XmlElement xe3 = xmldoc.CreateElement("sqip");            //创建一个<Node>节点
                xe3.InnerText = local_ip;

                xe1.AppendChild(xe2);
                xe1.AppendChild(xe3);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("getSystemTime_Send:   18C50\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(upload_interface.queryObjectOut(xtlb, jkxlh, "18C50", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string    code, message;
                DataTable dt = XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message);
                if (dt != null && code == "1")
                {
                    systime = dt.Rows[0]["sj"].ToString();
                    return(true);
                }
                else
                {
                    IOControl.saveXmlLogInf("同步时间失败:" + message + "\r\n");
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("getSystemTime_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Пример #8
0
        /// <summary>
        /// 获取待检车辆信息
        /// </summary>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="clsbdh"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public DataTable GetVehicleInf(string hphm, string hpzl, string clsbdh, 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 = hphm;
                XmlElement xe3 = xmldoc.CreateElement("hpzl");            //创建一个<Node>节点
                xe3.InnerText = hpzl;
                XmlElement xe4 = xmldoc.CreateElement("clsbdh");          //创建一个<Node>节点
                xe4.InnerText = clsbdh;
                XmlElement xe5 = xmldoc.CreateElement("jyjgbh");          //创建一个<Node>节点
                xe5.InnerText = Jyjgbh;
                xe1.AppendChild(xe2);
                xe1.AppendChild(xe3);
                xe1.AppendChild(xe4);
                xe1.AppendChild(xe5);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetVehicleInf_Send: XTLB:" + Xtlb + "|JKXLH:" + Jkxlh + "|JKID:18S02\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectOut(Xtlb, Jkxlh, "18S02", Cjbh, Dwjgdm, Dwmc, Yhbz, Yhxm, Zdbs, send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                return(XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleInf_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Пример #9
0
        /// <summary>
        /// 18C50 同步系统时间
        /// </summary>
        /// <param name="babh">备案编号</param>
        /// <param name="sys_time">系统时间</param>
        /// <returns>是否成功</returns>
        public bool GetSystemDatetime(string babh, ref DateTime sys_time)
        {
            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("babh");           //创建一个<Node>节点
                xe2.InnerText = babh;
                xe1.AppendChild(xe2);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetSystemDatetime_Send:  XTLB:" + Xtlb + "|JKXLH:" + Jkxlh + "|JKID:18C50\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectOut(Xtlb, Jkxlh, "18C50", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string    code, message;
                DataTable dt = XmlOperation.ReadXmlToDatatable(receiveXml, out code, out message);
                if (dt.Rows.Count > 0)
                {
                    sys_time = DateTime.Parse(dt.Rows[0]["sj"].ToString());
                    return(true);
                }
                else
                {
                    IOControl.saveXmlLogInf("GetSystemDatetime_Send_Failed: \r\n" + message + "\r\n");
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetSystemDatetime_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Пример #10
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);
            }
        }