本文整理汇总了C#中WhereCondition.Where方法的典型用法代码示例。如果您正苦于以下问题:C# WhereCondition.Where方法的具体用法?C# WhereCondition.Where怎么用?C# WhereCondition.Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhereCondition
的用法示例。
在下文中一共展示了WhereCondition.Where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFilterWhereCondition
/// <summary>
/// Builds a SQL condition for filtering the variant list, and returns it.
/// </summary>
/// <returns>A SQL condition for filtering the variant list.</returns>
private WhereCondition GetFilterWhereCondition()
{
var condition = new WhereCondition();
bool allChecked = AllCheckboxesChecked();
string variantNameOrNumber = txtVariantNameNumber.Text;
// If there are no options/categories in filter or all options are selected and Name-or-Number search box is empty, empty condition is returned
if (((optionToCheckBoxMap.Keys.Count == 0) || allChecked) && (string.IsNullOrEmpty(variantNameOrNumber)))
{
return condition;
}
foreach (KeyValuePair<int, List<int>> pair in SelectedOptionIDs)
{
// Option ids for current category (pair.Key = current category id)
List<int> optionIds = pair.Value;
// If there are no selected options in category, whole category is ignored
if (optionIds.Count > 0)
{
// Where condition for selected options from current category
condition.WhereIn("SKUID", new IDQuery<VariantOptionInfo>("VariantSKUID").WhereIn("OptionSKUID", optionIds));
}
}
// Variants with SKUName or Number like text in textbox field
if (!string.IsNullOrEmpty(variantNameOrNumber))
{
condition.Where(w => w.WhereContains("SKUNumber", variantNameOrNumber).Or().WhereContains("SKUName", variantNameOrNumber));
}
// Condition is empty -> not a single option is checked -> grid will be empty
if (condition.WhereCondition == null)
{
condition.NoResults();
}
return condition;
}
示例2: GetWhereCondition
/// <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;
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:27,代码来源:ObjectsRecycleBin.ascx.cs
示例3: CheckDoublePageAssignment
/// <summary>
/// Checks if page is not already assigned.
/// </summary>
/// <param name="filledVariantPath">Variant path filled in form</param>
private void CheckDoublePageAssignment(string filledVariantPath)
{
string originalVariantPath = ValidationHelper.GetString(ABVariant.GetOriginalValue("ABVariantPath"), "");
//Check if variantPath is changed
if (originalVariantPath != filledVariantPath)
{
var condition = new WhereCondition()
.WhereEquals("ABVariantTestID", ABTest.ABTestID)
.WhereEquals("ABVariantPath", filledVariantPath);
if (ABVariant.ABVariantID > 0)
{
condition.Where("ABVariantID", QueryOperator.NotEquals, ABVariant.ABVariantID);
}
var variants = ABVariantInfoProvider.GetVariants().Where(condition).TopN(1);
if (variants.Any())
{
ShowError(GetString("abtesting.variantpath.alreadyassigned"));
form.StopProcessing = true;
}
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
PageTitle.TitleText = GetString("newsletter_issue_openedby.title");
issueId = QueryHelper.GetInteger("objectid", 0);
if (issueId == 0)
{
RequestHelper.EndResponse();
}
IssueInfo issue = IssueInfoProvider.GetIssueInfo(issueId);
EditedObject = issue;
// Prevent accessing issues from sites other than current site
if (issue.IssueSiteID != SiteContext.CurrentSiteID)
{
RedirectToResourceNotAvailableOnSite("Issue with ID " + issueId);
}
// Issue is the main A/B test issue
isMainABTestIssue = issue.IssueIsABTest && !issue.IssueIsVariant;
if (isMainABTestIssue)
{
// Initialize variant selector in the filter
fltOpenedBy.IssueId = issue.IssueID;
if (RequestHelper.IsPostBack())
{
// Get issue ID from variant selector
issueId = fltOpenedBy.IssueId;
}
// Reset ID for main issue, grid will show data from main and winner variant issues
if (issueId == issue.IssueID)
{
issueId = 0;
}
}
var where = new WhereCondition();
if (issueId > 0)
{
where.Where("IssueID", QueryOperator.Equals, issueId);
}
where.And(new WhereCondition(fltOpenedBy.WhereCondition));
UniGrid.QueryParameters = where.Parameters;
UniGrid.WhereCondition = where.WhereCondition;
UniGrid.Pager.DefaultPageSize = PAGESIZE;
UniGrid.Pager.ShowPageSize = false;
UniGrid.FilterLimit = 1;
UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound;
UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload;
}
示例5: GetRecycleBinSeletedItems
private DataSet GetRecycleBinSeletedItems(BinSettingsContainer settings, string columns)
{
var where = new WhereCondition();
switch (settings.CurrentWhat)
{
case What.AllObjects:
if (IsSingleSite)
{
where.WhereNull("VersionObjectSiteID");
}
if (settings.Site != null)
{
where.Or().WhereEquals("VersionObjectSiteID", settings.Site.SiteID);
}
// Wrap filter condition with brackets
where.Where(new WhereCondition(filter.WhereCondition) { WhereIsComplex = true });
where = GetWhereCondition(where);
break;
case What.SelectedObjects:
// Restore selected objects
var toRestore = settings.SelectedItems;
where.WhereIn("VersionID", toRestore);
break;
}
return ObjectVersionHistoryInfoProvider.GetRecycleBin(where.ToString(true), OrderBy, -1, columns);
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:30,代码来源:ObjectsRecycleBin.ascx.cs
示例6: Delete
/// <summary>
/// Deletes activities.
/// </summary>
private void Delete(object parameter)
{
var whereCondition = new WhereCondition(WhereCondition);
try
{
var restrictedSitesCondition = CheckSitePermissions(whereCondition);
DeleteActivities(whereCondition.Where(restrictedSitesCondition));
}
catch (ThreadAbortException ex)
{
string state = ValidationHelper.GetString(ex.ExceptionState, string.Empty);
if (state != CMSThread.ABORT_REASON_STOP)
{
LogExceptionToEventLog(ex);
}
}
catch (Exception ex)
{
LogExceptionToEventLog(ex);
}
}
示例7: GetWhereCondition
/// <summary>
/// Creates where condition for SKUs listing.
/// </summary>
private WhereCondition GetWhereCondition()
{
// Display ONLY products - not product options
var where = new WhereCondition().WhereNull("SKUOptionCategoryID");
// Select only products without documents
if ((NodeID <= 0) && DisplayTreeInProducts)
{
where.WhereNotIn("SKUID", SKUInfoProvider.GetSKUs().Column("SKUID").From("View_CMS_Tree_Joined").WhereNotNull("NodeSKUID").And().WhereEquals("NodeSiteID", SiteContext.CurrentSiteID));
}
// Ordinary user can see only product from departments he can access
var cui = MembershipContext.AuthenticatedUser;
if (!cui.IsGlobalAdministrator && !cui.IsAuthorizedPerResource("CMS.Ecommerce", "AccessAllDepartments"))
{
where.Where(w => w.WhereNull("SKUDepartmentID").Or().WhereIn("SKUDepartmentID", new IDQuery<UserDepartmentInfo>("DepartmentID").WhereEquals("UserID", cui.UserID)));
}
// Reflect "Allow global products" setting
var siteWhere = new WhereCondition().WhereEquals("SKUSiteID", SiteContext.CurrentSiteID);
if (AllowGlobalObjects)
{
siteWhere.Or().WhereNull("SKUSiteID");
}
return where.Where(siteWhere);
}
示例8: ReloadData
/// <summary>
/// Reloads the data in the selector.
/// </summary>
/// <param name="reloadUniSelector">If true, UniSelector is also reloaded</param>
public void ReloadData(bool reloadUniSelector = false)
{
uniSelector.IsLiveSite = IsLiveSite;
var where = new WhereCondition();
if (OnlyDocumentTypes)
{
where.WhereEquals("ClassIsDocumentType", 1);
}
else if (OnlyCustomTables)
{
where.WhereEquals("ClassIsCustomTable", 1);
}
if (mSiteId != null)
{
where.WhereIn("ClassID", ClassSiteInfoProvider.GetClassSites().Column("ClassID").WhereEquals("SiteID", mSiteId));
}
// Combine default where condition with external
if (!String.IsNullOrEmpty(WhereCondition))
{
where.Where(WhereCondition);
}
uniSelector.WhereCondition = where.ToString(true);
if (reloadUniSelector)
{
uniSelector.Reload(true);
}
}
示例9: 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);
}
示例10: LoadWebParts
/// <summary>
/// Reloads the web part list.
/// </summary>
/// <param name="forceLoad">if set to <c>true</c>, reload the control even if the control has been already loaded</param>
protected void LoadWebParts(bool forceLoad)
{
if (!dataLoaded || forceLoad)
{
var repeaterWhere = new WhereCondition();
/* The order is category driven => first level category display name is used for all nodes incl. sub-nodes */
string categoryOrder = @"
(SELECT CMS_WebPartCategory.CategoryDisplayName FROM CMS_WebPartCategory
WHERE CMS_WebPartCategory.CategoryPath = (CASE WHEN (CHARINDEX('/', ObjectPath, 0) > 0) AND (CHARINDEX('/', ObjectPath, CHARINDEX('/', ObjectPath, 0) + 1) = 0)
THEN ObjectPath
ELSE SUBSTRING(ObjectPath, 0, LEN(ObjectPath) - (LEN(ObjectPath) - CHARINDEX('/', ObjectPath, CHARINDEX('/', ObjectPath, 0) + 1)))
END))
";
// Set query repeater
repItems.SelectedColumns = " ObjectID, DisplayName, ObjectType, ParentID, ThumbnailGUID, IconClass, ObjectLevel, WebPartDescription, WebPartSkipInsertProperties";
repItems.OrderBy = categoryOrder + ", ObjectType DESC, DisplayName";
// Setup the where condition
if (SelectedCategory == CATEGORY_RECENTLY_USED)
{
// Recently used category
RenderRecentlyUsedWebParts(true);
}
else
{
// Specific web part category
int selectedCategoryId = ValidationHelper.GetInteger(SelectedCategory, 0);
if (selectedCategoryId > 0)
{
WebPartCategoryInfo categoryInfo = WebPartCategoryInfoProvider.GetWebPartCategoryInfoById(selectedCategoryId);
if (categoryInfo != null)
{
string firstLevelCategoryPath = String.Empty;
// Select also all subcategories (using "/%")
string categoryPath = categoryInfo.CategoryPath;
if (!categoryPath.EndsWith("/"))
{
categoryPath += "/";
}
// Do not limit items if not root category is selected
if (!categoryInfo.CategoryPath.EqualsCSafe("/"))
{
limitItems = false;
}
// Get all web parts for the selected category and its subcategories
if (categoryPath.EqualsCSafe("/"))
{
repeaterWhere.Where(repItems.WhereCondition).Where(w => w
.WhereEquals("ObjectType", "webpart")
.Or()
.WhereEquals("ObjectLevel", 1)
).Where(w => w
.WhereEquals("ParentID", selectedCategoryId)
.Or()
.WhereIn("ParentID", WebPartCategoryInfoProvider.GetCategories().WhereStartsWith("CategoryPath", categoryPath))
);
// Set caching for query repeater
repItems.ForceCacheMinutes = true;
repItems.CacheMinutes = 24 * 60;
repItems.CacheDependencies = "cms.webpart|all\ncms.webpartcategory|all";
// Show Recently used category
RenderRecentlyUsedWebParts(false);
}
else
{
// Prepare where condition -- the part that restricts web parts
repeaterWhere.WhereEquals("ObjectType", "webpart")
.Where(w => w
.WhereEquals("ParentID", selectedCategoryId)
.Or()
.WhereIn("ParentID", WebPartCategoryInfoProvider.GetCategories().WhereStartsWith("CategoryPath", categoryPath))
);
// Get first level category path
firstLevelCategoryPath = categoryPath.Substring(0, categoryPath.IndexOf('/', 2));
var selectedCategoryWhere = new WhereCondition();
// Distinguish special categories
if (categoryPath.StartsWithCSafe(CATEGORY_UIWEBPARTS, true))
{
if (!categoryPath.EqualsCSafe(firstLevelCategoryPath + "/", true))
{
// Currently selected category is one of subcategories
string specialCategoryPath = firstLevelCategoryPath;
firstLevelCategoryPath = categoryPath.Substring(CATEGORY_UIWEBPARTS.Length + 1).TrimEnd('/');
selectedCategoryWhere.WhereEquals("ObjectPath", specialCategoryPath + "/" + firstLevelCategoryPath);
}
else
//.........这里部分代码省略.........
示例11: GenerateWhereCondition
/// <summary>
/// Generates complete filter where condition.
/// </summary>
private string GenerateWhereCondition()
{
var whereCondition = new WhereCondition();
// Create WHERE condition for basic filter
int contactStatus = ValidationHelper.GetInteger(fltContactStatus.Value, -1);
if (fltContactStatus.Value == null)
{
whereCondition = whereCondition.WhereNull("ContactStatusID");
}
else if (contactStatus > 0)
{
whereCondition = whereCondition.WhereEquals("ContactStatusID", contactStatus);
}
whereCondition = whereCondition
.Where(fltFirstName.GetCondition())
.Where(fltLastName.GetCondition())
.Where(fltEmail.GetCondition());
// Only monitored contacts
if (radMonitored.SelectedIndex == 1)
{
whereCondition = whereCondition.WhereTrue("ContactMonitored");
}
// Only not monitored contacts
else if (radMonitored.SelectedIndex == 2)
{
whereCondition = whereCondition.WhereEqualsOrNull("ContactMonitored", 0);
}
// Only contacts that were replicated to SalesForce leads
if (radSalesForceLeadReplicationStatus.SelectedIndex == 1)
{
whereCondition = whereCondition.WhereNotNull("ContactSalesForceLeadID");
}
// Only contacts that were not replicated to SalesForce leads
else if (radSalesForceLeadReplicationStatus.SelectedIndex == 2)
{
whereCondition = whereCondition.WhereNull("ContactSalesForceLeadID");
}
// Create WHERE condition for advanced filter (id needed)
if (IsAdvancedMode)
{
whereCondition = whereCondition
.Where(fltMiddleName.GetCondition())
.Where(fltCity.GetCondition())
.Where(fltPhone.GetCondition())
.Where(fltCreated.GetCondition())
.Where(GetOwnerCondition(fltOwner))
.Where(GetCountryCondition(fltCountry))
.Where(GetStateCondition(fltState));
if (!String.IsNullOrEmpty(txtIP.Text))
{
var nestedIpQuery = IPInfoProvider.GetIps().WhereLike("IPAddress", SqlHelper.EscapeLikeText(SqlHelper.EscapeQuotes(txtIP.Text)));
whereCondition = whereCondition.WhereIn("ContactID", nestedIpQuery.Column("IPOriginalContactID")).Or().WhereIn("ContactID", nestedIpQuery.Column("IPActiveContactID"));
}
}
// When "merged/not merged" filter is hidden or in advanced mode display contacts according to filter or in basic mode don't display merged contacts
if ((HideMergedFilter && NotMerged) ||
(IsAdvancedMode && !HideMergedFilter && !chkMerged.Checked) ||
(!HideMergedFilter && !NotMerged && !IsAdvancedMode))
{
whereCondition = whereCondition
.Where(
new WhereCondition(
new WhereCondition()
.WhereNull("ContactMergedWithContactID")
.WhereGreaterOrEquals("ContactSiteID", 0)
)
.Or(
new WhereCondition()
.WhereNull("ContactGlobalContactID")
.WhereNull("ContactSiteID")
));
}
// Hide contacts merged into global contact when displaying list of available contacts for global contact
if (HideMergedIntoGlobal)
{
whereCondition = whereCondition.WhereNull("ContactGlobalContactID");
}
if (!DisableGeneratingSiteClause)
{
// Filter by site
if (!plcSite.Visible)
{
// Filter site objects
if (SiteID > 0)
{
whereCondition = whereCondition.WhereEquals("ContactSiteID", SiteID);
}
//.........这里部分代码省略.........
示例12: GenerateWhereCondition
/// <summary>
/// Creates where condition according to values selected in filter.
/// </summary>
private WhereCondition GenerateWhereCondition()
{
var where = new WhereCondition();
string productNameColumnName = (ParentNode != null) ? "DocumentName" : "SKUName";
// Append name/number condition
var nameOrNumber = txtNameOrNumber.Text.Trim().Truncate(txtNameOrNumber.MaxLength);
if (!string.IsNullOrEmpty(nameOrNumber))
{
// condition to get also products with variants that contains
where.Where(k => k.Where(w => w.WhereContains(productNameColumnName, nameOrNumber)
.Or()
.WhereContains("SKUNumber", nameOrNumber))
.Or()
.Where(v => v.WhereIn("SKUID", new IDQuery<SKUInfo>("SKUParentSKUID").WhereContains("SKUName", nameOrNumber)
.Or()
.WhereContains("SKUNumber", nameOrNumber))));
}
// Append site condition
if (allowGlobalProducts && (siteElem.SiteID != UniSelector.US_GLOBAL_AND_SITE_RECORD))
{
// Restrict SKUSiteID only for products not for product section (full listing mode)
int selectedSiteID = (siteElem.SiteID > 0) ? siteElem.SiteID : 0;
where.Where(w => w.Where("ISNULL(SKUSiteID, 0) = " + selectedSiteID).Or().WhereNull("SKUID"));
}
// Append department condition
if (departmentElem.SelectedID > 0)
{
where.WhereEquals("SKUDepartmentID", departmentElem.SelectedID);
}
else if (departmentElem.SelectedID == -5)
{
where.WhereNull("SKUDepartmentID");
}
// Append one level condition
if (ParentNode != null)
{
if (!chkShowAllChildren.Checked)
{
where.WhereEquals("NodeParentID", ParentNode.NodeID).And().WhereEquals("NodeLevel", ParentNode.NodeLevel + 1);
}
}
// Handle advanced mode fields
if (IsAdvancedMode)
{
// Append product type condition
if ((selectProductTypeElem.Value != null) && (selectProductTypeElem.Value.ToString() != "ALL"))
{
where.WhereEquals("SKUProductType", selectProductTypeElem.Value);
}
// Manufacturer value
if (manufacturerElem.SelectedID != UniSelector.US_ALL_RECORDS)
{
where.Where("ISNULL(SKUManufacturerID, 0) = " + manufacturerElem.SelectedID);
}
// Supplier value
if (supplierElem.SelectedID != UniSelector.US_ALL_RECORDS)
{
where.Where("ISNULL(SKUSupplierID, 0) = " + supplierElem.SelectedID);
}
// Internal status value
if (internalStatusElem.SelectedID != UniSelector.US_ALL_RECORDS)
{
where.Where("ISNULL(SKUInternalStatusID, 0) = " + internalStatusElem.SelectedID);
}
// Store status value
if (publicStatusElem.SelectedID != UniSelector.US_ALL_RECORDS)
{
where.Where("ISNULL(SKUPublicStatusID, 0) = " + publicStatusElem.SelectedID);
}
// Append needs shipping condition
int needsShipping = ValidationHelper.GetInteger(ddlNeedsShipping.SelectedValue, -1);
if (needsShipping >= 0)
{
where.Where("ISNULL(SKUNeedsShipping, 0) = " + needsShipping);
}
// Append allow for sale condition
int allowForSale = ValidationHelper.GetInteger(ddlAllowForSale.SelectedValue, -1);
if (allowForSale >= 0)
{
where.WhereEquals("SKUEnabled", allowForSale);
}
// When in document mode
if (ParentNode != null)
{
//.........这里部分代码省略.........
示例13: GetWhereCondition
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);
}
示例14: ReloadData
/// <summary>
/// Reloads the data in the selector.
/// </summary>
public void ReloadData()
{
uniSelector.IsLiveSite = IsLiveSite;
if (!DisplayNoDataMessage)
{
uniSelector.ZeroRowsText = string.Empty;
}
// Need to set uni-selector value again after basic form reload
if (AllowMultipleChoice)
{
uniSelector.Value = mMultipleChoiceValue;
}
var where = new WhereCondition();
if (ProductOptionCategoryID > 0)
{
where.WhereEquals("SKUOptionCategoryID", ProductOptionCategoryID);
}
else
{
var productSiteWhere = new WhereCondition();
// Add global products
if (DisplayGlobalProducts)
{
productSiteWhere.Where(w => w.WhereNull("SKUOptionCategoryID")
.WhereNull("SKUSiteID"));
}
// Add site specific products
if (DisplaySiteProducts)
{
productSiteWhere.Or().Where(w => w.WhereNull("SKUOptionCategoryID")
.WhereEquals("SKUSiteID", SiteID));
}
where.Where(productSiteWhere);
}
// Exclude standard products if needed
if (!DisplayStandardProducts)
{
where.WhereNotEquals("SKUProductType", SKUProductTypeEnum.Product.ToStringRepresentation());
}
// Exclude memberships if needed
if (!DisplayMemberships)
{
where.WhereNotEquals("SKUProductType", SKUProductTypeEnum.Membership.ToStringRepresentation());
}
// Exclude e-products if needed
if (!DisplayEproducts)
{
where.WhereNotEquals("SKUProductType", SKUProductTypeEnum.EProduct.ToStringRepresentation());
}
// Exclude donations if needed
if (!DisplayDonations)
{
where.WhereNotEquals("SKUProductType", SKUProductTypeEnum.Donation.ToStringRepresentation());
}
// Exclude bundles if needed
if (!DisplayBundles)
{
where.WhereNotEquals("SKUProductType", SKUProductTypeEnum.Bundle.ToStringRepresentation());
}
// Exclude products with product options if needed
if (DisplayOnlyProductsWithoutOptions)
{
where.WhereNotIn("SKUID", new IDQuery<SKUOptionCategoryInfo>("SKUID"));
}
if (DisplayProductOptions && (ProductOptionCategoryID <= 0))
{
var optionsSiteWhere = new WhereCondition();
// Add global options
if (DisplayGlobalOptions)
{
optionsSiteWhere.Where(w => w.WhereNotNull("SKUOptionCategoryID")
.WhereNull("SKUSiteID"));
}
// Add site specific options
if (DisplaySiteOptions)
{
optionsSiteWhere.Or().Where(w => w.WhereNotNull("SKUOptionCategoryID")
.WhereEquals("SKUSiteID", SiteID));
}
where.Or().Where(optionsSiteWhere);
where = new WhereCondition().Where(where);
//.........这里部分代码省略.........
示例15: GetRelationshipNameCondition
/// <summary>
/// Gets where condition for selecting relationship names
/// </summary>
private WhereCondition GetRelationshipNameCondition()
{
var relationshipNameCondition = new WhereCondition();
if (!UseAdHocRelationshipName)
{
relationshipNameCondition.Where(new WhereCondition().WhereFalse("RelationshipNameIsAdHoc").Or().WhereNull("RelationshipNameIsAdHoc"));
if (!String.IsNullOrEmpty(RelationshipName))
{
relationshipNameCondition.WhereEquals("RelationshipName", RelationshipName);
}
}
else
{
relationshipNameCondition.WhereEquals("RelationshipName", AdHocRelationshipName);
}
return relationshipNameCondition;
}