示例#1
0
 public virtual string GetInQueryValues(string values, bool encode)
 {
     if (encode)
     {
         values = SqlUtil.Encode(values.Split(new char[] { ',' }), encode);
     }
     return(values);
 }
示例#2
0
 public virtual SqlStringBuilder AppendGreaterThanOrEqual(string junction, string column, string value)
 {
     if (!string.IsNullOrEmpty(value))
     {
         this.AppendInternal(junction, column, ">=", SqlUtil.Encode(value, true));
     }
     return(this);
 }
示例#3
0
 public virtual SqlStringBuilder AppendRange(string junction, string column, string from, string to)
 {
     if (!string.IsNullOrEmpty(from) || !string.IsNullOrEmpty(to))
     {
         StringBuilder builder = new StringBuilder();
         if (!string.IsNullOrEmpty(from))
         {
             builder.AppendFormat("{0} >= {1}", column, SqlUtil.Encode(from, true));
         }
         if (!(string.IsNullOrEmpty(from) || string.IsNullOrEmpty(to)))
         {
             builder.AppendFormat(" {0} ", SqlUtil.AND);
         }
         if (!string.IsNullOrEmpty(to))
         {
             builder.AppendFormat("{0} <= {1}", column, SqlUtil.Encode(to, true));
         }
         this.AppendInternal(junction, builder.ToString());
     }
     return(this);
 }