Пример #1
0
        public ActionResult Show(int id)
        {
            var campaign = this.campaignService.Get(id);

            var applicableMembers = this.searchService.RunCampaign(id);

            var model = new CampaignShowViewModel(Resources.Literal_ShowCampaign)
                            {
                                Campaign = campaign,
                                SearchFilters = this.memberSearchFilterService.ForCampaign(id).Select(
                                m =>
                                    new MemberSearchFilterViewModel
                                        {
                                            MemberSearchFilterId = m.Id,
                                            CampaignId = campaign.Id,
                                            CriteriaDisplayText = SearchCriteria.Create(m.InternalName,
                                                                            m.DisplayName,
                                                                            (SearchFieldType)m.FilterType,
                                                                            (SearchOperator)m.SearchOperator,
                                                                            m.Value
                                                                      ).ToFriendlyDisplayString()
                                        }).ToList(),
                                NoSearchFiltersText = Resources.Literal_NoSearchFiltersText,
                                NoMatchingMembersText = Resources.Literal_NoMatchingMembersText,
                                ApplicableMembers = applicableMembers.ToList()
                            };

            return View(model);
        }
Пример #2
0
 public ActionResult Show(CampaignShowViewModel campaignViewModel)
 {
     var campaign = campaignViewModel.Campaign;
     this.campaignService.Update(campaign);
     return RedirectToAction("Show", new { id = campaign.Id });
 }
Пример #3
0
 public ActionResult Create()
 {
     var model = new CampaignShowViewModel(Resources.Literal_CreateCampaign)
                     {
                         Campaign = new Campaign
                                        {
                                            Name = "New Campaign"
                                        }
                     };
     return View("Show", model);
 }