//[ValidateAntiForgeryToken]
 public ActionResult Jazz([Bind(Include = "Activities,Page")] PagePlusActivities pagePlusActivities)
 {
     if (ModelState.IsValid)
     {
         UpdatePagePlusActivities(pagePlusActivities, "Jazz");
         return(RedirectToAction("Jazz"));
     }
     return(View(pagePlusActivities));
 }
        // GET: Talking
        public ActionResult Talking()
        {
            Page               page               = pageRepository.GetPage("Talking", Language.Eng);
            List <Activity>    activities         = activityRepository.GetActivities(EventType.Talking, Language.Eng).ToList();
            PagePlusActivities pagePlusActivities = new PagePlusActivities
            {
                Page       = page,
                Activities = activities
            };

            return(View(pagePlusActivities));
        }
 public void UpdatePagePlusActivities(PagePlusActivities pagePlusActivities, string imgFolder)
 {
     foreach (Activity act in pagePlusActivities.Activities)
     {
         foreach (Description desc in act.ActivityDescriptions)
         {
             if (desc.ImageUrl != null && desc.ImageUrl.Contains("image/"))
             {
                 desc.ImageUrl = Saveimage(desc.ImageUrl, imgFolder);
             }
         }
         activityRepository.UpdateActivity(act);
     }
     UpdatePage(pagePlusActivities.Page, imgFolder);
 }
Beispiel #4
0
        // GET: Jazz
        public ActionResult Index(int?id)
        {
            Language language = (Language)Session["language"];
            DateTime dDay     = new DateTime(2018, 07, 26);

            if (id != null)
            {
                switch (id)
                {
                case 1:
                    dDay = new DateTime(2018, 07, 26);
                    break;

                case 2:
                    dDay = new DateTime(2018, 07, 27);
                    break;

                case 3:
                    dDay = new DateTime(2018, 07, 28);
                    break;

                case 4:
                    dDay = new DateTime(2018, 07, 29);
                    break;
                }
            }

            PagePlusActivities PageDescriptions = new PagePlusActivities();
            Page            page       = pageRepo.GetPage("Jazz", language);
            List <Activity> activities = activityRepo.GetActivities(EventType.Jazz, language, dDay).ToList();

            PageDescriptions.Page       = page;
            PageDescriptions.Activities = activities.ToList();

            PageDescriptions.SugestionActivityJazz     = SuggestieActivity(EventType.Jazz, language);
            PageDescriptions.SugestionActivityDinner   = SuggestieActivity(EventType.Dinner, language);
            PageDescriptions.SugestionActivityHistoric = SuggestieActivity(EventType.Historic, language);
            PageDescriptions.SugestionActivityTalking  = SuggestieActivity(EventType.Talking, language);

            return(View(PageDescriptions));
        }