当前位置: 首页>>代码示例>>C#>>正文


C# WhereCondition.And方法代码示例

本文整理汇总了C#中WhereCondition.And方法的典型用法代码示例。如果您正苦于以下问题:C# WhereCondition.And方法的具体用法?C# WhereCondition.And怎么用?C# WhereCondition.And使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WhereCondition的用法示例。


在下文中一共展示了WhereCondition.And方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        PageTitle.TitleText = GetString("newsletter_issue_openedby.title");

        var issue = (IssueInfo)EditedObject;
        issueID = issue.IssueID;

        // Do not show page if reports are not available
        if (issue.IssueSentEmails <= 0)
        {
            ShowInformation(GetString("newsletter.issue.overviewnotsentyet"));
            UniGrid.Visible = false;
            fltOpenedBy.Visible = false;
            return;
        }

        // 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 whereCondition = new WhereCondition(fltOpenedBy.WhereCondition);

        if (issueID > 0)
        {
            whereCondition.And(w => w.WhereEquals("OpenedEmailIssueID", issueID));
        }

        UniGrid.WhereCondition = whereCondition.ToString(true);
        UniGrid.Pager.DefaultPageSize = PAGESIZE;
        UniGrid.Pager.ShowPageSize = false;
        UniGrid.FilterLimit = 1;
        UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound;
        UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload;

        UniGrid.ZeroRowsText = GetString("newsletter.issue.noopenmails");
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:58,代码来源:Newsletter_Issue_OpenedBy.aspx.cs

示例2: 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;
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:53,代码来源:Newsletter_Issue_OpenedBy.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        PageTitle.TitleText = GetString("newsletter_issue_subscribersclicks.title");
        linkId = QueryHelper.GetInteger("linkid", 0);
        if (linkId == 0)
        {
            RequestHelper.EndResponse();
        }

        LinkInfo link = LinkInfoProvider.GetLinkInfo(linkId);
        EditedObject = link;

        IssueInfo issue = IssueInfoProvider.GetIssueInfo(link.LinkIssueID);
        EditedObject = issue;

        // Prevent accessing issues from sites other than current site
        if (issue.IssueSiteID != SiteContext.CurrentSiteID)
        {
            RedirectToResourceNotAvailableOnSite("Issue with ID " + link.LinkIssueID);
        }

        var listingWhereCondition = new WhereCondition().Where("LinkID", QueryOperator.Equals, linkId);

        // Link's issue is the main A/B test issue
        if (issue.IssueIsABTest && !issue.IssueIsVariant)
        {
            // Get A/B test and its winner issue ID
            ABTestInfo test = ABTestInfoProvider.GetABTestInfoForIssue(issue.IssueID);
            if (test != null)
            {
                // Get ID of the same link from winner issue
                var winnerLink = LinkInfoProvider.GetLinks()
                                                 .WhereEquals("LinkIssueID", test.TestWinnerIssueID)
                                                 .WhereEquals("LinkTarget", link.LinkTarget)
                                                 .WhereEquals("LinkDescription", link.LinkDescription)
                                                 .TopN(1)
                                                 .Column("LinkID")
                                                 .FirstOrDefault();

                if (winnerLink != null)
                {
                    if (winnerLink.LinkID > 0)
                    {
                        // Add link ID of winner issue link
                        listingWhereCondition.Or(new WhereCondition().Where("LinkID", QueryOperator.Equals, winnerLink.LinkID));
                    }
                }
            }
        }
        var filterCondition = new WhereCondition(fltOpenedBy.WhereCondition)
        {
            // True ensures that where condition will be placed into brackets when combining with different WHERE condition
            WhereIsComplex = true
        };
        listingWhereCondition.And(filterCondition);

        UniGrid.WhereCondition = listingWhereCondition.WhereCondition;
        UniGrid.QueryParameters = listingWhereCondition.Parameters;
        UniGrid.Pager.DefaultPageSize = PAGESIZE;
        UniGrid.Pager.ShowPageSize = false;
        UniGrid.FilterLimit = 1;
        UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound;
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:63,代码来源:Newsletter_Issue_SubscribersClicks.aspx.cs

示例4: GenerateWhereCondition

    /// <summary>
    /// Creates where condition according to values selected in filter.
    /// </summary>
    private WhereCondition GenerateWhereCondition()
    {
        var where = new WhereCondition();

        where.And().Where(fltTaskTitle.GetCondition());

        TaskTypeEnum taskType = (TaskTypeEnum)taskTypeSelector.Value.ToInteger(0);
        if (taskType != TaskTypeEnum.All)
        {
            where.WhereStartsWith("TaskType", TaskHelper.GetTaskTypeString(taskType));
        }

        fltTimeBetween.Column = "TaskTime";
        where.Where(fltTimeBetween.GetCondition());
        var selected = ValidationHelper.GetInteger(userSelector.Value, -1);
        GetStagingTasksByUser(where, selected);

        var taskGroupSelected = ValidationHelper.GetInteger(stagingTaskGroupSelector.Value, -1);
        GetStagingTasksByTaskGroup(where, taskGroupSelected);

        return where;
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:25,代码来源:StagingTasksFilter.ascx.cs


注:本文中的WhereCondition.And方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。