/// <summary>
        /// Initializes the ListView bag.
        /// </summary>
        /// <param name="redirectPageUrl">The redirect page URL.</param>
        protected virtual void InitializeListViewBag(string redirectPageUrl)
        {
            var timezoneInfo = UserManager.GetManager().GetUserTimeZone();

            this.ViewBag.WidgetId       = EventSchedulerHelper.GetWidgetId(this);
            this.ViewBag.DetailsPageId  = this.DetailsPageId == Guid.Empty ? (SiteMapBase.GetActualCurrentNode() == null ? Guid.Empty : SiteMapBase.GetActualCurrentNode().Id) : this.DetailsPageId;
            this.ViewBag.UiCulture      = SystemManager.CurrentContext.AppSettings.Multilingual ? CultureInfo.CurrentUICulture.ToString() : string.Empty;
            this.ViewBag.TimeZoneOffset = timezoneInfo.BaseUtcOffset.TotalMilliseconds.ToString();
            this.ViewBag.TimeZoneId     = timezoneInfo.Id;
        }
Example #2
0
        public ActionResult GetCalendars(EventsFilter filter)
        {
            JsonResult json = new JsonResult()
            {
                JsonRequestBehavior = System.Web.Mvc.JsonRequestBehavior.AllowGet,
                MaxJsonLength       = int.MaxValue
            };

            Guard.ArgumentNotNull(filter, "filter");

            var eventSchedulerModel = EventSchedulerHelper.LoadModel(filter.Id, filter.UICulture, filter.CurrentPageId);

            if (eventSchedulerModel != null)
            {
                json.Data = eventSchedulerModel.GetCalendars(filter);
            }

            return(json);
        }
Example #3
0
        /// <summary>
        /// Initializes the ListView bag.
        /// </summary>
        /// <param name="redirectPageUrl">The redirect page URL.</param>
        protected virtual void InitializeListViewBag(string redirectPageUrl)
        {
            var timezoneInfo = UserManager.GetManager().GetUserTimeZone();

            this.ViewBag.IsRtl = EventSchedulerHelper.IsRtl();

            if (this.HttpContext != null && this.HttpContext.Items.Contains("versionpreview") && this.HttpContext.Items["versionpreview"].ToString().ToLowerInvariant() == "true")
            {
                this.ViewBag.WidgetId = EventSchedulerHelper.GetWidgetId(this);
            }
            else
            {
                this.ViewBag.WidgetId = this.ViewData["controlDataId"];
            }

            this.ViewBag.CurrentPageId = this.GetPageId();

            this.ViewBag.DetailsPageId  = this.DetailsPageId == Guid.Empty ? (SiteMapBase.GetActualCurrentNode() == null ? Guid.Empty : SiteMapBase.GetActualCurrentNode().Id) : this.DetailsPageId;
            this.ViewBag.UiCulture      = SystemManager.CurrentContext.AppSettings.Multilingual ? CultureInfo.CurrentUICulture.ToString() : string.Empty;
            this.ViewBag.TimeZoneOffset = timezoneInfo.BaseUtcOffset.TotalMilliseconds.ToString();
            this.ViewBag.TimeZoneId     = timezoneInfo.Id;
        }