本文整理汇总了C#中WhereCondition.WhereNot方法的典型用法代码示例。如果您正苦于以下问题:C# WhereCondition.WhereNot方法的具体用法?C# WhereCondition.WhereNot怎么用?C# WhereCondition.WhereNot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhereCondition
的用法示例。
在下文中一共展示了WhereCondition.WhereNot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFilterWhereCondition
/// <summary>
/// Builds a SQL condition for filtering the discount list, and returns it.
/// </summary>
/// <returns>A SQL condition for filtering the discount list.</returns>
private string GetFilterWhereCondition()
{
string discountStatus = drpStatus.SelectedValue;
var condition = new WhereCondition();
/* Active discounts */
if (discountStatus == "0")
{
condition.Where(GetActiveQuery());
}
/* Disabled discounts */
else if (discountStatus == "1")
{
condition.WhereNot(GetEnabledDiscounts());
}
/* Finished discounts */
else if (discountStatus == "2")
{
condition.Where(GetEnabledDiscounts())
.WhereLessThan(GetColumn("DiscountValidTo"), DateTime.Now)
.WhereNot(GetIncompleteDiscounts())
.Or(GetDiscountsWithCouponsExceeded());
}
/* Scheduled discounts */
else if (discountStatus == "3")
{
condition.Where(GetEnabledDiscounts())
.WhereGreaterThan(GetColumn("DiscountValidFrom"), DateTime.Now)
.WhereNot(GetIncompleteDiscounts());
}
/* Incomplete discounts */
else if (discountStatus == "4")
{
condition.Where(GetEnabledDiscounts())
.Where(GetIncompleteDiscounts());
}
return condition.ToString(true);
}