public virtual string GetInQueryValues(string values, bool encode) { if (encode) { values = SqlUtil.Encode(values.Split(new char[] { ',' }), encode); } return(values); }
public virtual SqlStringBuilder AppendGreaterThanOrEqual(string junction, string column, string value) { if (!string.IsNullOrEmpty(value)) { this.AppendInternal(junction, column, ">=", SqlUtil.Encode(value, true)); } return(this); }
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); }