Exemple #1
0
/*----------------------------------------------------*/

        public UserControl LoadHeaderFooterControl(String aAttribute, String aID, String aParentID)
        {
            UserControl aCtl;
            String      aPath;

            aPath = cXMLDoc.AttributeToString(ModuleNode, aAttribute);

            if (aPath == "")
            {
                XmlNode aApplNode    = WebAppl.Get_ApplNode();
                XmlNode aModulesNode = aApplNode.SelectSingleNode("Modules");

                aPath = cXMLDoc.AttributeToString(aModulesNode, aAttribute);
                if (aPath == "")
                {
                    return(null);
                }
            }

            aPath = WebAppl.Build_RootURL(aPath);
            aCtl  = CorePage_LoadControl(aPath,
                                         aID, mPageFrameCtl.FindControl(aParentID));

            return(aCtl);
        }
Exemple #2
0
/*====================================================*/

        public override void CorePage_Load(Object aSrc, EventArgs aEvent)
        {
            bool AdminKey = false;

            if (ModuleUser == null || WebSession == null)
            {
                Response.Redirect(WebAppl.LogoutURL);
            }

            if (ModuleUser.MasterNavElement != null && !WebSession.HasAdminUser)
            {
                XmlNodeList aNodeList = ModuleNode.SelectNodes("AdminNavigation/NavElement");
                foreach (XmlNode aNode in aNodeList)
                {
                    cNavElement aAdminNavElement = ModuleUser.MasterNavElement.Find_ChildElement(cXMLDoc.AttributeToString(aNode, "Key"));
                    if (aAdminNavElement.Key == NavKey)
                    {
                        AdminKey = true;
                        break;
                    }

                    foreach (cXMLNavElement aNavElement in aAdminNavElement.Elements)
                    {
                        if (aNavElement.Key == NavKey)
                        {
                            AdminKey = true;
                            break;
                        }
                    }
                }

                if (AdminKey && !WebSession.HasAdminUser)
                {
                    String aError = System.Configuration.ConfigurationSettings.AppSettings["PermissionErrorPage"];
                    if (aError != "")
                    {
                        String aRetURL = cWebLib.Get_QueryString(Request, "ReturnURL", "");
                        WebSession.CurrentUrl = aRetURL;
                        String aUrl = WebAppl.Build_RootURL(aError);
                        Response.Redirect(aUrl);
                    }
                    else
                    {
                        WebSession.LogoutAllUsers();
                        Response.Redirect(WebAppl.LogoutURL);
                    }
                }

                base.CorePage_Load(aSrc, aEvent);
            }
            else
            {
                base.CorePage_Load(aSrc, aEvent);
            }

            // Update Activity Log
        }
Exemple #3
0
/*----------------------------------------------------*/

        public virtual void LoadPageFrameControl()
        {
            String  aPath;
            XmlNode aXMLNode;

            aXMLNode = cXMLDoc.FindNode(ModuleNode, "PageFrames/PageFrame", "Key", PageFrameKey);

            aPath         = WebAppl.Build_RootURL(cXMLDoc.AttributeToString(aXMLNode, "PageFrameCtl"));
            mPageFrameCtl = CorePage_LoadControl(aPath,
                                                 "mPageFrameCtl", frmMain);
        }
Exemple #4
0
/*====================================================*/

        public void CorePage_LoadStyles(HtmlGenericControl aStyleSpan)
        {
            String aStylesPath;

            aStylesPath = WebAppl.DefaultStylesPath;
            if (aStylesPath != "")
            {
                aStylesPath = WebAppl.Build_RootURL(aStylesPath);
                CorePage_LoadControl(aStylesPath, "ctlStyles", aStyleSpan);
            }
        }
Exemple #5
0
/*-----------------------------------------------------*/

        public void Page_Load(Object aSrc, EventArgs aEvent)
        {
            //cLib.Runtime_Error();

            WebSession.CurrentPage = this;
            if (CorePage_Valid(aSrc, aEvent))
            {
                CorePage_RegisterScriptBlock(WebAppl.Build_RootURL("Core/Includes/Easygrants.js"), "EasygrantsJS");
                CorePage_RegisterScriptBlock(WebAppl.Build_RootURL("Core/Includes/ClientImplementation.js"), "ClientImplementationJS");
                CorePage_Load(aSrc, aEvent);
            }
            else
            {
                Response.Redirect(WebAppl.LogoutURL);
            }
        }
Exemple #6
0
/*-----------------------------------------------------*/

        public void Page_Error(object sender, EventArgs e)
        {
            if (Server.GetLastError().GetBaseException().GetType().ToString() != "System.Threading.ThreadAbortException")
            {
                WebSession.CurrentException = Server.GetLastError().GetBaseException();
                WebAppl.LogException(WebSession.CurrentException);
                WebSession.CurrentUrl = Request.Url.PathAndQuery;
                String aSystemError = System.Configuration.ConfigurationSettings.AppSettings["SystemError"];
                if (aSystemError != "" && aSystemError != null)
                {
                    String aUrl = WebAppl.Build_RootURL(aSystemError);
                    Response.Redirect(aUrl);
                }
            }
            else
            {
                Server.ClearError();
            }
        }
Exemple #7
0
/*----------------------------------------------------*/

        public bool LoadPageContent_FromXML()
        {
            XmlNode aPageNode;

            aPageNode = PageNode;
            if (aPageNode == null)
            {
                return(false);
            }

            PageNavKey      = cXMLDoc.AttributeToString(aPageNode, "NavKey");
            PageHorizNavKey = cXMLDoc.AttributeToString(aPageNode, "HorizNavKey");

            Control aPgContentTDCell;

            aPgContentTDCell = mPageFrameCtl.FindControl("tdPageContent");
            mPageContentCtl  = CorePage_LoadControl(WebAppl.Build_RootURL(cXMLDoc.AttributeToString(aPageNode, "ContentCtl")),
                                                    "ctlPageContent", aPgContentTDCell);
            return(true);
        }