/// <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); } }
/// <summary> /// 获取平台时间 /// </summary> /// <param name="code"></param> /// <param name="message"></param> /// <param name="systemTime"></param> /// <returns></returns> public bool getSystemTime(out int code, out string message, out DateTime systemTime) { code = 0; message = ""; systemTime = DateTime.Now; try { IOControl.saveXmlLogInf("getSystemTime_Send: 18C50\r\n"); ReturnInfo receiveInf = outlineservice.queryObjectOut(jkxlh, "18C50", ""); code = receiveInf.code; message = receiveInf.message; IOControl.saveXmlLogInf("Received: Code:" + code + "|Message:" + message + "|InfoXML:\r\n" + receiveInf.infoXML + "\r\n"); if (code == 1) { systemTime = System.DateTime.Parse(XmlOperation.CXmlToDatatTable(HttpUtility.UrlDecode(receiveInf.infoXML)).Rows[0]["SystemTime"].ToString()); return(true); } else { return(false); } } catch (Exception er) { IOControl.saveXmlLogInf("getSystemTime_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
public string SendInfo(string method_name, string[] argsXml, out string error_info) { error_info = ""; if (File.Exists(dllpath) == false) { error_info = "代理类客户端不存在,请检查后重试!"; return("null"); } else { try { string sendXml = ""; for (int i = 0; i < argsXml.Length; i++) { sendXml = sendXml + argsXml[i] + "\r\n"; } IOControl.saveXmlLogInf(method_name + "_Send:\r\n" + sendXml + "\r\n"); MethodInfo method = interface_type.GetMethod(method_name); string receiveXml = method.Invoke(interface_obj, argsXml).ToString(); IOControl.saveXmlLogInf("Received:\r\n" + receiveXml + "\r\n"); return(receiveXml); } catch (Exception ex) { IOControl.saveXmlLogInf(method_name + "_Send_Error:\r\n" + ex.Message + "\r\n"); error_info = "接口调用发生错误:" + ex.Message; return("null"); } } }
/// <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); } }
/// <summary> /// 发送项目录像开始命令 /// </summary> /// <param name="xmmc">检测项目名称代码(M1-外廓尺寸自动测量、M2-外廓尺寸自动测量侧面)</param> /// <param name="jylsh">检验流水号</param> /// <param name="jcbh">检测编号</param> /// <param name="jccs">检测次数</param> /// <param name="hphm">号牌号码</param> /// <param name="hpzl">号牌种类</param> /// <param name="vin">车架号码</param> /// <returns>是否成功(成功为1、失败为0)</returns> public bool StartVideo(string xmmc, string jylsh, string jcbh, int jccs, string hphm, string hpzl, string vin) { if (jk_status == false) { return(false); } try { string hpzl_temp = hpzl.Split('(')[1].Split(')')[0]; IOControl.saveXmlLogInf("南京新仕尚联网,号牌号码:" + hphm + "|流水号:" + jylsh + "|检测次数:" + jccs.ToString() + ",项目(" + xmmc + ")录像开始"); string result = outlineservice.StartVideo(xmmc, line_id, jylsh, jcbh, jccs, hphm, hpzl_temp, vin); IOControl.saveXmlLogInf("Received:号牌号码:" + hphm + " | 流水号:" + jylsh + " | 检测次数:" + jccs.ToString() + " | 项目:" + xmmc + ",发送结果:" + result); if (result == "1") { return(true); } else { return(false); } } catch (Exception er) { IOControl.saveXmlLogInf("南京新仕尚联网发送录制视频开始失败,错误信息:\r\n" + er.Message); return(false); } }
/// <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); } }
/// <summary> /// 发送照片 /// </summary> /// <param name="zpzl">照片种类(0360-外廓尺寸自动测量前照片、0361-外廓尺寸自动测量侧面照片、0362-准备质量前45度照片、0361-准备质量后45度照片)</param> /// <param name="jylsh">检验流水号</param> /// <param name="jcbh">检测编号</param> /// <param name="jccs">检测次数</param> /// <param name="hphm">号牌号码</param> /// <param name="hpzl">号牌种类</param> /// <param name="vin">车架号码</param> /// <returns>是否成功(成功为1、失败为0)</returns> public bool Capture(string zpzl, string jylsh, string jcbh, int jccs, string hphm, string hpzl, string vin) { if (jk_status == false) { return(false); } try { string hpzl_temp = hpzl.Split('(')[1].Split(')')[0]; IOControl.saveXmlLogInf("南京新仕尚联网,hphm:" + hphm + "|hpzl:" + hpzl_temp + "|vin:" + vin + "|jylsh:" + jylsh + "|jcbh:" + jcbh + "|jccs:" + jccs.ToString() + ",开始发送照片(" + zpzl + ")"); string result = outlineservice.Capture(zpzl, line_id, jylsh, jcbh, jccs, hphm, hpzl_temp, vin); IOControl.saveXmlLogInf("Received:号牌号码:" + hphm + " | 流水号:" + jylsh + " | 检测次数:" + jccs.ToString() + " | 照片种类:" + zpzl + ",发送结果:" + result); if (result == "1") { return(true); } else { return(false); } } catch (Exception er) { IOControl.saveXmlLogInf("南京新仕尚联网发送照片(" + zpzl + ")失败,错误信息:\r\n" + er.Message); return(false); } }
public bool SendZBZLResult(string jylsh, string jycs, string jyxm, string zbzl, string zhpd) { 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("zbzl"); //创建一个<Node>节点 xe16.InnerText = zbzl; XmlElement xe17 = xmldoc.CreateElement("zbzlpd"); //创建一个<Node>节点 xe17.InnerText = zhpd; XmlElement xe18 = xmldoc.CreateElement("sqip"); //创建一个<Node>节点 xe18.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); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("SendZBZLResult_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("SendZBZLResult_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
/// <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); } }
/// <summary> /// 获取待检车辆信息 /// </summary> /// <param name="hphm"></param> /// <param name="hpzl"></param> /// <param name="clsbdh"></param> /// <param name="code"></param> /// <param name="message"></param> /// <param name="dt"></param> /// <returns></returns> public bool GetVehicleInf(string hphm, string hpzl, string clsbdh, out string code, out string message, out DataTable dt) { if (clsbdh.Length > 4) { clsbdh = clsbdh.Substring(clsbdh.Length - 4, 4);//车辆识别代号超过4位时传后4位 } IOControl.saveXmlLogInf("QueryVehicleOut_Send:车辆信息查询接口 \r\n参数1-jkxlh:" + Jkxlh + "|参数2-hphm:" + hphm + "|参数3-hpzl:" + hpzl + "|参数4-clsbdh:" + clsbdh + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.queryVehicleOut(Jkxlh, hpzl, hphm, clsbdh)); 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(); if (code == "1") { dt = ds.Tables["vehinfo"]; if (dt.Rows.Count > 0) { return(true); } else { return(false); } } else { dt = null; return(false); } }
/// <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); } }
/// <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); } }
/// <summary> /// 101104——项目开始命令 /// </summary> /// <param name="model"></param> /// <param name="code">1:成功 小于0:失败</param> /// <param name="message"></param> public bool writeProjectStart(KsbprojectStart 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 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("writeProjectStart_Send: 101104\r\n" + send_xml + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.UploadObjectOut(101104, 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("writeProjectStart_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 writetestDetailResulthn(wgtestDetailResult 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("jyxm"); //创建一个<Node>节点 xe104.InnerText = model.jyxm; XmlElement xe105 = xmldoc.CreateElement("jycs"); //创建一个<Node>节点 xe105.InnerText = model.jycs; 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(xe111); xe1.AppendChild(xe112); xe1.AppendChild(xe113); xe1.AppendChild(xe114); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("writetestDetailResulthn_Send: 423\r\n" + send_xml + "\r\n"); string receiveXml = "";// HttpUtility.UrlDecode(hnwgwebref.writeObjectXml("423", 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("writetestDetailResulthn_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
/// <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"); }
/// <summary> /// 写入外廓结果数据 /// </summary> /// <param name="model"></param> /// <param name="code"></param> /// <param name="message"></param> /// <returns></returns> public bool writetestDetailResult(AhtestDetailResult 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("jyxm");//创建一个<Node>节点 xe104.InnerText = model.jyxm; XmlElement xe105 = xmldoc.CreateElement("jycs");//创建一个<Node>节点 xe105.InnerText = model.jycs; 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(xe103); xe1.AppendChild(xe104); xe1.AppendChild(xe105); xe1.AppendChild(xe111); xe1.AppendChild(xe112); xe1.AppendChild(xe113); xe1.AppendChild(xe114); root.AppendChild(xe1); string xmlstring = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("ReqWriteCheckDataOut_Send:写检验结果详细数据 \r\n参数1-Jkxlh:" + Jkxlh + "|参数2-Jyxm:" + model.jyxm + "|参数3-regXmlDoc:" + "\r\n" + xmlstring + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.reqWriteCheckDataOut(Jkxlh, model.jyxm, 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"); }
/// <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); } }
/// <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); } }
/// <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); } }
/// <summary> /// 上传外廓结果 /// </summary> /// <param name="model"></param> /// <param name="code">1:成功 小于0:失败</param> /// <param name="message"></param> public bool writetestDetailResult(ZhtestDetailResult 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("cwkk"); //创建一个<Node>节点 xe107.InnerText = model.cwkk; XmlElement xe108 = xmldoc.CreateElement("cwkg"); //创建一个<Node>节点 xe108.InnerText = model.cwkg; XmlElement xe110 = xmldoc.CreateElement("clwkccpd"); //创建一个<Node>节点 xe110.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); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("writetestDetailResult_Send: XTLB:" + Xtlb + "|JKXLH:" + Jkxlh + "|JKID:18C81\r\n" + send_xml + "\r\n"); string receiveXml = HttpUtility.UrlDecode(outlineservice.writeObjectOut(Xtlb, 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); } }
public ReturnInfo queryObjectOut(string jkxlh, string jkid, string QueryXmlDoc) { IOControl.saveXmlLogInf("queryObjectOut|jkxlh:" + jkxlh + "|jkid:" + jkid + "\r\nQueryXmlDoc:" + QueryXmlDoc + "\r\n"); object[] results = this.Invoke("queryObjectOut", new object[] { jkxlh, jkid, QueryXmlDoc }); return((ReturnInfo)(results[0])); }
public ReturnInfo writeObjectOut(string jkxlh, string jkid, string WriteXmlDoc) { IOControl.saveXmlLogInf("writeObjectOut|jkxlh:" + jkxlh + "|jkid:" + jkid + "\r\nWriteXmlDoc:" + WriteXmlDoc + "\r\n"); object[] results = this.Invoke("writeObjectOut", new object[] { jkxlh, jkid, WriteXmlDoc }); return((ReturnInfo)(results[0])); }
public string UploadObjectOut(int nSignal, string strXml, string strIP) { IOControl.saveXmlLogInf("\r\n" + "Send:" + " InterfaceNo:" + nSignal.ToString() + "\r\n" + strXml); object[] results = this.Invoke("UploadObjectOut", new object[] { nSignal, strXml, strIP }); return((string)(results[0])); }
/// <summary> /// 发整备质量结果 /// </summary> /// <param name="model"></param> /// <param name="code"></param> /// <param name="message"></param> /// <returns></returns> public bool writeZbzlDetails(gxZbzlDetailResult 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("jcbh"); //创建一个<Node>节点 xe101.InnerText = model.jcbh; XmlElement xe102 = xmldoc.CreateElement("jyxm"); //创建一个<Node>节点 xe102.InnerText = "PB"; XmlElement xe103 = xmldoc.CreateElement("zxh"); //创建一个<Node>节点 xe103.InnerText = model.zxh; XmlElement xe104 = xmldoc.CreateElement("jycs"); //创建一个<Node>节点 xe104.InnerText = model.jycs; XmlElement xe105 = xmldoc.CreateElement("zbzl"); //创建一个<Node>节点 xe105.InnerText = model.zbzl; XmlElement xe106 = xmldoc.CreateElement("zbzlpd"); //创建一个<Node>节点 xe106.InnerText = model.zbzlpd; XmlElement xe107 = xmldoc.CreateElement("cbmc"); //创建一个<Node>节点 xe107.InnerText = XmlOperation.encodeGBK(model.cbmc); XmlElement xe108 = xmldoc.CreateElement("ip"); //创建一个<Node>节点 xe108.InnerText = model.ip; xe1.AppendChild(xe101); xe1.AppendChild(xe102); xe1.AppendChild(xe103); xe1.AppendChild(xe104); xe1.AppendChild(xe105); xe1.AppendChild(xe106); xe1.AppendChild(xe107); xe1.AppendChild(xe108); root.AppendChild(xe1); string send_xml = XmlOperation.ConvertXmlToStringUTF8(xmldoc); IOControl.saveXmlLogInf("writeZbzlDetails_Send: Xtlb:" + Xtlb + "|Jkid:18C81|Yhdh:" + Yhdh + "|Jkxh:" + Jkxh + "\r\n" + send_xml + "\r\n"); StringBuilder receiveXml = new StringBuilder(); receiveXml.Length = 10240; gxDll.writeObjectOut(Xtlb, "18C81", send_xml, Yhdh, Jkxh, receiveXml); IOControl.saveXmlLogInf("Received:\r\n" + receiveXml.ToString() + "\r\n"); XmlOperation.ReadACKString(receiveXml.ToString(), out code, out message); return(true); } catch (Exception er) { IOControl.saveXmlLogInf("writeZbzlDetails_Send_Error: \r\n" + er.Message + "\r\n"); return(false); } }
/// <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); } }
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); } }
/// <summary> /// 接口初始化 /// </summary> /// <param name="url">接口地址</param> /// <param name="lineID">检测线号</param> public ShiShang(string url, string lineID) { try { line_id = lineID; outlineservice = new SSService(url); jk_status = true; } catch (Exception er) { jk_status = false; IOControl.saveXmlLogInf("南京新仕尚联网接口初始化失败,错误信息:\r\n" + er.Message); } }
/// <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); } }
/// <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); } }
/// <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); } }