コード例 #1
0
        public ActionResult Show(string id)
        {
            var shownEvent = CronofyHelper.ReadEvents().First(x => x.EventUid == id);

            ViewData["calendarName"] = CronofyHelper.GetCalendars().First(x => x.CalendarId == shownEvent.CalendarId).Name;
            ViewData["google_maps_embed_api_key"] = ConfigurationManager.AppSettings["google_maps_embed_api_key"];

            return(View("Show", shownEvent));
        }
コード例 #2
0
        public ActionResult Edit(string id)
        {
            var gotEvent = CronofyHelper.ReadEvents().First(x => x.EventUid == id);

            var editEvent = new Models.Event
            {
                Calendar   = CronofyHelper.GetCalendars().First(x => x.CalendarId == gotEvent.CalendarId),
                CalendarId = gotEvent.CalendarId,

                EventId             = gotEvent.EventId,
                Summary             = gotEvent.Summary,
                Description         = gotEvent.Description,
                Start               = (gotEvent.Start.HasTime ? gotEvent.Start.DateTimeOffset.DateTime : gotEvent.Start.Date.DateTime),
                End                 = (gotEvent.End.HasTime ? gotEvent.End.DateTimeOffset.DateTime : gotEvent.End.Date.DateTime),
                LocationDescription = gotEvent.Location == null ? null : gotEvent.Location.Description,
                Latitude            = gotEvent.Location == null ? null : gotEvent.Location.Latitude,
                Longitude           = gotEvent.Location == null ? null : gotEvent.Location.Longitude
            };

            return(View("Edit", editEvent));
        }