Example #1
0
        /// <summary>
        /// Constructs the View Model.
        /// Initializes Calendars to Exigo.GetCalendars() using the provided CustomerID and the boolean.
        /// Initializes Event Types to Exigo.GetCalendarEventTypes().
        /// </summary>
        /// <param name="customerID">The CustomerID to pull Calendars for.</param>
        /// <param name="includeCalendarSubscriptions">True: Pull Calendars CustomerID is Subscribed to. False: Don't Pull Calendars CustomerID is subscribed to.</param>
        public CalendarViewModel(int customerID, bool includeCalendarSubscriptions)
        {
            this.Calendars = Exigo.GetCalendars(new GetCalendarsRequest
            {
                CustomerID = customerID,
                IncludeCalendarSubscriptions = includeCalendarSubscriptions
            });

            this.EventTypes = Exigo.GetCalendarEventTypes();
        }
Example #2
0
        /// <summary>
        /// Constructs the View Model.
        /// Initializes Calendars to Exigo.GetCalendars() using the provided CustomerID and includes calendar subscriptions.
        /// Initializes Event Types to Exigo.GetCalendarEventTypes().
        /// Intializes Time Zones to the result of Exigo.GetTimeZones().
        /// Initializes Privacy Types to Exigo.GetCalendarPrivacyTypes();
        /// </summary>
        /// <param name="customerID">The CustomerID to pull Calendars for.</param>
        public CalendarViewModel(int customerID)
        {
            this.Calendars = Exigo.GetCalendars(new GetCalendarsRequest
            {
                CustomerID = customerID,
                IncludeCalendarSubscriptions = true
            });

            this.EventTypes   = Exigo.GetCalendarEventTypes();
            this.PrivacyTypes = Exigo.GetCalendarEventPrivacyTypes();
        }
        public void GetCalendarID()
        {
            var mainCalendar = Exigo.GetCalendars(new GetCalendarEventsRequest()
            {
                CustomerID = Identity.Current.CustomerID
            }).Where(cal => cal.CustomerID == Identity.Current.CustomerID).FirstOrDefault();

            if (mainCalendar != null)
            {
                this.Request.CalendarID = mainCalendar.CalendarID;
            }
        }
        public ActionResult Calendar()
        {
            ViewBag.Calendars = Exigo.GetCalendars(new GetCalendarsRequest
            {
                CustomerID = Identity.Current.CustomerID,
                IncludeCalendarSubscriptions = true
            });


            // Get the event types (for the legend)
            ViewBag.CalendarEventTypes = Exigo.GetCalendarEventTypes().ToList();


            return(View());
        }
        public ActionResult ManageEvent(CalendarEvent calendarEvent)
        {
            // Get all available timezones
            ViewBag.TimeZones = Exigo.GetTimeZones();


            // Get the customer's personal calendars
            var calendars = Exigo.GetCalendars(new GetCalendarsRequest
            {
                CustomerID = Identity.Current.CustomerID,
                IncludeCalendarSubscriptions = false
            }).ToList();

            ViewBag.Calendars = calendars;


            // Get the event types
            ViewBag.CalendarEventTypes = Exigo.GetCalendarEventTypes().ToList();


            // Set some defaults for new events now that we have the calendars
            if (calendarEvent.CalendarID == Guid.Empty)
            {
                calendarEvent.CalendarID = calendars.First().CalendarID;
            }


            // Return the view
            if (Request.IsAjaxRequest())
            {
                return(PartialView("ManageEvent", calendarEvent));
            }
            else
            {
                return(View("ManageEvent", calendarEvent));
            }
        }