Example #1
0
 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);
 }
Example #2
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));
        }