コード例 #1
0
        public ActionResult CalendarDisplay(CalendarViewModel model)
        {
            CalendarViewSettings settings = new CalendarViewSettings();

            if (!String.IsNullOrEmpty(model.SerialSettings))
            {
                settings = model.GetSettings();

                model.AssignSettings(settings);
            }
            else
            {
                CalendarDisplaySettings payload = new CalendarDisplaySettings();

                if (this.WidgetPayload is CalendarDisplaySettings)
                {
                    payload = (CalendarDisplaySettings)this.WidgetPayload;
                    payload.LoadData();

                    settings = model.ConvertSettings(payload);
                    model.AssignSettings(settings);

                    model.SetSettings(payload);
                }
            }

            ModelState.Clear();

            model.LoadData(settings.SiteID, true);

            if (String.IsNullOrEmpty(settings.AlternateViewFile))
            {
                return(PartialView(model));
            }
            else
            {
                return(PartialView(settings.AlternateViewFile, model));
            }
        }