예제 #1
0
        //****************************************************************
        //
        // The Page_Load event on this Page is used to obtain the ModuleId
        // of the xml module to edit.
        //
        // It then uses the Nairc.KPWPortal.HtmlTextDB() data component
        // to populate the page's edit controls with the text details.
        //
        //****************************************************************
        protected void Page_Load(Object Sender, EventArgs e)
        {
            // Determine ModuleId of Announcements Portal Module
            moduleId = Int32.Parse(Request.Params["Mid"]);

            // Verify that the current user has access to edit this module
            if (PortalSecurity.HasEditPermissions(moduleId) == false)
            {
                Response.Redirect("~/Errors/EditAccessDenied.aspx");
            }

            if (Page.IsPostBack == false)
            {
                // Obtain a single row of text information
                IDesktopModulesFacade facade=new DesktopModulesFacade();
                PortalHtmlText html = facade.HtmlText(moduleId);

                if (html!=null)
                {
                    DesktopText.Text = Server.HtmlDecode(html.DesktopHtml);
                    MobileSummary.Text = Server.HtmlDecode(html.MobileSummary);
                    MobileDetails.Text = Server.HtmlDecode(html.MobileDetails);
                }
                else
                {
                    DesktopText.Text = "Todo: Add Content...";
                    MobileSummary.Text = "Todo: Add Content...";
                    MobileDetails.Text = "Todo: Add Content...";
                }

                // Store URL Referrer to return to portal
                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
            }
        }
예제 #2
0
        //*******************************************************
        //
        // The Page_Load event handler on this User Control is
        // used to render a block of HTML or text to the page.
        // The text/HTML to render is stored in the HtmlText
        // database table.  This method uses the Nairc.KPWPortal.HtmlTextDB()
        // data component to encapsulate all data functionality.
        //
        //*******************************************************
        protected void Page_Load(Object sender, EventArgs e)
        {
            // Obtain the selected item from the HtmlText table
            IDesktopModulesFacade facade = new DesktopModulesFacade();
            PortalHtmlText html = facade.HtmlText(ModuleId);

            if (html != null)
            {
                // Dynamically add the file content into the page
                String content = Server.HtmlDecode(html.DesktopHtml);
                HtmlHolder.Controls.Add(new LiteralControl(content));
            }
        }
 public void HtmlTextTest()
 {
     //PortalHtmlText HtmlText(int moduleId)
     DesktopModulesFacade facade = new DesktopModulesFacade();
     facade.HtmlText(0);
 }