/// <summary> /// /// </summary> /// <param name="model"></param> /// <param name="code">1:成功 小于0:失败</param> /// <param name="message"></param> public bool write18N63(sr18N63 model, 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("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>节点 if (model.hpzl.Contains("(")) { xe105.InnerText = model.hpzl.Split('(')[1].Split(')')[0]; } else { 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("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; XmlElement xe112 = xmldoc.CreateElement("spdm"); //创建一个<Node>节点 xe112.InnerText = model.spdm; 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); xe1.AppendChild(xe112); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("write18N63_Send: 18N63\r\n" + send_xml + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.writeObjectOut(Xtlb, Jkxlh, "18N63", send_xml)); IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n"); XmlOperation.ReadACKString(receiveXml, out code, out message); return(true); } catch (Exception er) { IOControl.saveXmlLogInf("write18N63_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
public bool writePhoto(HyPhoto model, out string code, out string message) { code = ""; message = ""; return(true); 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 xe108 = xmldoc.CreateElement("zp"); //创建一个<Node>节点 xe108.InnerText = XmlOperation.PushTxt(model.zp); 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("writeOutlineCapturePicture_Send: XTLB:01|JKXLH:" + Jkxlh + "JKID:18C63\r\n" + send_xml + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.writeObjectOut("01", 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("writeOutlineCapturePicture_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <param name="code">1:成功 小于0:失败</param> /// <param name="message"></param> public bool write18J16(xd18J16 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("cwkc"); //创建一个<Node>节点 xe106.InnerText = model.cwkc; XmlElement xe107 = xmldoc.CreateElement("cwkcpd"); //创建一个<Node>节点 xe107.InnerText = model.cwkcpd; XmlElement xe108 = xmldoc.CreateElement("cwkk"); //创建一个<Node>节点 xe108.InnerText = model.cwkk; XmlElement xe109 = xmldoc.CreateElement("cwkkpd"); //创建一个<Node>节点 xe109.InnerText = model.cwkkpd; XmlElement xe110 = xmldoc.CreateElement("cwkg"); //创建一个<Node>节点 xe110.InnerText = model.cwkg; XmlElement xe111 = xmldoc.CreateElement("cwkgpd"); //创建一个<Node>节点 xe111.InnerText = model.cwkgpd; XmlElement xe112 = xmldoc.CreateElement("hxnbcd"); //创建一个<Node>节点 XmlElement xe113 = xmldoc.CreateElement("hxnbcdpd"); //创建一个<Node>节点 xe113.InnerText = model.hxnbcdpd; XmlElement xe114 = xmldoc.CreateElement("hxnbkd"); //创建一个<Node>节点 XmlElement xe115 = xmldoc.CreateElement("hxnbkdpd"); //创建一个<Node>节点 xe115.InnerText = model.hxnbkdpd; XmlElement xe116 = xmldoc.CreateElement("hxnbgd"); //创建一个<Node>节点 XmlElement xe117 = xmldoc.CreateElement("hxnbgdpd"); //创建一个<Node>节点 xe117.InnerText = model.hxnbgdpd; XmlElement xe118 = xmldoc.CreateElement("zj"); //创建一个<Node>节点 XmlElement xe119 = xmldoc.CreateElement("zjpd"); //创建一个<Node>节点 xe119.InnerText = model.zjpd; XmlElement xe120 = xmldoc.CreateElement("clwkccpd"); //创建一个<Node>节点 xe120.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(xe109); 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); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("GetVehicleList_Send: 18J16\r\n" + send_xml + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.writeObjectOut(Xtlb, Jkxlh, "18J16", send_xml)); IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n"); XmlOperation.ReadACKString(receiveXml, out code, out message); return(true); } catch (Exception er) { IOControl.saveXmlLogInf("GetVehicleList_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <param name="code">1:成功 小于0:失败</param> /// <param name="message"></param> public bool writetestDetailResult(HyTestDetailResult 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; XmlElement cdevl = xmldoc.CreateElement("cdevl"); //创建一个<Node>节点 cdevl.InnerText = model.cdevl; XmlElement kdevl = xmldoc.CreateElement("kdevl"); //创建一个<Node>节点 kdevl.InnerText = model.kdevl; XmlElement gdevl = xmldoc.CreateElement("gdevl"); //创建一个<Node>节点 gdevl.InnerText = model.gdevl; XmlElement xlbgd = xmldoc.CreateElement("xlbgd"); //创建一个<Node>节点 xlbgd.InnerText = model.xlbgd; XmlElement xlbgdpd = xmldoc.CreateElement("xlbgdpd"); //创建一个<Node>节点 xlbgdpd.InnerText = model.xlbgdpd; 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); xe1.AppendChild(cdevl); xe1.AppendChild(kdevl); xe1.AppendChild(gdevl); xe1.AppendChild(xlbgd); xe1.AppendChild(xlbgdpd); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("writetestDetailResult_Send: XTLB:01|JKXLH:" + Jkxlh + "JKID:18C81\r\n" + send_xml + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.writeObjectOut("01", Jkxlh, "18C81", send_xml)); 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); } }