Пример #1
0
        protected void AssertCriterias(params Campaign[] campaigns)
        {
            // Get a corresponding criteria which should simply be equivalent to an empty criteria.

            foreach (var campaign in campaigns)
            {
                var criteria = _campaignsQuery.GetCriteria(campaign.Id);
                Assert.IsNotNull(criteria);
            }
        }
Пример #2
0
        public ActionResult EditCriteria(Guid id)
        {
            // Get the campaign and criteria.

            var campaign = _campaignsQuery.GetCampaign(id);

            if (campaign == null)
            {
                return(NotFound("campaign", "id", id));
            }

            var criteria = _campaignsQuery.GetCriteria(id);

            if (criteria == null)
            {
                return(NotFound("criteria", "id", id));
            }

            return(View(CreateCampaignCriteria(campaign, criteria)));
        }
Пример #3
0
        private IList <RegisteredUser> GetUsers(Campaign campaign)
        {
            // Check the query first.

            if (!string.IsNullOrEmpty(campaign.Query))
            {
                return(_campaignCriteriaCommand.Match(campaign.Category, campaign.Query));
            }

            var criteria = _campaignsQuery.GetCriteria(campaign.Id);

            return(_campaignCriteriaCommand.Match(campaign.Category, criteria));
        }