protected void Page_Load(object sender, EventArgs e) { if (TransitionArgument != null) { // Es handelt sich um ein Edit. Darum wird der aktuelle Datensatz geladen. Guid Id = new Guid(TransitionArgument.ToString()); _contentSchedulerHandler = new ContentSchedulerHandler(this, Id); } else { _contentSchedulerHandler = new ContentSchedulerHandler(this); } if (!ControlPostback) { if (_contentSchedulerHandler.CurrentContentEvent == null) { // Ein New. // Standardzeitpunkt: Nächster Tag. DateTime newDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); _activationDate.DateTimeValue = newDate.AddDays(1); _deleteBtn.Visible = false; } else { // Ein Edit. _activationDate.DateTimeValue = _contentSchedulerHandler.CurrentContentEvent.ActivationDate; _hintEdit.Text = _contentSchedulerHandler.CurrentContentEvent.Hint; _deleteBtn.Visible = true; } // Die Controls für New / Edit aktivieren. bool hasPage = (_contentSchedulerHandler.CurrentContentEvent != null) && !_contentSchedulerHandler.CurrentContentEvent.IsHtmlPageNull(); _createPage.Visible = !hasPage; _templateSelection.Visible = !hasPage; _editPage.Visible = hasPage; if (!hasPage) { // Abfüllen der bestehenden Seiten als Templates. string textData = " - " + Portal.API.Language.GetText(this, "EmptyPage") + " - "; _templateSelection.Items.Add(new ListItem(textData, Guid.Empty.ToString())); foreach (DataRowView viewPageRow in _contentSchedulerHandler.ConfigurationData.ContentEvent.DefaultView) { ContentSchedulerData.ContentEventRow pageRow = (ContentSchedulerData.ContentEventRow)viewPageRow.Row; if (!pageRow.IsHtmlPageNull()) { textData = pageRow.Hint + " (" + pageRow.ActivationDate.ToString(Portal.API.Config.DateTimeFormat) + ")"; _templateSelection.Items.Add(new ListItem(textData, pageRow.Id.ToString())); } } } } }
protected void OnPreviousEvent_Click(object sender, EventArgs e) { Guid id = new Guid(TransitionArgument.ToString()); ContentSchedulerHandler contentHandler = new ContentSchedulerHandler(this, id); ContentSchedulerData.ContentEventRow previousRow = contentHandler.PreviousContentEvent; if (previousRow != null) { ProcessEvent((int)StateEvent.ShowPreview, previousRow.Id); } }
protected override void OnPreRender(EventArgs e) { Guid id = new Guid(TransitionArgument.ToString()); ContentSchedulerHandler contentHandler = new ContentSchedulerHandler(this, id); _pageContent.Text = contentHandler.GetContent(); _currentInfo.Text = contentHandler.CurrentContentEvent.Hint + " (" + contentHandler.CurrentContentEvent.ActivationDate.ToString(Portal.API.Config.DateTimeFormat) + ")"; _nextEvent.Visible = (contentHandler.NextContentEvent != null); _previousEvent.Visible = (contentHandler.PreviousContentEvent != null); base.OnPreRender(e); }
protected void Page_Load(object sender, EventArgs e) { // Handler für diesen Datensatz einrichten. _contentSchedulerHandler = new ContentSchedulerHandler(this, new Guid(TransitionArgument.ToString())); // FCK Editor konfigurieren. string applicationDir = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath; FCKeditor1.BasePath = Path.Combine(applicationDir, "FCKeditor/"); FCKeditor1.EditorAreaCSS = Portal.Helper.CssEditPath; if (!ControlPostback) { // Daten abfüllen. FCKeditor1.Value = _contentSchedulerHandler.GetContent(); } }
protected void OnEditPage_Click(object sender, EventArgs e) { Guid id = new Guid(TransitionArgument.ToString()); ProcessEvent((int)StateEvent.EditPage, id); }