/// <summary> /// 获得返回节点的错误描述信息 /// </summary> /// <param name="strXML">xml字符串</param> /// <returns>错误描述</returns> public static string getErrInfo(String strXML) { try { XmlDocument doc = XmlFun.CreateNewDoc(strXML); return(getErrInfo(doc)); } catch (Exception e) { return(""); } }
/// <summary> /// 根据标准返回的xml判断是否执行成功 /// </summary> /// <param name="strXML">标准返回xml字符串</param> /// <returns>是否成功</returns> public static Boolean IsSucceed(string strXML) { try { XmlDocument doc = XmlFun.CreateNewDoc(strXML); return(IsSucceed(doc)); } catch (Exception e) { return(false); } }
/// <summary> /// 更加简洁的添加学生信息代码 /// </summary> /// <param name="strXml"></param> /// <returns></returns> public static string addNew2(string strXml) { XmlDocument obj_Doc = XmlFun.CreateNewDoc(strXml); // 分配学生编码 string strpersonid = NumAssign.assignID_B("100002", "1007"); XmlFun.setNodeValue(obj_Doc, "//PERSONID", strpersonid); string op_xml = obj_Doc.InnerXml; /// 调用统一的标准操作型xml的处理方法 return(Operation.dealWithXml(op_xml)); }
public static string addNew(string strXml) { /// 创建执行对象 DataStorage obj_Storage = new DataStorage(); ReturnDoc obj_ReturnDoc = new ReturnDoc(); try { XmlDocument obj_Doc = XmlFun.CreateNewDoc(strXml); XmlNodeList nodeLst = obj_Doc.SelectNodes("//*[@operation][@operation!='']"); for (int i = 0; i < nodeLst.Count; i++) { XmlElement ele_Temp = (XmlElement)nodeLst.Item(i); // 分配学生编码 string strpersonid = NumAssign.assignID_B("100001", "1007"); XmlFun.setNodeValue(ele_Temp.SelectSingleNode("//PERSONID"), strpersonid); string stT = ele_Temp.InnerXml; // 创建插入数据的XML string str_SQL = SQLAnalyse.analyseXMLSQL(ele_Temp); obj_Storage.addSQL(str_SQL); } /// 执行 string str_Return = obj_Storage.runSQL(); if (!General.empty(str_Return)) { obj_ReturnDoc.addErrorResult(Common.RT_FUNCERROR); obj_ReturnDoc.setFuncErrorInfo(str_Return); } else { obj_ReturnDoc.addErrorResult(Common.RT_SUCCESS); } } catch (Exception e) { obj_ReturnDoc.addErrorResult(Common.RT_FUNCERROR); obj_ReturnDoc.setFuncErrorInfo(e.Message); } return(obj_ReturnDoc.getXml()); }
/// <summary> /// 添加订单 /// </summary> /// <param name="strXml"></param> /// <returns></returns> public static string OrdersAdd(string strXml) { XmlDocument obj_Doc = XmlFun.CreateNewDoc(strXml); // 循环遍历所有的订单编号节点,为其分配统一的订单编码 // 分配订单编码 string strOrdID = NumAssign.assignID_B("100004", General.curYear2() + General.curMonth() + General.curDay()); for (int i = 0; i < obj_Doc.SelectNodes("//PIPEID").Count; i++) { // obj_Doc.SelectNodes("//ORDID").Item(i).InnerText = strOrdID; XmlFun.setNodeValue(obj_Doc, "//PIPEID", i, strOrdID); } /// 调用统一的标准操作型xml的处理方法 return(Operation.dealWithXml(obj_Doc.InnerXml)); }
/// <summary> /// 添加新的班级,并重新生成字典文件 /// </summary> /// <param name="strXml"></param> /// <returns></returns> public static string ClassAdd(string strXml) { XmlDocument obj_Doc = XmlFun.CreateNewDoc(strXml); // 分配班级编码 string strClassID = NumAssign.assignID_B("100003", "A"); XmlFun.setNodeValue(obj_Doc, "//CLASSID", strClassID); string op_xml = obj_Doc.InnerXml; /// 调用统一的标准操作型xml的处理方法 string strRetXml = Operation.dealWithXml(op_xml); DicCache.getInstance().createDicFile("DIC_STUCLASS", "SELECT CLASSID,CLASSNAME FROM STUCLASS ORDER BY CLASSID"); return(strRetXml); }
public UserSession(string strXml) { try { XmlDocument doc = XmlFun.CreateNewDoc(strXml); this.setUserID(doc.SelectSingleNode("//QUERYINFO/ROW/USERID").InnerText); this.setUserTitle(doc.SelectSingleNode("//QUERYINFO/ROW/USERTITLE").InnerText); this.setUserName(doc.SelectSingleNode("//QUERYINFO/ROW/USERNAME").InnerText); this.setUnitID(doc.SelectSingleNode("//QUERYINFO/ROW/UNITID").InnerText); this.setUnitName(doc.SelectSingleNode("//QUERYINFO/ROW/UNITNAME").InnerText); this.setMType(doc.SelectSingleNode("//QUERYINFO/ROW/MTYPE").InnerText); this.setUserType(doc.SelectSingleNode("//QUERYINFO/ROW/USERTYPE").InnerText); } catch (Exception ex) { General.TracePrint("LoginUser.Error.001:" + ex.Message); } }
/// <summary> /// 明细列表 /// </summary> /// <param name="strOrderID">订单编号</param> /// <returns></returns> public static string ordersProList(string strOrderID) { string str_Where = "WHERE PIPEID='" + strOrderID + "'"; string str_Select = "*"; string str_From = "PIPELINEDETAIL s"; string strProXml = CommonQuery.basicListQuery(str_Select, str_From, str_Where, "PIPEID", 9999, 1, "PIPELINEDETAIL"); XmlDocument objProDom = XmlFun.CreateNewDoc(strProXml); for (int i = 0; i < objProDom.SelectNodes("//PIPELINEDETAIL").Count; i++) { XmlElement ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL").Item(i); ele.SetAttribute("operation", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA1").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA2").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA3").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "1"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA4").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "1"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA5").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA6").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA7").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA8").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); ele = (XmlElement)objProDom.SelectNodes("//PIPELINEDETAIL/DATA9").Item(i); ele.SetAttribute("state", "0"); ele.SetAttribute("datatype", "0"); } return(objProDom.InnerXml); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { try{ string strXml = Request["txtXML"]; // strXml = XmlFun.addXDocHead(strXml); XmlDocument doc = XmlFun.CreateNewDoc(strXml); string strUsertitle = XmlFun.getNodeValue(doc, Common.BAR2 + Common.XDOC_LOGININFO + Common.BAR + Field.USERTITLE); string strPassWord = XmlFun.getNodeValue(doc, Common.BAR2 + Common.XDOC_LOGININFO + Common.BAR + Field.USERPASSWORD); string strIP = XmlFun.getNodeValue(doc, Common.BAR2 + Common.XDOC_LOGININFO + Common.BAR + Field.LOGINIP); string strMac = XmlFun.getNodeValue(doc, Common.BAR2 + Common.XDOC_LOGININFO + Common.BAR + Field.MAC); string str_SQL = "SELECT * FROM VW_USERLIST WHERE USERTITLE='" + strUsertitle + "'"; string strErr = ""; ReturnDoc Rtdoc = new ReturnDoc(); OleDbDataReader rst = null; string strRet = CommonQuery.qryRst(str_SQL, ref rst); if (strRet == "0") { Rtdoc.getQueryInfo(rst); if (strPassWord != Rtdoc.getNodeValue(Common.BAR2 + Field.USERPASSWORD)) { strErr = "密码错误"; } } else { strErr = "查询用户信息为空"; } rst.Close(); if (strErr == "") { UserSession user = new UserSession(Rtdoc.getXml()); string[] arrSys = { user.getUserID(), user.getUserTitle(), user.getUserName(), "", user.getUnitID(), user.getUnitName(), strIP, strMac }; string logid = SystemLog.addSysLog(arrSys); user.setLogID(logid); Session.Add("RoleUser", user); Response.Redirect("Login.aspx"); Response.End(); } else { Response.Write("<script language=\"javascript\">"); Response.Write("alert('" + strErr + "');"); Response.Write("history.back();"); Response.Write("</script>"); } } catch (Exception ex) { } } }