/// <summary> /// 为标准的返回XML结构创建错误信息节点并赋值 /// </summary> /// <param name="strNodeName">节点名称</param> /// <param name="strResult">节点值</param> /// <returns>Boolean true成功,false失败</returns> public Boolean setErrorNodeChild(String strNodeName, String strResult) { try { if (!createErrorInfoNode()) { throw new Exception("ReturnDoc.setErrorNodeChild.创建返回节点时发生错误"); } XmlNode nod_Temp = m_doc_Self.SelectSingleNode(Common.XDOC_ROOT + Common.BAR + Common.XDOC_ERRORINFO); if (nod_Temp == null) { throw new Exception("ReturnDoc.setErrorNodeChild.获取错误根节点时发生错误"); } XmlNode nod_Child = m_doc_Self.SelectSingleNode( Common.XDOC_ROOT + Common.BAR + Common.XDOC_ERRORINFO + Common.BAR + strNodeName); if (nod_Child == null) { XmlFun.CreateDocNode(m_doc_Self, Common.XDOC_ROOT + Common.BAR + Common.XDOC_ERRORINFO, strNodeName, strResult); } else { nod_Child.InnerText = strResult; } return(true); } catch (Exception e) { return(false); } }
/// <summary> /// 创建标准XML结构的错误信息跟节点 /// </summary> /// <returns>Boolean true成功,false失败</returns> public Boolean createErrorInfoNode() { try { XmlNodeList nodeList = m_doc_Self.SelectNodes(Common.XDOC_ROOT + Common.BAR + Common.XDOC_ERRORINFO); int int_Size = nodeList.Count; if (int_Size == 0) { XmlFun.CreateDocNode(m_doc_Self, Common.XDOC_ROOT, Common.XDOC_ERRORINFO); } return(true); } catch (Exception e) { } return(false); }
public Boolean createQueryInfoNode() { try { XmlNode node = XmlFun.getNode(m_doc_Self, Common.XDOC_ROOT + Common.BAR + Common.XDOC_QUERYINFO); if (node == null) { XmlFun.CreateDocNode(m_doc_Self, Common.XDOC_ROOT, Common.XDOC_QUERYINFO, ""); } return(true); } catch (Exception e) { return(false); } return(false); }
/// <summary> /// 向查询返回数据节点中,添加属性 /// * 在本函数中,如果原来已经存在同名节点,则会删除原节点 /// 例如:<EFSFRAME> /// <QUERYINFO> <-- PropInfo /// </QUERYINFO> /// </EFSFRAME> /// </summary> /// <param name="strPropName">属性名称</param> /// <param name="strPropValue">属性值</param> /// <returns>是否成功</returns> public Boolean addPropToQueryInfo(String strPropName, String strPropValue) { try { XmlElement ele_Query = XmlFun.getElement(m_doc_Self, Common.XDOC_ROOT + Common.BAR + Common.XDOC_QUERYINFO); if (ele_Query == null) { XmlFun.CreateDocNode(m_doc_Self, Common.XDOC_ROOT, Common.XDOC_QUERYINFO, ""); } ele_Query = XmlFun.getElement(m_doc_Self, Common.XDOC_ROOT + Common.BAR + Common.XDOC_QUERYINFO); ele_Query.SetAttribute(strPropName, strPropValue); return(true); } catch (Exception e) { return(false); } }
/// <summary> /// 在文档数据节点下添加一个 SQL 脚本的子节点 /// 例如:<EFSFRAME> /// <DATAINFO> /// <SQLSCRIPT operation="5"/> * 将该节点添加到文档根节点中 /// </DATAINFO> /// </EFSFRAME> /// </summary> /// <param name="strSQL">待插入节点的 SQL 语句</param> /// <returns>是否成功</returns> public Boolean addSQLScript(string strSQL) { return(XmlFun.CreateDocNode(m_doc_Self, Common.XDOC_ROOT + Common.BAR + Common.XDOC_DATAINFO, Common.XDOC_SQLSCRIPT, strSQL)); }