Пример #1
0
        /// <summary>
        /// 转换成Insert语句
        /// </summary>
        /// <param name="sqlElement">SQL元素</param>
        /// <param name="xmlParent">XML父节点元素</param>
        /// <param name="xnm">集合命名空间范围管理类的对象</param>
        public override void FromXml(SqlElement sqlElement, XmlElement xmlParent, XmlNamespaceManager xnm)
        {
            base.FromXml(sqlElement, xmlParent, xnm);

            var             xnm2            = new XmlNamespaceManager(xmlParent.OwnerDocument.NameTable);
            InsertSqlStaMSS insertSql       = sqlElement as InsertSqlStaMSS;
            ParserUtil      util            = new ParserUtil(xnm);
            XmlElement      xmlInsertFields = util.Child(xmlParent, InsertFieldList.INSERTFIELDLIST);

            //XmlElement xmlInsertValues = util.Child(xmlParent, InsertValueList.INSERTVALUELIST);
            insertSql.InsertFields.FromXml(insertSql.InsertFields, xmlInsertFields, xnm);
            //insertSql.InsertValues.FromXml(insertSql.InsertValues, xmlInsertValues, xnm);
        }
Пример #2
0
        /// <summary>
        /// 转换成XML
        /// </summary>
        /// <param name="sqlElement">SQL元素</param>
        /// <param name="xmlParent">XML父节点元素</param>
        public override void ToXml(SqlElement sqlElement, XmlElement xmlParent)
        {
            base.ToXml(sqlElement, xmlParent);

            InsertSqlStaMSS insertSql       = sqlElement as InsertSqlStaMSS;
            XmlElement      xmlInsertFields = SerializerUtil.AddElement(xmlParent, InsertFieldList.INSERTFIELDLIST);

            insertSql.InsertFields.ToXml(insertSql.InsertFields, xmlInsertFields);

            //不需要对FieldValue序列化
            //XmlElement xmlInsertValues = SerializerUtil.AddElement(xmlParent, InsertValueList.INSERTVALUELIST);
            //insertSql.InsertValues.ToXml(insertSql.InsertValues, xmlInsertValues);
        }