예제 #1
0
        public ActionResult SubscribeTour(TourShow tourShow)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    foreach (var value in ModelState.Values.ToList())
                    {
                        foreach (var error in value.Errors)
                        {
                            ModelState.AddModelError(string.Empty, error.ErrorMessage);
                        }
                    }
                    tourShow.IsTripBooked = false;
                    return(PartialView("_Coming Soon", tourShow));
                }

                tourShow.IsTripBooked = true;
                if (tourShow.MailingListID != null)
                {
                    AuthenticationDetails auth          = new ApiKeyAuthenticationDetails(ConfigurationManager.AppSettings["CampaignMonitorAPI_key"]);
                    Subscriber            objSubscriber = new Subscriber(auth, tourShow.MailingListID);
                    string newSubscriberID = objSubscriber.Add(tourShow.EmailToSubscribe.ToString(), null, null, false);
                }

                return(PartialView("_Coming Soon", tourShow));
            }
            catch (Exception e)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(e);
                return(PartialView("_Coming Soon"));
            }
        }
예제 #2
0
        private ViewResult TourView(TourShow tourShow)
        {
            if (ViewExists(tourShow.Permalink))
            {
                return(View(tourShow.Permalink, tourShow));
            }

            var typeName = tourShow.TourType.Name;//ViewExists(typeName) ? typeName : "Show", tourShow)

            return(View("Show", tourShow));
        }