本文整理汇总了C#中WhereCondition.WhereNotIn方法的典型用法代码示例。如果您正苦于以下问题:C# WhereCondition.WhereNotIn方法的具体用法?C# WhereCondition.WhereNotIn怎么用?C# WhereCondition.WhereNotIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhereCondition
的用法示例。
在下文中一共展示了WhereCondition.WhereNotIn方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupSourceLanguageDropDownWhereCondition
/// <summary>
/// Setups source language drop down list control.
/// </summary>
/// <param name="targetCultures">List of target cultures which should not be in te source selector</param>
private void SetupSourceLanguageDropDownWhereCondition(HashSet<string> targetCultures)
{
var condition = new WhereCondition();
if (targetCultures.Count > 0)
{
condition.WhereNotIn("CultureCode", targetCultures.ToList());
}
if (NodeID > 0)
{
// Get source culture list from original node if current node is linked
var node = TreeProvider.SelectSingleNode(NodeID, TreeProvider.ALL_CULTURES, true, false);
var sourceNodeID = node.OriginalNodeID;
condition.WhereIn("CultureCode", new IDQuery("cms.document", "DocumentCulture").WhereEquals("DocumentNodeID", sourceNodeID));
}
selectCultureElem.AdditionalWhereCondition = condition.ToString(true);
}
示例2: 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);
}
示例3: GetStagingTasksByUser
private void GetStagingTasksByUser(WhereCondition where, int selected)
{
if (selected > 0)
{
// Get tasks for current user
where.WhereIn("TaskID", StagingTaskUserInfoProvider.GetTaskUsers().WhereEquals("UserID", selected).Column("TaskID"));
}
else if (selected == UniSelector.US_NONE_RECORD)
{
// Get all tasks without any assigned user
where.WhereNotIn("TaskID", StagingTaskUserInfoProvider.GetTaskUsers().Column("TaskID"));
}
}
示例4: GetStagingTasksByTaskGroup
private void GetStagingTasksByTaskGroup(WhereCondition where, int taskGroupSelected)
{
if (taskGroupSelected > 0)
{
// Get tasks for given task group
where.WhereIn("TaskID", TaskGroupTaskInfoProvider.GetTaskGroupTasks().WhereEquals("TaskGroupID", taskGroupSelected).Column("TaskID"));
}
else if (taskGroupSelected == UniSelector.US_NONE_RECORD)
{
where.WhereNotIn("TaskID", TaskGroupTaskInfoProvider.GetTaskGroupTasks().Column("TaskID"));
}
}
示例5: GetWhereCondition
/// <summary>
/// Creates where condition according to values selected in filter.
/// </summary>
public override string GetWhereCondition()
{
var where = new WhereCondition();
var oper = drpLanguage.SelectedValue.ToEnum<QueryOperator>();
var val = ValidationHelper.GetString(cultureElem.Value, null);
if (String.IsNullOrEmpty(val))
{
val = "##ANY##";
}
if (val != "##ANY##")
{
// Create base query
var tree = new TreeProvider();
var query = tree.SelectNodes()
.All()
.Column("NodeID");
switch (val)
{
case "##ALL##":
{
var cultureCount = SiteCultures.Tables[0].Rows.Count;
query.GroupBy("NodeID").Having(string.Format("(COUNT(NodeID) {0} {1})", oper.ToStringRepresentation(), cultureCount));
where.WhereIn("NodeID", query);
}
break;
default:
{
query.WhereEquals("DocumentCulture", val);
if (oper == QueryOperator.NotEquals)
{
where.WhereNotIn("NodeID", query);
}
else
{
where.WhereIn("NodeID", query);
}
}
break;
}
}
else if (oper == QueryOperator.NotEquals)
{
where.NoResults();
}
return where.ToString(true);
}
示例6: 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);
//.........这里部分代码省略.........
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (StopProcessing)
{
return;
}
// Set visibility of the target language selector
plcTargetLang.Visible = DisplayTargetlanguage;
if (DisplayTargetlanguage)
{
SetupTargetLanguageDropDownWhereCondition();
}
if (TranslationSettings != null)
{
var condition = new WhereCondition();
var targetCultures = TranslationSettings.TargetLanguages;
if (targetCultures.Count > 0)
{
condition.WhereNotIn("CultureCode", targetCultures);
}
if (NodeID > 0)
{
condition.WhereIn("CultureCode", new IDQuery("cms.document", "DocumentCulture").WhereEquals("DocumentNodeID", NodeID));
}
selectCultureElem.AdditionalWhereCondition = condition.ToString(true);
}
if (RequestHelper.IsCallback())
{
return;
}
StringBuilder sb = new StringBuilder();
sb.Append(@"
function SelectService(serviceName, displaySeparateSubmission, supportsInstructions, supportsPriority, supportsAttachments, supportsDeadline) {
var nameElem = document.getElementById('", hdnSelectedName.ClientID, @"');
if (nameElem != null) {
nameElem.value = serviceName;
}
document.getElementById('pnlSeparateSubmissions').style.display = (displaySeparateSubmission ? '' : 'none');
document.getElementById('pnlInstructions').style.display = (supportsInstructions ? '' : 'none');
document.getElementById('pnlPriority').style.display = (supportsPriority ? '' : 'none');
document.getElementById('pnlDeadline').style.display = (supportsDeadline ? '' : 'none');
document.getElementById('pnlProcessBinary').style.display = (supportsAttachments ? '' : 'none');
var selectButton = document.getElementById('rad' + serviceName);
if (selectButton != null) {
selectButton.checked = 'checked';
}
}");
ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "TranslationServiceSelector", sb.ToString(), true);
string format = "{% CultureName %}{% if (CultureCode == \"" + defaultCulture + "\") { \" \" +\"" + GetString("general.defaultchoice") + "\" } %}";
selectCultureElem.DropDownCultures.AutoPostBack = DisplayTargetlanguage;
selectCultureElem.UniSelector.DisplayNameFormat = format;
selectTargetCultureElem.UniSelector.DisplayNameFormat = format;
// Preselect 'Normal' priority
if (!URLHelper.IsPostback())
{
drpPriority.Value = 1;
}
ReloadData();
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:71,代码来源:TranslationServiceSelector.ascx.cs