//**************************************************************** // // The DeleteBtn_Click event handler on this Page is used to delete an // a link. It uses the ASPNetPortal.LinksDB() // data component to encapsulate all data functionality. // //**************************************************************** private void DeleteBtn_Click(Object sender, EventArgs e) { // delete definition ASPNetPortal.AdminDB admin = new ASPNetPortal.AdminDB(); admin.DeleteModuleDefinition(defId); // Redirect back to the portal admin page Response.Redirect("~/DesktopDefault.aspx?tabindex=" + tabIndex + "&tabid=" + tabId); }
//******************************************************* // // The Page_Load server event handler on this page is used // to populate the role information for the page // //******************************************************* private void Page_Load(object sender, System.EventArgs e) { // Verify that the current user has access to access this page if (PortalSecurity.IsInRoles("Admins") == false) { Response.Redirect("~/Admin/EditAccessDenied.aspx"); } // Calculate security defId if (Request.Params["defid"] != null) { defId = Int32.Parse(Request.Params["defid"]); } if (Request.Params["tabid"] != null) { tabId = Int32.Parse(Request.Params["tabid"]); } if (Request.Params["tabindex"] != null) { tabIndex = Int32.Parse(Request.Params["tabindex"]); } // If this is the first visit to the page, bind the definition data if (Page.IsPostBack == false) { if (defId == -1) { // new module definition FriendlyName.Text = "New Definition"; DesktopSrc.Text = "DesktopModules/SomeModule.ascx"; MobileSrc.Text = "MobileModules/SomeModule.ascx"; } else { // Obtain the module definition to edit from the database ASPNetPortal.AdminDB admin = new ASPNetPortal.AdminDB(); IDataReader dr = admin.GetSingleModuleDefinition(defId); // Read in first row from database dr.Read(); FriendlyName.Text = (String)dr["friendlyname"]; DesktopSrc.Text = (String)dr["desktopsrc"]; MobileSrc.Text = (String)dr["mobilesrc"]; // Close datareader dr.Close(); } } }