private IWhereCondition GetNotStartedDiscounts()
    {
        switch (DiscountType)
        {
        case DiscountTypeEnum.CatalogDiscount:
            return(DiscountInfoProvider.GetDiscounts()
                   .WhereTrue("DiscountEnabled")
                   .WhereNotNull("DiscountValidFrom").WhereGreaterThan("DiscountValidFrom", DateTime.Now));

        case DiscountTypeEnum.OrderDiscount:
        case DiscountTypeEnum.ShippingDiscount:
            return(DiscountInfoProvider.GetDiscounts()
                   .WhereTrue("DiscountEnabled")
                   .WhereNot(IncompleteDiscountsCondition())
                   .WhereNotNull("DiscountValidFrom").WhereGreaterThan("DiscountValidFrom", DateTime.Now));

        case DiscountTypeEnum.ProductCoupon:
            return(MultiBuyDiscountInfoProvider.GetProductCouponDiscounts().Where(NotStartedMultiBuyDiscountsCondition()));

        case DiscountTypeEnum.MultibuyDiscount:
            return(MultiBuyDiscountInfoProvider.GetMultiBuyDiscounts().Where(NotStartedMultiBuyDiscountsCondition()));

        case DiscountTypeEnum.GiftCard:
            return(GiftCardInfoProvider.GetGiftCards()
                   .WhereTrue("GiftCardEnabled")
                   .WhereNot(IncompleteGiftCardsCondition())
                   .WhereNotNull("GiftCardValidFrom").WhereGreaterThan("GiftCardValidFrom", DateTime.Now));
        }

        return(new WhereCondition());
    }
    private IWhereCondition GetIncompleteDiscounts()
    {
        switch (DiscountType)
        {
        // Catalog discounts can't be incomplete
        case DiscountTypeEnum.OrderDiscount:
        case DiscountTypeEnum.ShippingDiscount:
            return(DiscountInfoProvider.GetDiscounts().Where(IncompleteDiscountsCondition()));

        case DiscountTypeEnum.ProductCoupon:
            return(MultiBuyDiscountInfoProvider.GetProductCouponDiscounts().Where(IncompleteMultiBuyDiscountsCondition()));

        case DiscountTypeEnum.MultibuyDiscount:
            return(MultiBuyDiscountInfoProvider.GetMultiBuyDiscounts().Where(IncompleteMultiBuyDiscountsCondition()));

        case DiscountTypeEnum.GiftCard:
            return(GiftCardInfoProvider.GetGiftCards().Where(IncompleteGiftCardsCondition()));
        }

        return(new WhereCondition());
    }
    private IWhereCondition GetDisabledDiscounts()
    {
        switch (DiscountType)
        {
        case DiscountTypeEnum.CatalogDiscount:
        case DiscountTypeEnum.OrderDiscount:
        case DiscountTypeEnum.ShippingDiscount:
            return(DiscountInfoProvider.GetDiscounts().WhereFalse("DiscountEnabled"));

        case DiscountTypeEnum.ProductCoupon:
            return(MultiBuyDiscountInfoProvider.GetProductCouponDiscounts().WhereFalse("MultiBuyDiscountEnabled"));

        case DiscountTypeEnum.MultibuyDiscount:
            return(MultiBuyDiscountInfoProvider.GetMultiBuyDiscounts().WhereFalse("MultiBuyDiscountEnabled"));

        case DiscountTypeEnum.GiftCard:
            return(GiftCardInfoProvider.GetGiftCards().WhereFalse("GiftCardEnabled"));
        }

        return(new WhereCondition());
    }