private string GetWhereCondition() { var where = new WhereCondition(); // Display name/Code name string displayName = txtClassDisplayName.Text.Trim(); if (!String.IsNullOrEmpty(displayName)) { where .Where(w => w.WhereContains("ClassDisplayName", displayName) .Or() .WhereContains("ClassName", displayName)); } // Table name string tableName = txtClassTableName.Text.Trim(); if (!String.IsNullOrEmpty(tableName)) { where .WhereContains("ClassTableName", tableName); } return(where.ToString(true)); }
/// <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; } } }
/// <summary> /// Creates filter condition and raise filter change event. /// </summary> private void FilterData() { WhereCondition where = new WhereCondition(); int paging = 0; string order = string.Empty; // Build where condition according to drop-downs settings if (statusSelector.SelectedID > 0) { where.WhereEquals("SKUPublicStatusID", statusSelector.SelectedID); } if (manufacturerSelector.SelectedID > 0) { where.WhereEquals("SKUManufacturerID", manufacturerSelector.SelectedID); } if (chkStock.Checked) { where.Where(w => w.WhereNull("SKUTrackInventory") .Or() .WhereGreaterThan("SKUAvailableItems", 0) .Or() .WhereIn("SKUID", new IDQuery <SKUInfo>("SKUParentSKUID").WhereGreaterThan("SKUAvailableItems", 0))); } if (!string.IsNullOrEmpty(txtSearch.Text)) { where.WhereContains("SKUName", txtSearch.Text); } // Process drpSort drop-down if (ValidationHelper.GetInteger(drpPaging.SelectedValue, 0) > 0) { paging = ValidationHelper.GetInteger(drpPaging.SelectedValue, 0); } if (!string.IsNullOrEmpty(drpSort.SelectedValue)) { order = drpSort.SelectedValue; } // Set where condition WhereCondition = where.ToString(true); if (paging > 0) { // Set paging PageSize = paging; } if (!string.IsNullOrEmpty(order)) { // Set sorting OrderBy = GetOrderBy(order); } }
/// <summary> /// Merges given where condition with additional settings. /// </summary> /// <param name="where">Original where condition</param> /// <returns>New where condition</returns> private string GetWhereCondition(string where) { // Add recycle bin condition var condition = new WhereCondition(where) .WhereNotNull("VersionDeletedWhen"); // Filter by object name if (!string.IsNullOrEmpty(ObjectDisplayName)) { condition.WhereContains("VersionObjectDisplayName", ObjectDisplayName); } // Filter by object type if (!String.IsNullOrEmpty(ObjectType)) { condition.WhereContains("VersionObjectType", ObjectType); } return(condition.ToString(true)); }
/// <summary> /// Merges given where condition with additional settings. /// </summary> /// <param name="where">Original where condition</param> /// <returns>New where condition</returns> private WhereCondition GetWhereCondition(WhereCondition where) { // Create version condition var condition = new WhereCondition().WhereNotNull("VersionDeletedWhen"); // Add recycle bin condition (ensure correct parentheses wrapping) condition.Where(where); // Filter by object name if (!string.IsNullOrEmpty(ObjectDisplayName)) { condition.WhereContains("VersionObjectDisplayName", ObjectDisplayName); } // Filter by object type if (!String.IsNullOrEmpty(ObjectType)) { condition.WhereContains("VersionObjectType", ObjectType); } return(condition); }
private WhereCondition GetPhoneWhereCondition() { var phoneWhere = new WhereCondition(); if (!String.IsNullOrEmpty(CurrentAccount.AccountPhone)) { phoneWhere.WhereContains("AccountPhone", CurrentAccount.AccountPhone); } if (!String.IsNullOrEmpty(CurrentAccount.AccountFax)) { phoneWhere.Or().WhereContains("AccountFax", CurrentAccount.AccountFax); } return(phoneWhere); }
/// <summary> /// Returns where condition based on webpart fields. /// </summary> private WhereCondition GetWhereCondition() { var where = new WhereCondition().WhereEquals("SKUSiteID", SiteContext.CurrentSiteID); // Show products only from current site or global too, based on setting if (ECommerceSettings.AllowGlobalProducts(SiteContext.CurrentSiteName)) { where.Where(w => w.WhereEquals("SKUSiteID", SiteContext.CurrentSiteID).Or().WhereNull("SKUSiteID")); } // Show/hide product variants - it is based on type of inventory tracking for parent product string trackByVariants = TrackInventoryTypeEnum.ByVariants.ToStringRepresentation(); where.Where(v => v.Where(w => w.WhereNull("SKUParentSKUID").And().WhereNotEquals("SKUTrackInventory", trackByVariants)) .Or() .Where(GetParentProductWhereCondition(new WhereCondition().WhereEquals("SKUTrackInventory", trackByVariants)))); // Product type filter if (!string.IsNullOrEmpty(ProductType) && (ProductType != FILTER_ALL)) { if (ProductType == PRODUCT_TYPE_PRODUCTS) { where.WhereNull("SKUOptionCategoryID"); } else if (ProductType == PRODUCT_TYPE_PRODUCT_OPTIONS) { where.WhereNotNull("SKUOptionCategoryID"); } } // Representing filter if (!string.IsNullOrEmpty(Representing) && (Representing != FILTER_ALL)) { SKUProductTypeEnum productTypeEnum = Representing.ToEnum<SKUProductTypeEnum>(); string productTypeString = productTypeEnum.ToStringRepresentation(); where.WhereEquals("SKUProductType", productTypeString); } // Product number filter if (!string.IsNullOrEmpty(ProductNumber)) { where.WhereContains("SKUNumber", ProductNumber); } // Department filter DepartmentInfo di = DepartmentInfoProvider.GetDepartmentInfo(Department, CurrentSiteName); di = di ?? DepartmentInfoProvider.GetDepartmentInfo(Department, null); if (di != null) { where.Where(GetColumnWhereCondition("SKUDepartmentID", new WhereCondition().WhereEquals("SKUDepartmentID", di.DepartmentID))); } // Manufacturer filter ManufacturerInfo mi = ManufacturerInfoProvider.GetManufacturerInfo(Manufacturer, CurrentSiteName); mi = mi ?? ManufacturerInfoProvider.GetManufacturerInfo(Manufacturer, null); if (mi != null) { where.Where(GetColumnWhereCondition("SKUManufacturerID", new WhereCondition().WhereEquals("SKUManufacturerID", mi.ManufacturerID))); } // Supplier filter SupplierInfo si = SupplierInfoProvider.GetSupplierInfo(Supplier, CurrentSiteName); si = si ?? SupplierInfoProvider.GetSupplierInfo(Supplier, null); if (si != null) { where.Where(GetColumnWhereCondition("SKUSupplierID", new WhereCondition().WhereEquals("SKUSupplierID", si.SupplierID))); } // Needs shipping filter if (!string.IsNullOrEmpty(NeedsShipping) && (NeedsShipping != FILTER_ALL)) { if (NeedsShipping == NEEDS_SHIPPING_YES) { where.Where(GetColumnWhereCondition("SKUNeedsShipping", new WhereCondition().WhereTrue("SKUNeedsShipping"))); } else if (NeedsShipping == NEEDS_SHIPPING_NO) { where.Where(GetColumnWhereCondition("SKUNeedsShipping", new WhereCondition().WhereFalse("SKUNeedsShipping").Or().WhereNull("SKUNeedsShipping"))); } } // Price from filter if (PriceFrom > 0) { where.WhereGreaterOrEquals("SKUPrice", PriceFrom); } // Price to filter if (PriceTo > 0) { where.WhereLessOrEquals("SKUPrice", PriceTo); } // Public status filter PublicStatusInfo psi = PublicStatusInfoProvider.GetPublicStatusInfo(PublicStatus, CurrentSiteName); if (psi != null) { where.Where(GetColumnWhereCondition("SKUPublicStatusID", new WhereCondition().WhereEquals("SKUPublicStatusID", psi.PublicStatusID))); } // Internal status filter InternalStatusInfo isi = InternalStatusInfoProvider.GetInternalStatusInfo(InternalStatus, CurrentSiteName); if (isi != null) { where.Where(GetColumnWhereCondition("SKUInternalStatusID", new WhereCondition().WhereEquals("SKUInternalStatusID", isi.InternalStatusID))); } // Allow for sale filter if (!string.IsNullOrEmpty(AllowForSale) && (AllowForSale != FILTER_ALL)) { if (AllowForSale == ALLOW_FOR_SALE_YES) { where.WhereTrue("SKUEnabled"); } else if (AllowForSale == ALLOW_FOR_SALE_NO) { where.WhereEqualsOrNull("SKUEnabled", false); } } // Available items filter if (!string.IsNullOrEmpty(AvailableItems)) { int value = ValidationHelper.GetInteger(AvailableItems, int.MaxValue); where.WhereLessOrEquals("SKUAvailableItems", value); } // Needs to be reordered filter if (NeedsToBeReordered) { where.Where(w => w.Where(v => v.WhereNull("SKUReorderAt").And().WhereLessOrEquals("SKUAvailableItems", 0)) .Or() .Where(z => z.WhereNotNull("SKUReorderAt").And().WhereLessOrEquals("SKUAvailableItems".AsColumn(), "SKUReorderAt".AsColumn()))); } return where; }
/// <summary> /// Merges given where condition with additional settings. /// </summary> /// <param name="where">Original where condition</param> /// <returns>New where condition</returns> private WhereCondition GetWhereCondition(WhereCondition where) { // Create version condition var condition = new WhereCondition().WhereNotNull("VersionDeletedWhen"); // Add recycle bin condition (ensure correct parentheses wrapping) condition.Where(where); // Filter by object name if (!string.IsNullOrEmpty(ObjectDisplayName)) { condition.WhereContains("VersionObjectDisplayName", ObjectDisplayName); } // Filter by object type if (!String.IsNullOrEmpty(ObjectType)) { condition.WhereContains("VersionObjectType", ObjectType); } return condition; }
private WhereCondition GetPhoneWhereCondition() { var phoneWhere = new WhereCondition(); if (!String.IsNullOrEmpty(CurrentAccount.AccountPhone)) { phoneWhere.WhereContains("AccountPhone", CurrentAccount.AccountPhone); } if (!String.IsNullOrEmpty(CurrentAccount.AccountFax)) { phoneWhere.Or().WhereContains("AccountFax", CurrentAccount.AccountFax); } return phoneWhere; }
/// <summary> /// Returns where condition based on webpart fields. /// </summary> private WhereCondition GetWhereCondition() { var where = new WhereCondition().WhereEquals("SKUSiteID", SiteContext.CurrentSiteID); // Show products only from current site or global too, based on setting if (ECommerceSettings.AllowGlobalProducts(SiteContext.CurrentSiteName)) { where.Where(w => w.WhereEquals("SKUSiteID", SiteContext.CurrentSiteID).Or().WhereNull("SKUSiteID")); } // Show/hide product variants - it is based on type of inventory tracking for parent product string trackByVariants = TrackInventoryTypeEnum.ByVariants.ToStringRepresentation(); where.Where(v => v.Where(w => w.WhereNull("SKUParentSKUID").And().WhereNotEquals("SKUTrackInventory", trackByVariants)) .Or() .Where(GetParentProductWhereCondition(new WhereCondition().WhereEquals("SKUTrackInventory", trackByVariants)))); // Product type filter if (!string.IsNullOrEmpty(ProductType) && (ProductType != FILTER_ALL)) { if (ProductType == PRODUCT_TYPE_PRODUCTS) { where.WhereNull("SKUOptionCategoryID"); } else if (ProductType == PRODUCT_TYPE_PRODUCT_OPTIONS) { where.WhereNotNull("SKUOptionCategoryID"); } } // Representing filter if (!string.IsNullOrEmpty(Representing) && (Representing != FILTER_ALL)) { SKUProductTypeEnum productTypeEnum = Representing.ToEnum <SKUProductTypeEnum>(); string productTypeString = productTypeEnum.ToStringRepresentation(); where.WhereEquals("SKUProductType", productTypeString); } // Product number filter if (!string.IsNullOrEmpty(ProductNumber)) { where.WhereContains("SKUNumber", ProductNumber); } // Department filter DepartmentInfo di = DepartmentInfoProvider.GetDepartmentInfo(Department, CurrentSiteName); di = di ?? DepartmentInfoProvider.GetDepartmentInfo(Department, null); if (di != null) { where.Where(GetColumnWhereCondition("SKUDepartmentID", new WhereCondition().WhereEquals("SKUDepartmentID", di.DepartmentID))); } // Manufacturer filter ManufacturerInfo mi = ManufacturerInfoProvider.GetManufacturerInfo(Manufacturer, CurrentSiteName); mi = mi ?? ManufacturerInfoProvider.GetManufacturerInfo(Manufacturer, null); if (mi != null) { where.Where(GetColumnWhereCondition("SKUManufacturerID", new WhereCondition().WhereEquals("SKUManufacturerID", mi.ManufacturerID))); } // Supplier filter SupplierInfo si = SupplierInfoProvider.GetSupplierInfo(Supplier, CurrentSiteName); si = si ?? SupplierInfoProvider.GetSupplierInfo(Supplier, null); if (si != null) { where.Where(GetColumnWhereCondition("SKUSupplierID", new WhereCondition().WhereEquals("SKUSupplierID", si.SupplierID))); } // Needs shipping filter if (!string.IsNullOrEmpty(NeedsShipping) && (NeedsShipping != FILTER_ALL)) { if (NeedsShipping == NEEDS_SHIPPING_YES) { where.Where(GetColumnWhereCondition("SKUNeedsShipping", new WhereCondition().WhereTrue("SKUNeedsShipping"))); } else if (NeedsShipping == NEEDS_SHIPPING_NO) { where.Where(GetColumnWhereCondition("SKUNeedsShipping", new WhereCondition().WhereFalse("SKUNeedsShipping").Or().WhereNull("SKUNeedsShipping"))); } } // Price from filter if (PriceFrom > 0) { where.WhereGreaterOrEquals("SKUPrice", PriceFrom); } // Price to filter if (PriceTo > 0) { where.WhereLessOrEquals("SKUPrice", PriceTo); } // Public status filter PublicStatusInfo psi = PublicStatusInfoProvider.GetPublicStatusInfo(PublicStatus, CurrentSiteName); if (psi != null) { where.Where(GetColumnWhereCondition("SKUPublicStatusID", new WhereCondition().WhereEquals("SKUPublicStatusID", psi.PublicStatusID))); } // Internal status filter InternalStatusInfo isi = InternalStatusInfoProvider.GetInternalStatusInfo(InternalStatus, CurrentSiteName); if (isi != null) { where.Where(GetColumnWhereCondition("SKUInternalStatusID", new WhereCondition().WhereEquals("SKUInternalStatusID", isi.InternalStatusID))); } // Allow for sale filter if (!string.IsNullOrEmpty(AllowForSale) && (AllowForSale != FILTER_ALL)) { if (AllowForSale == ALLOW_FOR_SALE_YES) { where.WhereTrue("SKUEnabled"); } else if (AllowForSale == ALLOW_FOR_SALE_NO) { where.WhereEqualsOrNull("SKUEnabled", false); } } // Available items filter if (!string.IsNullOrEmpty(AvailableItems)) { int value = ValidationHelper.GetInteger(AvailableItems, int.MaxValue); where.WhereLessOrEquals("SKUAvailableItems", value); } // Needs to be reordered filter if (NeedsToBeReordered) { where.Where(w => w.Where(v => v.WhereNull("SKUReorderAt").And().WhereLessOrEquals("SKUAvailableItems", 0)) .Or() .Where(z => z.WhereNotNull("SKUReorderAt").And().WhereLessOrEquals("SKUAvailableItems".AsColumn(), "SKUReorderAt".AsColumn()))); } return(where); }
/// <summary> /// Builds a SQL condition for filtering the order list, and returns it. /// </summary> /// <returns>A SQL condition for filtering the order list.</returns> private WhereCondition GetFilterWhereCondition() { var condition = new WhereCondition(); // Order status if (statusSelector.SelectedID > 0) { condition.WhereEquals("OrderStatusID", statusSelector.SelectedID); } // Order site if (FilterSiteID > 0) { condition.WhereEquals("OrderSiteID", FilterSiteID); } // Order identifier string filterOrderId = txtOrderId.Text.Trim().Truncate(txtOrderId.MaxLength); if (filterOrderId != String.Empty) { int orderId = ValidationHelper.GetInteger(filterOrderId, 0); // Include also an invoice number condition.Where(w => w.WhereEquals("OrderID", orderId).Or().WhereContains("OrderInvoiceNumber", filterOrderId)); } // Customer's properties, applicable only if a valid customer is not specified if (CustomerFilterEnabled) { // First, Last name and Company search string customerNameOrCompany = txtCustomerNameOrCompany.Text.Trim().Truncate(txtCustomerNameOrCompany.MaxLength); if (customerNameOrCompany != String.Empty) { condition.WhereIn("OrderCustomerID", new IDQuery <CustomerInfo>("CustomerID").WhereContains("CustomerFirstName", customerNameOrCompany) .Or() .WhereContains("CustomerLastName", customerNameOrCompany) .Or() .WhereContains("CustomerCompany", customerNameOrCompany)); } } // Order is paid switch (drpOrderIsPaid.SelectedValue) { case "0": condition.Where("ISNULL(OrderIsPaid, 0) = 0"); break; case "1": condition.Where("ISNULL(OrderIsPaid, 0) = 1"); break; } // Advanced Filter if (AdvancedFilterEnabled) { // Specific currency was selected if (CurrencySelector.SelectedID > 0) { condition.WhereEquals("OrderCurrencyID", CurrencySelector.SelectedID); } // Specific payment method was selected if (PaymentSelector.SelectedID > 0) { condition.WhereEquals("OrderPaymentOptionID", PaymentSelector.SelectedID); } // Specific shipping option was selected if (ShippingSelector.SelectedID > 0) { condition.WhereEquals("OrderShippingOptionID", ShippingSelector.SelectedID); } // Specific tracking number was provided var trackingNumber = txtTrackingNumber.Text.Truncate(txtTrackingNumber.MaxLength); if (trackingNumber != string.Empty) { condition.WhereContains("OrderTrackingNumber", trackingNumber); } // Specific created date was selected if ((dtpCreatedTo.SelectedDateTime < dtpCreatedTo.MaxDate) && (dtpCreatedTo.SelectedDateTime > dtpCreatedTo.MinDate)) { condition.WhereLessOrEquals("OrderDate", dtpCreatedTo.SelectedDateTime); } // Specific from date was selected if ((dtpFrom.SelectedDateTime < dtpFrom.MaxDate) && (dtpFrom.SelectedDateTime > dtpFrom.MinDate)) { condition.WhereGreaterOrEquals("OrderDate", dtpFrom.SelectedDateTime); } } return(condition); }
private string GetWhereCondition() { var where = new WhereCondition(); // Display name/Code name string displayName = txtClassDisplayName.Text.Trim(); if (!String.IsNullOrEmpty(displayName)) { where .Where(w => w.WhereContains("ClassDisplayName", displayName) .Or() .WhereContains("ClassName", displayName)); } // Table name string tableName = txtClassTableName.Text.Trim(); if (!String.IsNullOrEmpty(tableName)) { where .WhereContains("ClassTableName", tableName); } return where.ToString(true); }
/// <summary> /// Creates filter condition and raise filter change event. /// </summary> private void FilterData() { WhereCondition where = new WhereCondition(); int paging = 0; string order = string.Empty; // Build where condition according to drop-downs settings if (statusSelector.SelectedID > 0) { where.WhereEquals("SKUPublicStatusID", statusSelector.SelectedID); } if (manufacturerSelector.SelectedID > 0) { where.WhereEquals("SKUManufacturerID", manufacturerSelector.SelectedID); } if (chkStock.Checked) { where.Where(w => w.WhereNull("SKUTrackInventory") .Or() .WhereGreaterThan("SKUAvailableItems", 0) .Or() .WhereIn("SKUID", new IDQuery<SKUInfo>("SKUParentSKUID").WhereGreaterThan("SKUAvailableItems", 0))); } if (!string.IsNullOrEmpty(txtSearch.Text)) { where.WhereContains("SKUName", txtSearch.Text); } // Process drpSort drop-down if (ValidationHelper.GetInteger(drpPaging.SelectedValue, 0) > 0) { paging = ValidationHelper.GetInteger(drpPaging.SelectedValue, 0); } if (!string.IsNullOrEmpty(drpSort.SelectedValue)) { order = drpSort.SelectedValue; } // Set where condition WhereCondition = where.ToString(true); if (paging > 0) { // Set paging PageSize = paging; } if (!string.IsNullOrEmpty(order)) { // Set sorting OrderBy = GetOrderBy(order); } }
/// <summary> /// Merges given where condition with additional settings. /// </summary> /// <param name="where">Original where condition</param> /// <returns>New where condition</returns> private string GetWhereCondition(string where) { // Add recycle bin condition var condition = new WhereCondition(where) .WhereNotNull("VersionDeletedWhen"); // Filter by object name if (!string.IsNullOrEmpty(ObjectDisplayName)) { condition.WhereContains("VersionObjectDisplayName", ObjectDisplayName); } // Filter by object type if (!String.IsNullOrEmpty(ObjectType)) { condition.WhereContains("VersionObjectType", ObjectType); } return condition.ToString(true); }
/// <summary> /// Builds a SQL condition for filtering the order list, and returns it. /// </summary> /// <returns>A SQL condition for filtering the order list.</returns> private WhereCondition GetFilterWhereCondition() { var condition = new WhereCondition(); // Order status if (statusSelector.SelectedID > 0) { condition.WhereEquals("OrderStatusID", statusSelector.SelectedID); } // Order site if (FilterSiteID > 0) { condition.WhereEquals("OrderSiteID", FilterSiteID); } // Order identifier string filterOrderId = txtOrderId.Text.Trim().Truncate(txtOrderId.MaxLength); if (filterOrderId != String.Empty) { int orderId = ValidationHelper.GetInteger(filterOrderId, 0); // Include also an invoice number condition.Where(w => w.WhereEquals("OrderID", orderId).Or().WhereContains("OrderInvoiceNumber", filterOrderId)); } // Customer's properties, applicable only if a valid customer is not specified if (CustomerFilterEnabled) { // First, Last name and Company search string customerNameOrCompany = txtCustomerNameOrCompany.Text.Trim().Truncate(txtCustomerNameOrCompany.MaxLength); if (customerNameOrCompany != String.Empty) { condition.WhereIn("OrderCustomerID", new IDQuery<CustomerInfo>("CustomerID").WhereContains("CustomerFirstName", customerNameOrCompany) .Or() .WhereContains("CustomerLastName", customerNameOrCompany) .Or() .WhereContains("CustomerCompany", customerNameOrCompany)); } } // Order is paid switch (drpOrderIsPaid.SelectedValue) { case "0": condition.Where("ISNULL(OrderIsPaid, 0) = 0"); break; case "1": condition.Where("ISNULL(OrderIsPaid, 0) = 1"); break; } // Advanced Filter if (AdvancedFilterEnabled) { // Specific currency was selected if (CurrencySelector.SelectedID > 0) { condition.WhereEquals("OrderCurrencyID", CurrencySelector.SelectedID); } // Specific payment method was selected if (PaymentSelector.SelectedID > 0) { condition.WhereEquals("OrderPaymentOptionID", PaymentSelector.SelectedID); } // Specific shipping option was selected if (ShippingSelector.SelectedID > 0) { condition.WhereEquals("OrderShippingOptionID", ShippingSelector.SelectedID); } // Specific tracking number was provided var trackingNumber = txtTrackingNumber.Text.Truncate(txtTrackingNumber.MaxLength); if (trackingNumber != string.Empty) { condition.WhereContains("OrderTrackingNumber", trackingNumber); } // Specific created date was selected if ((dtpCreatedTo.SelectedDateTime < dtpCreatedTo.MaxDate) && (dtpCreatedTo.SelectedDateTime > dtpCreatedTo.MinDate)) { condition.WhereLessOrEquals("OrderDate", dtpCreatedTo.SelectedDateTime); } // Specific from date was selected if ((dtpFrom.SelectedDateTime < dtpFrom.MaxDate) && (dtpFrom.SelectedDateTime > dtpFrom.MinDate)) { condition.WhereGreaterOrEquals("OrderDate", dtpFrom.SelectedDateTime); } } return condition; }