private void updateViews() { HTMLModule htmlmodule = HTMLModuleData.LoadHTMLModuleData(this._moduleid); Module module = ModuleData.LoadModuleData(this.ModuleId); if (ViewMode == ViewMode.Edit) { ControlMultiView.SetActiveView(EditView); TextEditor.Text = htmlmodule.HtmlText; TitleTextBox.Text = module.ModuleTitle; } else { ControlMultiView.SetActiveView(ReadView); TitleLiteral.Text = "<h3>" + module.ModuleTitle + "</h3>"; HtmlContent.Text = htmlmodule.HtmlText; DateLiteral.Text = "<br /> Created on: <b>" + htmlmodule.CreatedDate.ToShortDateString() + "</b> by " + "<b>" + htmlmodule.CreatedByUser + "</b><br />"; } }
protected void AddModuleButton_Click(object sender, EventArgs e) { Module module = new Module(); module.ModuleTitle = ModuleDropDownList.SelectedItem.Text; module.EditRoles = "users"; url = Request.UrlReferrer.ToString(); module.PageId = _page.PageId; module.ModuleDefinitionId = int.Parse(ModuleDropDownList.SelectedItem.Value); module.PanelName = "CenterArea"; module.ModuleOrder = SetModuleOrder(modulelist); Module newmodule = ModuleData.NewModule(module); if (module.ModuleTitle == "HTML") { HTMLModule newhtmlmodule = new HTMLModule(); newhtmlmodule.CreatedByUser = User.Identity.Name; newhtmlmodule.CreatedDate = DateTime.Now; newhtmlmodule.ModuleId = module.ModuleId; newhtmlmodule = HTMLModuleData.NewHTMLModule(newhtmlmodule); } Response.Redirect(Request.RawUrl); }