/// <summary> /// Gets where condition based on value of given controls. /// </summary> /// <param name="where">Where condition</param> /// <param name="column">Column to compare</param> /// <param name="drpOperator">List control with operator</param> /// <param name="valueBox">Text control with value</param> /// <returns>Where condition for outdated documents</returns> private void AddOutdatedWhereCondition(WhereCondition where, string column, ListControl drpOperator, ITextControl valueBox) { var value = TextHelper.LimitLength(valueBox.Text, 100); if (!String.IsNullOrEmpty(value)) { string condition = drpOperator.SelectedValue; // Create condition based on operator switch (condition) { case WhereBuilder.LIKE: where.WhereContains(column, value); break; case WhereBuilder.NOT_LIKE: where.WhereNotContains(column, value); break; case WhereBuilder.EQUAL: where.WhereEquals(column, value); break; case WhereBuilder.NOT_EQUAL: where.WhereNotEquals(column, value); break; } } }