Esempio n. 1
0
        /// <summary>
        /// 获取待检车辆信息
        /// </summary>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        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.encodeUTF8(hphm);
                XmlElement xe3 = xmldoc.CreateElement("hpzl");            //创建一个<Node>节点
                xe3.InnerText = hpzl;
                xe1.AppendChild(xe2);
                xe1.AppendChild(xe3);
                root.AppendChild(xe1);

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

                string receiveXml = HttpUtility.UrlDecode(outlineservice.queryObjectXml("18C99", Jczdm, key, send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                return(ReadVehicleInfDatatable(receiveXml, out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleInf_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code">1:成功 小于0:失败</param>
        /// <param name="message"></param>
        public bool writeProjectFinishhn(wgprojectFinish model, 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("writecondition"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");          //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe102 = xmldoc.CreateElement("jyjgbh");         //创建一个<Node>节点
                xe102.InnerText = model.jyjgbh;
                XmlElement xe103 = xmldoc.CreateElement("jcxdh");          //创建一个<Node>节点
                xe103.InnerText = model.jcxdh;
                XmlElement xe104 = xmldoc.CreateElement("jycs");           //创建一个<Node>节点
                xe104.InnerText = model.jycs;
                XmlElement xe105 = xmldoc.CreateElement("hpzl");           //创建一个<Node>节点
                xe105.InnerText = model.hpzl;
                XmlElement xe106 = xmldoc.CreateElement("hphm");           //创建一个<Node>节点
                xe106.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe107 = xmldoc.CreateElement("clsbdh");         //创建一个<Node>节点
                xe107.InnerText = model.clsbdh;
                XmlElement xe108 = xmldoc.CreateElement("gwjysbbh");       //创建一个<Node>节点
                xe108.InnerText = model.gwjysbbh;
                XmlElement xe109 = xmldoc.CreateElement("jyxm");           //创建一个<Node>节点
                xe109.InnerText = model.jyxm;
                XmlElement xe110 = xmldoc.CreateElement("jssj");           //创建一个<Node>节点
                xe110.InnerText = model.jssj;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe108);
                xe1.AppendChild(xe109);
                xe1.AppendChild(xe110);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("writeProjectFinishhn_Send: 212\r\n" + send_xml + "\r\n");

                string receiveXml = "";// HttpUtility.UrlDecode(hnwgwebref.writeObjectXml("212", Jczdm, key, send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writeProjectFinishhn_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code">1:成功 小于0:失败</param>
        /// <param name="message"></param>
        public bool writeGaProjectStart(AcprojectStart model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe102 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe102.InnerText = Jyjgbh;
                XmlElement xe103 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe103.InnerText = model.jcxdh;
                XmlElement xe104 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe104.InnerText = model.jycs;
                XmlElement xe105 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe105.InnerText = model.hpzl;
                XmlElement xe106 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe106.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe107 = xmldoc.CreateElement("clsbdh");    //创建一个<Node>节点
                xe107.InnerText = model.clsbdh;
                XmlElement xe108 = xmldoc.CreateElement("gwjysbbh");  //创建一个<Node>节点
                xe108.InnerText = model.gwjysbbh;
                XmlElement xe109 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe109.InnerText = model.jyxm;
                XmlElement xe110 = xmldoc.CreateElement("kssj");      //创建一个<Node>节点
                xe110.InnerText = XmlOperation.encodeUTF8(model.kssj);
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe108);
                xe1.AppendChild(xe109);
                xe1.AppendChild(xe110);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("writeGaProjectStart_Send:  JKXLH:" + Jkxlh + "|JKID:18C55\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(access.WriteService(Jkxlh, "18C55", send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writeGaProjectStart_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 触发拍照18S04
        /// </summary>
        /// <param name="model">拍照信息</param>
        /// <param name="code">写入返回代码</param>
        /// <param name="message">错误信息</param>
        public bool writeCapturePicture(XlycapturePicture model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe102 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe102.InnerText = model.jyjgbh;
                XmlElement xe103 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe103.InnerText = model.jcxdh;
                XmlElement xe104 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe104.InnerText = model.jycs;
                XmlElement xe105 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe105.InnerText = model.hpzl;
                XmlElement xe106 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe106.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe107 = xmldoc.CreateElement("clsbdh");    //创建一个<Node>节点
                xe107.InnerText = model.clsbdh;
                XmlElement xe109 = xmldoc.CreateElement("pzcfsj");    //创建一个<Node>节点
                xe109.InnerText = model.pzcfsj;
                XmlElement xe110 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe110.InnerText = model.jyxm;
                XmlElement xe111 = xmldoc.CreateElement("zpzl");      //创建一个<Node>节点
                xe111.InnerText = model.zpzl;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe109);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                root.AppendChild(xe1);

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

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writeCapturePicture_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 发送拍照命令
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public bool writeCapturePicture(AhcapturePicture model, out string code, out string message)
        {
            XmlDocument xmldoc;
            XmlElement  xmlelem;

            xmldoc  = new XmlDocument();
            xmlelem = xmldoc.CreateElement("", "root", "");
            xmldoc.AppendChild(xmlelem);
            XmlNode    root  = xmldoc.SelectSingleNode("root"); //查找<Employees>
            XmlElement xe1   = xmldoc.CreateElement("reqinfo"); //创建一个<Node>节点
            XmlElement xe101 = xmldoc.CreateElement("jylsh");   //创建一个<Node>节点

            xe101.InnerText = model.jylsh;
            XmlElement xe103 = xmldoc.CreateElement("jcxdh");//创建一个<Node>节点

            xe103.InnerText = model.jcxdh;
            XmlElement xe104 = xmldoc.CreateElement("jycs");//创建一个<Node>节点

            xe104.InnerText = model.jycs;
            XmlElement xe105 = xmldoc.CreateElement("hpzl");//创建一个<Node>节点

            xe105.InnerText = model.hpzl;
            XmlElement xe106 = xmldoc.CreateElement("hphm");//创建一个<Node>节点

            xe106.InnerText = XmlOperation.encodeUTF8(model.hphm);
            XmlElement xe107 = xmldoc.CreateElement("clsbdh");//创建一个<Node>节点

            xe107.InnerText = model.clsbdh;
            XmlElement xe110 = xmldoc.CreateElement("jyxm");//创建一个<Node>节点

            xe110.InnerText = model.jyxm;
            XmlElement xe111 = xmldoc.CreateElement("isFrontLeft");//创建一个<Node>节点

            xe111.InnerText = model.isFrontLeft;
            xe1.AppendChild(xe101);
            xe1.AppendChild(xe103);
            xe1.AppendChild(xe104);
            xe1.AppendChild(xe105);
            xe1.AppendChild(xe106);
            xe1.AppendChild(xe107);
            xe1.AppendChild(xe110);
            xe1.AppendChild(xe111);
            root.AppendChild(xe1);

            string xmlstring = XmlOperation.ConvertXmlToStringUTF8(xmldoc);

            IOControl.saveXmlLogInf("ReqCaptureOut_Send:请求抓拍照片 \r\n参数1-Jkxlh:" + Jkxlh + "|参数2-regXmlDoc:" + "\r\n" + xmlstring + "\r\n");
            string receiveXml = HttpUtility.UrlDecode(outlineservice.reqCaptureOut(Jkxlh, xmlstring));

            IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

            DataSet ds = new DataSet();

            ds      = XmlOperation.CXmlToDataSet(receiveXml);
            code    = ds.Tables["head"].Rows[0]["code"].ToString();
            message = ds.Tables["head"].Rows[0]["message"].ToString();
            return(code == "1");
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code">1:成功 小于0:失败</param>
        /// <param name="message"></param>
        public bool write18J11(xd18J11 model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe102 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe102.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe103 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                if (model.hpzl.Contains("("))
                {
                    xe103.InnerText = model.hpzl.Split('(')[1].Split(')')[0];
                }
                else
                {
                    xe103.InnerText = model.hpzl;
                }
                XmlElement xe104 = xmldoc.CreateElement("clsbdh"); //创建一个<Node>节点
                xe104.InnerText = model.clsbdh;
                XmlElement xe105 = xmldoc.CreateElement("gwxm");   //创建一个<Node>节点
                xe105.InnerText = model.gwxm;
                XmlElement xe106 = xmldoc.CreateElement("jcxdh");  //创建一个<Node>节点
                xe106.InnerText = model.jcxdh;
                XmlElement xe107 = xmldoc.CreateElement("lx");     //创建一个<Node>节点
                xe107.InnerText = model.lx;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                root.AppendChild(xe1);

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

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("write18J11_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 发送外廓尺寸结果数据
        /// </summary>
        /// <param name="jylsh"></param>
        /// <param name="jyxm"></param>
        /// <param name="jycs"></param>
        /// <param name="cwkc"></param>
        /// <param name="cwkk"></param>
        /// <param name="cwkg"></param>
        /// <param name="cwkbz"></param>
        /// <param name="cwkhg"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        public bool writeM1Result(string jylsh, string jyxm, string jycs, string cwkc, string cwkk, string cwkg, string cwkbz, string cwkhg, out int code, out string message)
        {
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");   //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("vehispara"); //创建一个<Node>节点
                XmlElement xe11 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe11.InnerText = jylsh;
                XmlElement xe12 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe12.InnerText = jyxm;
                XmlElement xe13 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe13.InnerText = jycs;
                XmlElement xe14 = xmldoc.CreateElement("cwkc");      //创建一个<Node>节点
                xe14.InnerText = cwkc;
                XmlElement xe15 = xmldoc.CreateElement("cwkk");      //创建一个<Node>节点
                xe15.InnerText = cwkk;
                XmlElement xe16 = xmldoc.CreateElement("cwkg");      //创建一个<Node>节点
                xe16.InnerText = cwkg;
                XmlElement xe17 = xmldoc.CreateElement("cwkbz");     //创建一个<Node>节点
                xe17.InnerText = XmlOperation.encodeUTF8(cwkbz);
                XmlElement xe18 = xmldoc.CreateElement("cwkhg");     //创建一个<Node>节点
                xe18.InnerText = cwkhg == "合格" ? "O" : "X";
                XmlElement xe19 = xmldoc.CreateElement("tdh");       //创建一个<Node>节点
                xe19.InnerText = lineid;
                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);
                xe1.AppendChild(xe15);
                xe1.AppendChild(xe16);
                xe1.AppendChild(xe17);
                xe1.AppendChild(xe18);
                xe1.AppendChild(xe19);
                root.AppendChild(xe1);

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

                ReturnInfo receiveInf = outlineservice.writeObjectOut(jkxlh, "18C81", send_xml);
                code    = receiveInf.code;
                message = receiveInf.message;
                IOControl.saveXmlLogInf("Received:\r\nCode:" + code + "|Message:" + message + "|InfoXML:\r\n" + receiveInf.infoXML + "\r\n");

                return(true);
            }
            catch (Exception er)
            {
                code    = 0;
                message = "";
                IOControl.saveXmlLogInf("writeM1Result_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 发送照片
        /// </summary>
        /// <param name="jylsh"></param>
        /// <param name="jycs"></param>
        /// <param name="zpzl"></param>
        /// <param name="zp_path"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public bool writePicture(string jylsh, string jycs, string zpzl, string zp_path, out int code, out string message)
        {
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");   //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("vehispara"); //创建一个<Node>节点

                XmlElement xe11 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe11.InnerText = jylsh;
                XmlElement xe12 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe12.InnerText = jycs;
                XmlElement xe13 = xmldoc.CreateElement("zpzl");      //创建一个<Node>节点
                xe13.InnerText = zpzl;
                XmlElement xe14 = xmldoc.CreateElement("zp");        //创建一个<Node>节点
                if (zp_path != "")
                {
                    xe14.InnerText = XmlOperation.encodeUTF8(XmlOperation.PushTxt(zp_path));
                }
                else
                {
                    xe14.InnerText = "";
                }
                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("writePicture_Send:  00C63\r\n" + XmlOperation.removePictureInfo(send_xml, new string[4] {
                    @"<zp>", @"<zp1>", @"<zp2>", @"<zp3>"
                }, new string[4] {
                    @"</zp>", @"</zp1>", @"</zp2>", @"</zp3>"
                }) + "\r\n");

                ReturnInfo receiveInf = outlineservice.writeObjectOut(jkxlh, "00C63", send_xml);
                code    = receiveInf.code;
                message = receiveInf.message;
                IOControl.saveXmlLogInf("Received:\r\nCode:" + code + "|Message:" + message + "|InfoXML:\r\n" + receiveInf.infoXML + "\r\n");

                return(true);
            }
            catch (Exception er)
            {
                code    = 0;
                message = "";
                IOControl.saveXmlLogInf("writePicture_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 10
0
        public bool writeVideoFinish(wkVedioStartAndFinish model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe104 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe104.InnerText = model.jyjgbh;
                XmlElement xe105 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe105.InnerText = model.hpzl;
                XmlElement xe106 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe106.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe107 = xmldoc.CreateElement("tongdao");   //创建一个<Node>节点
                xe107.InnerText = model.tongdao;
                XmlElement xe110 = xmldoc.CreateElement("gongwei");   //创建一个<Node>节点
                xe110.InnerText = model.gongwei;
                XmlElement xe111 = xmldoc.CreateElement("xuhao");     //创建一个<Node>节点
                xe111.InnerText = model.xuhao;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("writeVideoFinish_Send:  9992\r\n" + send_xml + "\r\n");

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writeVideoFinish_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code">1:成功 小于0:失败</param>
        /// <param name="message"></param>
        public bool writeStart(wkStartAndFinish model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe104 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe104.InnerText = model.jycs;
                XmlElement xe105 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe105.InnerText = model.hpzl;
                XmlElement xe106 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe106.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe107 = xmldoc.CreateElement("clsbdh");    //创建一个<Node>节点
                xe107.InnerText = model.clsbdh;
                XmlElement xe110 = xmldoc.CreateElement("sj");        //创建一个<Node>节点
                xe110.InnerText = model.sj;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe110);
                root.AppendChild(xe1);

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

                string receiveXml = HttpUtility.UrlDecode(outlineservice.wkcc(model.jylsh, send_xml, "0"));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writeStart_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jylsh"></param>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="clsbdh"></param>
        /// <param name="filePath"></param>
        /// <param name="zplx"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        public bool writeTestImage(string jylsh, string hphm, string hpzl, string clsbdh, string filePath, string zplx, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = jylsh;
                XmlElement xe102 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe102.InnerText = XmlOperation.encodeUTF8(hphm);
                XmlElement xe103 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe103.InnerText = hpzl;
                XmlElement xe104 = xmldoc.CreateElement("clsbdh");    //创建一个<Node>节点
                xe104.InnerText = clsbdh;
                XmlElement xe105 = xmldoc.CreateElement("zplx");      //创建一个<Node>节点
                xe105.InnerText = zplx;
                XmlElement xe106 = xmldoc.CreateElement("zp");        //创建一个<Node>节点
                xe106.InnerText = XmlOperation.PushTxt(filePath);
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                root.AppendChild(xe1);

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

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writeTestImage_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jylb"></param>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="VIN"></param>
        /// <param name="jyjgbh"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public DataTable GetVehicleInfHN(string jylb, string hphm, string hpzl, string VIN, string jyjgbh, 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.encodeUTF8(hphm);
                XmlElement xe3 = xmldoc.CreateElement("hpzl");            //创建一个<Node>节点
                xe3.InnerText = hpzl;
                XmlElement xe4 = xmldoc.CreateElement("clsbdh");          //创建一个<Node>节点
                xe4.InnerText = VIN;
                XmlElement xe5 = xmldoc.CreateElement("jyjgbh");          //创建一个<Node>节点
                xe5.InnerText = jyjgbh;
                XmlElement xe6 = xmldoc.CreateElement("jylb");            //创建一个<Node>节点
                xe6.InnerText = jylb;
                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("GetVehicleInfHN_Send: 906\r\n" + send_xml + "\r\n");

                string receiveXml = "";// HttpUtility.UrlDecode(hnwgwebref.queryObjectXml("906", Jczdm, key, send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                return(ReadVehicleInfDatatablehn(receiveXml, out code, out message));
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleInfHN_Send_Error: \r\n" + er.Message + "\r\n");
                return(null);
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 发送项目开始
        /// </summary>
        /// <param name="jylsh"></param>
        /// <param name="jyxm"></param>
        /// <param name="tgbz"></param>
        /// <param name="code"></param>
        /// <param name="message"></param>
        public bool writeProjectstart(string jylsh, string jyxm, string tgbz, out int code, out string message)
        {
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");   //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("vehispara"); //创建一个<Node>节点
                XmlElement xe11 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe11.InnerText = jylsh;
                XmlElement xe12 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe12.InnerText = jyxm;
                XmlElement xe13 = xmldoc.CreateElement("tdh");       //创建一个<Node>节点
                xe13.InnerText = lineid;
                XmlElement xe14 = xmldoc.CreateElement("tgbz");      //创建一个<Node>节点
                xe14.InnerText = XmlOperation.encodeUTF8(tgbz);
                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);
                root.AppendChild(xe1);

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

                ReturnInfo receiveInf = outlineservice.writeObjectOut(jkxlh, "18C55", send_xml);
                code    = receiveInf.code;
                message = receiveInf.message;
                IOControl.saveXmlLogInf("Received:\r\nCode:" + code + "|Message:" + message + "|InfoXML:\r\n" + receiveInf.infoXML + "\r\n");

                return(true);
            }
            catch (Exception er)
            {
                code    = 0;
                message = "";
                IOControl.saveXmlLogInf("writeProjectstart_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code">1:成功 小于0:失败</param>
        /// <param name="message"></param>
        public bool write18C63(wk18C63 model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe102 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe102.InnerText = model.jyjgbh;
                XmlElement xe103 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe103.InnerText = model.jcxdh;
                XmlElement xe104 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe104.InnerText = model.jycs;
                XmlElement xe105 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe105.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe106 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                if (model.hpzl.Contains("("))
                {
                    xe106.InnerText = model.hpzl.Split('(')[1].Split(')')[0];
                }
                else
                {
                    xe106.InnerText = model.hpzl;
                }
                XmlElement xe107 = xmldoc.CreateElement("clsbdh"); //创建一个<Node>节点
                xe107.InnerText = model.clsbdh;
                XmlElement xe108 = xmldoc.CreateElement("zp");     //创建一个<Node>节点
                if (model.zp != "")
                {
                    xe108.InnerText = XmlOperation.PushTxt(model.zp);
                }
                else
                {
                    xe108.InnerText = "";
                }
                XmlElement xe109 = xmldoc.CreateElement("pssj"); //创建一个<Node>节点
                xe109.InnerText = model.pssj;
                XmlElement xe110 = xmldoc.CreateElement("jyxm"); //创建一个<Node>节点
                xe110.InnerText = model.jyxm;
                XmlElement xe111 = xmldoc.CreateElement("zpzl"); //创建一个<Node>节点
                xe111.InnerText = model.zpzl;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe108);
                xe1.AppendChild(xe109);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("write18C63_Send:  18C63\r\n" + XmlOperation.removePictureInfo(send_xml, new string[1] {
                    @"<zp>"
                }, new string[1] {
                    @"</zp>"
                }) + "\r\n");

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("write18C63_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 16
0
        public bool writeTestImage(string jylsh, string jyjgbh, string jcxdh, string jycs, string hphm, string hpzl, string clsbdh, string filePath, string pssj, string jyxm, string zpzl, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = jylsh;
                XmlElement xe102 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe102.InnerText = jylsh;
                XmlElement xe103 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe103.InnerText = jylsh;
                XmlElement xe104 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe104.InnerText = jylsh;
                XmlElement xe105 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe105.InnerText = XmlOperation.encodeUTF8(hphm);
                XmlElement xe106 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe106.InnerText = hpzl;
                XmlElement xe107 = xmldoc.CreateElement("clsbdh");    //创建一个<Node>节点
                xe107.InnerText = clsbdh;
                XmlElement xe108 = xmldoc.CreateElement("pssj");      //创建一个<Node>节点
                xe108.InnerText = jylsh;
                XmlElement xe109 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe109.InnerText = jylsh;
                XmlElement xe110 = xmldoc.CreateElement("zpzl");      //创建一个<Node>节点
                xe110.InnerText = jylsh;
                XmlElement xe111 = xmldoc.CreateElement("zp");        //创建一个<Node>节点
                xe111.InnerText = XmlOperation.PushTxt(filePath);
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe108);
                xe1.AppendChild(xe109);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("GetVehicleInf_Send:  XTLB:" + Xtlb + "|JKXLH:" + Jkxlh + "|JKID:18C63\r\n" + XmlOperation.removePictureInfo(send_xml, new string[1] {
                    @"<zp>"
                }, new string[1] {
                    @"</zp>"
                }) + "\r\n");

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("GetVehicleInf_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="is_start"></param>
        /// <param name="jylsh"></param>
        /// <param name="sbbh"></param>
        /// <param name="jycs"></param>
        /// <param name="jyxm"></param>
        /// <param name="hphm"></param>
        /// <param name="hpzl"></param>
        /// <param name="vin"></param>
        /// <param name="sj"></param>
        /// <returns></returns>
        public bool SendProjectStartOrStop(bool is_start, string jylsh, string sbbh, string jycs, string jyxm, string hphm, string hpzl, string vin, DateTime sj)
        {
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");                   //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("vehispara");                 //创建一个<Node>节点

                XmlElement xe11 = xmldoc.CreateElement("jyjgbh");                    //创建一个<Node>节点
                xe11.InnerText = station_id;
                XmlElement xe12 = xmldoc.CreateElement("jcxdh");                     //创建一个<Node>节点
                xe12.InnerText = line_id;
                XmlElement xe13 = xmldoc.CreateElement("gwjysbbh");                  //创建一个<Node>节点
                xe13.InnerText = sbbh;
                XmlElement xe14 = xmldoc.CreateElement("jylsh");                     //创建一个<Node>节点
                xe14.InnerText = jylsh;
                XmlElement xe15 = xmldoc.CreateElement("jycs");                      //创建一个<Node>节点
                xe15.InnerText = jycs;
                XmlElement xe16 = xmldoc.CreateElement("jyxm");                      //创建一个<Node>节点
                xe16.InnerText = jyxm;
                XmlElement xe17 = xmldoc.CreateElement("hphm");                      //创建一个<Node>节点
                xe17.InnerText = XmlOperation.encodeUTF8(hphm);
                XmlElement xe18 = xmldoc.CreateElement("hpzl");                      //创建一个<Node>节点
                xe18.InnerText = hpzl;
                XmlElement xe19 = xmldoc.CreateElement("clsbdh");                    //创建一个<Node>节点
                xe19.InnerText = vin;
                XmlElement xe110 = xmldoc.CreateElement(is_start ? "kssj" : "jssj"); //创建一个<Node>节点
                xe110.InnerText = sj.ToString("yyyy-MM-dd HH:mm:ss");
                XmlElement xe111 = xmldoc.CreateElement("sqip");                     //创建一个<Node>节点
                xe111.InnerText = local_ip;

                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);
                xe1.AppendChild(xe15);
                xe1.AppendChild(xe16);
                xe1.AppendChild(xe17);
                xe1.AppendChild(xe18);
                xe1.AppendChild(xe19);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("SendProjectStartOrStop_Send:   " + (is_start ? "开始:18C55" : "结束:18C58") + "\r\n" + send_xml + "\r\n");

                string receiveXml = HttpUtility.UrlDecode(upload_interface.writeObjectOut(xtlb, jkxlh, (is_start ? "开始:18C55" : "结束:18C58"), send_xml));
                IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n");

                string code, message;
                if (XmlOperation.ReadACKString(receiveXml, out code, out message) && code == "1")
                {
                    return(true);
                }
                else
                {
                    IOControl.saveXmlLogInf("写入项目" + (is_start ? "开始" : "结束") + "失败:\r\n" + message + "\r\n");
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("SendProjectStartOrStop_Send_Error: " + (is_start ? "开始" : "结束") + "\r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 101115——上传检测结果详细信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="code">1:成功 小于0:失败</param>
        /// <param name="message"></param>
        public bool writetestDetailResult(KsbtestDetailResult model, 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("vehispara"); //创建一个<Node>节点
                XmlElement xe101 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe101.InnerText = model.jylsh;
                XmlElement xe102 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe102.InnerText = model.jyjgbh;
                XmlElement xe103 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe103.InnerText = model.jcxdh;
                XmlElement xe104 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe104.InnerText = model.jyxm;
                XmlElement xe105 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe105.InnerText = model.jycs;

                XmlElement xe106 = xmldoc.CreateElement("hpzl");     //创建一个<Node>节点
                xe106.InnerText = model.hpzl;
                XmlElement xe107 = xmldoc.CreateElement("hphm");     //创建一个<Node>节点
                xe107.InnerText = XmlOperation.encodeUTF8(model.hphm);
                XmlElement xe108 = xmldoc.CreateElement("clsbdh");   //创建一个<Node>节点
                xe108.InnerText = model.clsbdh;
                XmlElement xe110 = xmldoc.CreateElement("gwjysbbh"); //创建一个<Node>节点
                xe110.InnerText = model.gwjysbbh;

                XmlElement xe111 = xmldoc.CreateElement("cwkc");     //创建一个<Node>节点
                xe111.InnerText = model.cwkc;
                XmlElement xe112 = xmldoc.CreateElement("cwkk");     //创建一个<Node>节点
                xe112.InnerText = model.cwkk;
                XmlElement xe113 = xmldoc.CreateElement("cwkg");     //创建一个<Node>节点
                xe113.InnerText = model.cwkg;
                XmlElement xe114 = xmldoc.CreateElement("clwkccpd"); //创建一个<Node>节点
                xe114.InnerText = model.clwkccpd;
                xe1.AppendChild(xe101);
                xe1.AppendChild(xe102);
                xe1.AppendChild(xe103);
                xe1.AppendChild(xe104);
                xe1.AppendChild(xe105);
                xe1.AppendChild(xe106);
                xe1.AppendChild(xe107);
                xe1.AppendChild(xe108);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                xe1.AppendChild(xe112);
                xe1.AppendChild(xe113);
                xe1.AppendChild(xe114);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("writetestDetailResult_Send:  101115\r\n" + send_xml + "\r\n");

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

                XmlOperation.ReadACKString(receiveXml, out code, out message);

                return(true);
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("writetestDetailResult_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 19
0
        public bool SendWKResult(string jylsh, string jycs, string jyxm, string length_bz, string width_bz, string height_bz,
                                 string length, string width, string height,
                                 string length_pd, string width_pd, string height_pd,
                                 string zbzlvalue, string clzbzlvalue, string zbzlpdvalue,
                                 string zhpd, string sqr)
        {
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");   //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("vehispara"); //创建一个<Node>节点

                XmlElement xe11 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe11.InnerText = station_id;
                XmlElement xe12 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe12.InnerText = line_id;
                XmlElement xe13 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe13.InnerText = jylsh;
                XmlElement xe14 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe14.InnerText = jycs;
                XmlElement xe15 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe15.InnerText = jyxm;
                XmlElement xe16 = xmldoc.CreateElement("bzcwkc");    //创建一个<Node>节点
                xe16.InnerText = length_bz;
                XmlElement xe17 = xmldoc.CreateElement("bzcwkk");    //创建一个<Node>节点
                xe17.InnerText = width_bz;
                XmlElement xe18 = xmldoc.CreateElement("bzcwkg");    //创建一个<Node>节点
                xe18.InnerText = height_bz;
                XmlElement xe19 = xmldoc.CreateElement("cwkc");      //创建一个<Node>节点
                xe19.InnerText = length;
                XmlElement xe110 = xmldoc.CreateElement("cwkk");     //创建一个<Node>节点
                xe110.InnerText = width;
                XmlElement xe111 = xmldoc.CreateElement("cwkg");     //创建一个<Node>节点
                xe111.InnerText = height;
                XmlElement xe112 = xmldoc.CreateElement("ccpd");     //创建一个<Node>节点
                xe112.InnerText = length_pd;
                XmlElement xe113 = xmldoc.CreateElement("ckpd");     //创建一个<Node>节点
                xe113.InnerText = width_pd;
                XmlElement xe114 = xmldoc.CreateElement("cgpd");     //创建一个<Node>节点
                xe114.InnerText = height_pd;
                XmlElement xe115 = xmldoc.CreateElement("clwkccpd"); //创建一个<Node>节点
                xe115.InnerText = zhpd;
                XmlElement xe116 = xmldoc.CreateElement("wjr");      //创建一个<Node>节点
                xe116.InnerText = XmlOperation.encodeUTF8(sqr);
                XmlElement xe117 = xmldoc.CreateElement("sqip");     //创建一个<Node>节点
                xe117.InnerText = local_ip;
                XmlElement zbzl = xmldoc.CreateElement("zbzl");      //创建一个<Node>节点
                zbzl.InnerText = zbzlvalue;
                XmlElement clzbzl = xmldoc.CreateElement("clzbzl");  //创建一个<Node>节点
                clzbzl.InnerText = clzbzlvalue;
                XmlElement zbzlpd = xmldoc.CreateElement("zbzlpd");  //创建一个<Node>节点
                zbzlpd.InnerText = zbzlpdvalue;
                XmlElement xe118 = xmldoc.CreateElement("hxnbcd");   //创建一个<Node>节点
                XmlElement xe119 = xmldoc.CreateElement("hxnbkd");   //创建一个<Node>节点
                XmlElement xe120 = xmldoc.CreateElement("hxnbgd");   //创建一个<Node>节点
                XmlElement xe121 = xmldoc.CreateElement("clzj");     //创建一个<Node>节点

                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);
                xe1.AppendChild(xe15);
                xe1.AppendChild(xe16);
                xe1.AppendChild(xe17);
                xe1.AppendChild(xe18);
                xe1.AppendChild(xe19);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                xe1.AppendChild(xe112);
                xe1.AppendChild(xe113);
                xe1.AppendChild(xe114);
                xe1.AppendChild(xe115);
                xe1.AppendChild(xe116);
                xe1.AppendChild(xe117);
                xe1.AppendChild(xe118);
                xe1.AppendChild(xe119);
                xe1.AppendChild(xe120);
                xe1.AppendChild(xe121);
                xe1.AppendChild(zbzl);
                xe1.AppendChild(clzbzl);
                xe1.AppendChild(zbzlpd);
                root.AppendChild(xe1);

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

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

                string code, message;
                if (XmlOperation.ReadACKString(receiveXml, out code, out message) && code == "1")
                {
                    return(true);
                }
                else
                {
                    IOControl.saveXmlLogInf("发送外廓检测结果失败:\r\n" + message + "\r\n");
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("SendWKResult_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }
Esempio n. 20
0
        public bool SendPhoto(string jylsh, string jycs, string jyxm, string hphm, string hpzl, string vin, DateTime pssj, string zpzl, string zp_path)
        {
            try
            {
                XmlDocument xmldoc  = new XmlDocument();
                XmlElement  xmlelem = xmldoc.CreateElement("", "root", "");
                xmldoc.AppendChild(xmlelem);
                XmlNode    root = xmldoc.SelectSingleNode("root");   //查找<Employees>
                XmlElement xe1  = xmldoc.CreateElement("vehispara"); //创建一个<Node>节点

                XmlElement xe11 = xmldoc.CreateElement("jyjgbh");    //创建一个<Node>节点
                xe11.InnerText = station_id;
                XmlElement xe12 = xmldoc.CreateElement("jcxdh");     //创建一个<Node>节点
                xe12.InnerText = line_id;
                XmlElement xe13 = xmldoc.CreateElement("jylsh");     //创建一个<Node>节点
                xe13.InnerText = jylsh;
                XmlElement xe14 = xmldoc.CreateElement("jycs");      //创建一个<Node>节点
                xe14.InnerText = jycs;
                XmlElement xe15 = xmldoc.CreateElement("jyxm");      //创建一个<Node>节点
                xe15.InnerText = jyxm;
                XmlElement xe16 = xmldoc.CreateElement("hphm");      //创建一个<Node>节点
                xe16.InnerText = XmlOperation.encodeUTF8(hphm);
                XmlElement xe17 = xmldoc.CreateElement("hpzl");      //创建一个<Node>节点
                xe17.InnerText = hpzl;
                XmlElement xe18 = xmldoc.CreateElement("clsbdh");    //创建一个<Node>节点
                xe18.InnerText = vin;
                XmlElement xe19 = xmldoc.CreateElement("pssj");      //创建一个<Node>节点
                xe19.InnerText = pssj.ToString("yyyy-MM-dd HH:mm:ss");
                XmlElement xe110 = xmldoc.CreateElement("zpzl");     //创建一个<Node>节点
                xe110.InnerText = zpzl;
                XmlElement xe111 = xmldoc.CreateElement("zp");       //创建一个<Node>节点
                xe111.InnerText = XmlOperation.encodeUTF8(XmlOperation.PushTxt(zp_path));
                XmlElement xe112 = xmldoc.CreateElement("sqip");     //创建一个<Node>节点
                xe112.InnerText = local_ip;

                xe1.AppendChild(xe11);
                xe1.AppendChild(xe12);
                xe1.AppendChild(xe13);
                xe1.AppendChild(xe14);
                xe1.AppendChild(xe15);
                xe1.AppendChild(xe16);
                xe1.AppendChild(xe17);
                xe1.AppendChild(xe18);
                xe1.AppendChild(xe19);
                xe1.AppendChild(xe110);
                xe1.AppendChild(xe111);
                xe1.AppendChild(xe112);
                root.AppendChild(xe1);

                string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc);
                IOControl.saveXmlLogInf("SendPhoto_Send:   18C63 (照片种类(" + zpzl + ")\r\n" + XmlOperation.removePictureInfo(send_xml, new string[1] {
                    @"<zp>"
                }, new string[1] {
                    @"</zp>"
                }) + "\r\n");

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

                string code, message;
                if (XmlOperation.ReadACKString(receiveXml, out code, out message) && code == "1")
                {
                    return(true);
                }
                else
                {
                    IOControl.saveXmlLogInf("发送照片(" + zpzl + ")失败:\r\n" + message + "\r\n");
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("SendPhoto_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }