NAssintModelToDbCommand/ConvertXml.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;
using System.Xml.Serialization;

namespace NLKIRAModelToDbCommand
{
    public class ConvertXml
    {
        private static string dbConvertUrl = AppDomain.CurrentDomain.BaseDirectory + "DBConvert.xml";

        public static string GetConvertcloumnStrBySqlServer2000(string dbName, string tableName, string cloumnName, bool isPrefixTableName) 
        {
            XmlNodeList xnl = GetXmlNodeList(dbName, tableName, cloumnName);
            if (xnl == null || xnl.Count <= 0)
            {
                if (isPrefixTableName)
                    return tableName + "." + cloumnName;
                return cloumnName;
            }
            return GetConvertcloumnStrBySqlServer2000(xnl, tableName, cloumnName, isPrefixTableName);
        }
        private static string GetConvertcloumnStrBySqlServer2000(XmlNodeList xnl, string tableName, string cloumnName, bool isPrefixTableName)
        {
            string key;
            bool b = false;

            StringBuilder buf = new StringBuilder();
            buf.Append(" CASE ");
            foreach(XmlNode xn in xnl)
            {
                key = " " + xn.Attributes["condition"].Value;

                if (key.Contains(" <>"))
                {
                    key = key.Replace("<>", cloumnName + "<>");
                    b = true;
                }
                if (key.Contains(" >"))
                {
                    key = key.Replace(">", cloumnName + ">");
                    b = true;
                }
                if (key.Contains(" <"))
                {
                    key = key.Replace("<", cloumnName + "<");
                    b = true;
                }
                if (key.Contains(" ="))
                {
                    key = key.Replace("=", cloumnName + "=");
                    b = true;
                }
                if (!b)
                    key = cloumnName + " = " + key;
后面还有 112 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。