/// <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 = ExigoDAL.GetCalendars(new GetCalendarsRequest
            {
                CustomerID = customerID,
                IncludeCalendarSubscriptions = includeCalendarSubscriptions
            });

            this.EventTypes = ExigoDAL.GetCalendarEventTypes();
        }
        /// <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 = ExigoDAL.GetCalendars(new GetCalendarsRequest
            {
                CustomerID = customerID,
                IncludeCalendarSubscriptions = true
            });

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

            if (mainCalendar != null)
            {
                this.Request.CalendarID = mainCalendar.CalendarID;
            }
        }