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);
			}
		}
		public void AssignSettings(CalendarViewSettings settings) {
			if (settings != null) {
				this.SiteID = settings.SiteID;
				this.AlternateViewFile = settings.AlternateViewFile;
				this.GenerateCss = settings.GenerateCss;
				this.StyleSheetPath = settings.SpecifiedCssFile;
			}
		}
		public SettingsManager()
		{
			WallbinViewSettings = new WallbinViewSettings();
			WallbinButtonsSettings = new WallbinButtonsSettings();
			CalendarViewSettings = new CalendarViewSettings();
			ProgramScheduleSettings = new ProgramScheduleSettings();
			EmailBinSettings = new EmailBinSettings();
			LinkLaunchSettings = new LinkLaunchSettings();
			KeyWordFilters = new KeyWordFileFilters();
		}
예제 #4
0
 public void AssignSettings(CalendarViewSettings settings)
 {
     if (settings != null)
     {
         this.SiteID            = settings.SiteID;
         this.AlternateViewFile = settings.AlternateViewFile;
         this.GenerateCss       = settings.GenerateCss;
         this.StyleSheetPath    = settings.SpecifiedCssFile;
     }
 }
예제 #5
0
        public CalendarViewSettings ConvertSettings(CalendarDisplaySettings obj)
        {
            CalendarViewSettings settings = new CalendarViewSettings();

            if (obj != null)
            {
                settings.SiteID            = obj.SiteID;
                settings.AlternateViewFile = obj.AlternateViewFile;
                settings.GenerateCss       = obj.GenerateCss;
                settings.SpecifiedCssFile  = obj.SpecifiedCssFile;
            }

            return(settings);
        }
예제 #6
0
        public CalendarViewSettings GetSettings()
        {
            CalendarViewSettings settings = new CalendarViewSettings();

            if (!String.IsNullOrEmpty(this.SerialSettings))
            {
                string        sXML          = Utils.DecodeBase64(this.SerialSettings);
                XmlSerializer xmlSerializer = new XmlSerializer(typeof(CalendarViewSettings));
                using (StringReader stringReader = new StringReader(sXML)) {
                    settings = (CalendarViewSettings)xmlSerializer.Deserialize(stringReader);
                }
            }

            return(settings);
        }
예제 #7
0
        public void SetSettings(CalendarDisplaySettings obj)
        {
            string sXML = String.Empty;

            if (obj != null)
            {
                CalendarViewSettings settings = ConvertSettings(obj);

                XmlSerializer xmlSerializer = new XmlSerializer(typeof(CalendarViewSettings));

                using (StringWriter stringWriter = new StringWriter()) {
                    xmlSerializer.Serialize(stringWriter, settings);
                    sXML = stringWriter.ToString();
                    sXML = Utils.EncodeBase64(sXML);
                }
            }

            this.SerialSettings = sXML;
        }
예제 #8
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));
            }
        }
		public CalendarViewSettings ConvertSettings(CalendarDisplaySettings obj) {
			CalendarViewSettings settings = new CalendarViewSettings();

			if (obj != null) {
				settings.SiteID = obj.SiteID;
				settings.AlternateViewFile = obj.AlternateViewFile;
				settings.GenerateCss = obj.GenerateCss;
				settings.SpecifiedCssFile = obj.SpecifiedCssFile;
			}

			return settings;
		}
		public CalendarViewSettings GetSettings() {
			CalendarViewSettings settings = new CalendarViewSettings();

			if (!String.IsNullOrEmpty(this.SerialSettings)) {
				string sXML = Utils.DecodeBase64(this.SerialSettings);
				XmlSerializer xmlSerializer = new XmlSerializer(typeof(CalendarViewSettings));
				using (StringReader stringReader = new StringReader(sXML)) {
					settings = (CalendarViewSettings)xmlSerializer.Deserialize(stringReader);
				}
			}

			return settings;
		}