コード例 #1
0
ファイル: PowerCotePower.cs プロジェクト: wtf-boy/Framework
 public List<CoteInfo> GetCoteInfoKeyList(string key)
 {
     string str = "";
     if (this.IDDataType == 1)
     {
         str = this.IDName + " in (" + key + ")";
     }
     else
     {
         str = this.IDName + " in (" + key.ConvertStringID() + ")";
     }
     if (!string.IsNullOrWhiteSpace(this.DefalutCondition))
     {
         str = str + " and " + this.DefalutCondition;
     }
     WTF.Framework.MySqlHelper helper = new WTF.Framework.MySqlHelper(this.ConnectionStringName);
     StringBuilder builder = new StringBuilder();
     builder.Append(this.GetTabeleSql);
     if (!string.IsNullOrWhiteSpace(str))
     {
         builder.Append(" where " + str + " ");
     }
     if ((key.Split(new char[] { ',' }).Length > 1) && !string.IsNullOrWhiteSpace(this.SortExpression))
     {
         builder.Append(" order by " + this.SortExpression);
     }
     MySqlDataReader reader = helper.ExecuteReader(builder.ToString(), new MySqlParameter[0]);
     return this.ConvertCoteInfo(reader);
 }
コード例 #2
0
ファイル: PowerCotePower.cs プロジェクト: wtf-boy/Framework
 public List<CoteInfo> GetAllCoteInfoList()
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(this.GetTabeleSql);
     if (!string.IsNullOrWhiteSpace(this.DefalutCondition))
     {
         builder.Append(" where " + this.DefalutCondition + " ");
     }
     if (!string.IsNullOrWhiteSpace(this.SortExpression))
     {
         builder.Append(" order by " + this.SortExpression);
     }
     MySqlDataReader reader = new WTF.Framework.MySqlHelper(this.ConnectionStringName).ExecuteReader(builder.ToString(), new MySqlParameter[0]);
     return this.ConvertCoteInfo(reader);
 }
コード例 #3
0
        public List <CoteInfo> GetAllCoteInfoList(string RootIDValue)
        {
            if ((this.IDDataType == 1) && !RootIDValue.IsMatch(@"\d+"))
            {
                return(new List <CoteInfo>());
            }
            StringBuilder builder = new StringBuilder();

            if (string.IsNullOrWhiteSpace(this.IDPathName))
            {
                builder.Append(this.GetTabeleSql);
                if (!string.IsNullOrWhiteSpace(this.DefalutCondition))
                {
                    builder.Append(" where " + this.DefalutCondition + " ");
                }
                if (!string.IsNullOrWhiteSpace(this.SortExpression))
                {
                    builder.Append(" order by " + this.SortExpression);
                }
            }
            else
            {
                builder.AppendLine("SET @IDPath='';");
                string str = "";
                if (this.IDDataType == 1)
                {
                    str = this.IDName + "=" + RootIDValue;
                }
                else
                {
                    str = this.IDName + "='" + RootIDValue.Trim() + "'";
                }
                builder.AppendLine("SELECT " + this.IDPathName + " INTO @IDPath  FROM " + this.CoteTableName + " WHERE " + str + ";");
                builder.AppendLine(this.GetTabeleSql + " WHERE   " + this.IDPathName + " LIKE   CONCAT( @IDPath,'%') ");
                if (!string.IsNullOrWhiteSpace(this.DefalutCondition))
                {
                    builder.Append(" AND  " + this.DefalutCondition + " ");
                }
                if (!string.IsNullOrWhiteSpace(this.SortExpression))
                {
                    builder.Append(" order by " + this.SortExpression);
                }
            }
            MySqlDataReader reader = new WTF.Framework.MySqlHelper(this.ConnectionStringName).ExecuteReader(builder.ToString(), new MySqlParameter[0]);

            return(this.ConvertCoteInfo(reader));
        }
コード例 #4
0
        public List <CoteInfo> GetCoteInfoKeyList(string key)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                return(new List <CoteInfo>());
            }
            string str = "";

            if (this.IDDataType == 1)
            {
                string str2 = "";
                foreach (string str3 in key.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    if (str3.IsMatch(@"\d+"))
                    {
                        str2 = str2 + str3 + ",";
                    }
                }
                str = this.IDName + " in (" + str2.TrimEndComma() + ")";
            }
            else
            {
                str = this.IDName + " in (" + key.ConvertStringID() + ")";
            }
            if (!string.IsNullOrWhiteSpace(this.DefalutCondition))
            {
                str = str + " and " + this.DefalutCondition;
            }
            WTF.Framework.MySqlHelper helper  = new WTF.Framework.MySqlHelper(this.ConnectionStringName);
            StringBuilder             builder = new StringBuilder();

            builder.Append(this.GetTabeleSql);
            if (!string.IsNullOrWhiteSpace(str))
            {
                builder.Append(" where " + str + " ");
            }
            if ((key.Split(new char[] { ',' }).Length > 1) && !string.IsNullOrWhiteSpace(this.SortExpression))
            {
                builder.Append(" order by " + this.SortExpression);
            }
            MySqlDataReader reader = helper.ExecuteReader(builder.ToString(), new MySqlParameter[0]);

            return(this.ConvertCoteInfo(reader));
        }