public virtual string GetWhereClause(Options.FilterCondition condition, int index) { string whereFormat = GetWhereClauseFormat(condition, false); string where = string.Format(whereFormat, condition.Property, index); return(where); }
public virtual string GetWhereClauseInternal(Options.FilterCondition condition, int index) { string whereFormat = GetWhereClauseFormat(condition, true); string preCondition = (string.IsNullOrEmpty(condition.PreCondition)) ? string.Empty : condition.PreCondition; string posCondition = (string.IsNullOrEmpty(condition.PosCondition)) ? string.Empty : condition.PosCondition; string where = string.Format(whereFormat, preCondition, condition.Property, index, posCondition); return(where); }
private string GetWhereClauseFormat(Options.FilterCondition condition, bool full) { string value = Convert.ChangeType(condition.DefaultValue, typeof(string)) as string; if (!(AInBox.Astove.Core.Enums.EnumUtility.GetEnumText(this.InternalOperatorType, condition.DefaultOperator).Contains("null")) && (string.IsNullOrEmpty(value) || value.Equals("-1"))) { return(string.Empty); } string whereFormat = string.Empty; whereFormat = AInBox.Astove.Core.Enums.EnumUtility.GetEnumText((!full) ? this.InternalOperatorType : this.InternalFullOperatorType, condition.DefaultOperator); return(whereFormat); }