//---------------------------------------------------------------------------
    /// <summary>
    /// The page Init event handler.
    /// </summary>
    protected void Page_Init(object sender, EventArgs e)
    {
        this.Page.InitComplete += new EventHandler(Page_InitComplete);

        if (PXDataSource.RedirectHelper.IsPopupPage(Page))
        {
            tlbPath.Items["syncTOC"].Visible   = false;
            tlbPath.Items["favorites"].Visible = false;
            tlbPath.Items["branch"].Visible    = false;
        }

        if (PXSiteMap.IsPortal)
        {
            tlbPath.Items["branch"].Visible    = false;
            tlbPath.Items["favorites"].Visible = false;
            pnlTitle.CssClass = "pageTitleSP";
            pnlTBR.CssClass   = "panelTBRSP";
            tlbTools.Items["help"].CssClass = "toolsBtnSP";

            HtmlAnchor label = tlbPath.FindControl("lblScreenTitle") as HtmlAnchor;
            if (label != null)
            {
                label.Attributes["class"] = "linkTitleSP";
            }
        }
        JSManager.RegisterModule(new MSScriptRenderer(Page.ClientScript), typeof(AppJS), AppJS.PageTitle);

        if (PXContext.PXIdentity.Authenticated)
        {
            userName = PXContext.PXIdentity.IdentityName;
            string branch = PXAccess.GetBranchCD();
            if (!string.IsNullOrEmpty(branch))
            {
                userName += ":" + branch;
            }
        }

        if (screenID == null && screenTitle == null)
        {
            this.screenID = ControlHelper.GetScreenID();
            PX.Common.PXContext.SetScreenID(screenID);

            if (System.Web.SiteMap.CurrentNode != null)
            {
                if (company == null || System.Web.SiteMap.CurrentNode.ParentNode != null)
                {
                    screenTitle = PXSiteMap.CurrentNode.Title;
                }
                else
                {
                    screenTitle = company;
                }
            }
        }


        var date = PXContext.GetBusinessDate();

        if (date != null)
        {
            PXDateTimeEdit.SetDefaultDate((DateTime)date);
        }

        if (!Page.IsCallback)
        {
            Session.Remove("StoredSearch");
        }
        Uploader.FileUploadFinished += Uploader_FileUploadFinished;
        tlbTools.ItemCreate         += tlbTools_ItemCreate;
    }
Exemple #2
0
    //---------------------------------------------------------------------------
    /// <summary>
    /// The page Init event handler.
    /// </summary>
    protected void Page_Init(object sender, EventArgs e)
    {
        var lifetimeScope = this.Context.GetLifetimeScope();

        if (lifetimeScope != null)
        {
            screenRepository = lifetimeScope.Resolve <IScreenRepository>();
        }
        else
        {
            var serviceLocator = ServiceLocator.Current;
            screenRepository = serviceLocator.GetInstance <IScreenRepository>();
        }
        JSManager.RegisterModule(new MSScriptRenderer(Page.ClientScript), typeof(AppJS), AppJS.PageTitle);

        if (screenID == null)
        {
            this.screenID = ControlHelper.GetScreenID();
        }
        if (screenTitle == null)
        {
            if (System.Web.SiteMap.CurrentNode != null)
            {
                if (company == null || System.Web.SiteMap.CurrentNode.ParentNode != null)
                {
                    screenTitle = PXSiteMap.CurrentNode.Title;
                }
                else
                {
                    screenTitle = company;
                }
            }
        }

        string hide = this.Page.Request.QueryString[PXUrl.HidePageTitle];

        if (!string.IsNullOrEmpty(hide))
        {
            this.Visible = false; return;
        }

        this.Page.InitComplete += new EventHandler(Page_InitComplete);
        PXCallbackManager.GetInstance().PreGetCallbackResult += PreGetCallbackResult;

        tlbPath.Items["syncTOC"].Visible = false;
        tlbPath.Items["branch"].Visible  = false;
        if (!this.Page.IsCallback)
        {
            ((WebControl)LabelScreen.Parent).CssClass = "pageTitleCont";
        }

        if (PXDataSource.RedirectHelper.IsPopupPage(Page))
        {
            if (!PXList.Provider.HasList(PXSiteMap.CurrentNode.ScreenID))
            {
                tlbPath.Items["syncTOC"].Visible = false;
            }
            this.FavoriteAvailable = false;
            if (!PXDataSource.RedirectHelper.IsPopupInline(Page))
            {
                GetBranchCombo().Enabled = false;
            }
        }

        if (PXSiteMap.IsPortal)
        {
            this.CustomizationAvailable = PXAccess.GetAdministratorRoles().Any(System.Web.Security.Roles.IsUserInRole);
            this.BranchAvailable        = false;
            this.FavoriteAvailable      = false;
            pnlTBR.CssClass             = "panelTBRSP";
        }

        if (PXContext.PXIdentity.Authenticated)
        {
            userName = PXContext.PXIdentity.IdentityName;
            string branch = PXAccess.GetBranchCD();
            if (!string.IsNullOrEmpty(branch))
            {
                userName += ":" + branch;
            }
        }

        var date = PXContext.GetBusinessDate();

        if (date != null)
        {
            PXDateTimeEdit.SetDefaultDate((DateTime)date);
        }

        if (!Page.IsCallback)
        {
            Session.Remove("StoredSearch");
        }

        Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "jq", VirtualPathUtility.ToAbsolute("~/Scripts/jquery-3.1.1.min.js"));
        Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "jqsr", VirtualPathUtility.ToAbsolute("~/Scripts/jquery.signalR-2.2.1.min.js"));
        Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "hb", VirtualPathUtility.ToAbsolute("~/signalr/hubs"));
    }
    //---------------------------------------------------------------------------
    /// <summary>
    /// The page Init event handler.
    /// </summary>
    protected void Page_Init(object sender, EventArgs e)
    {
        string hide = this.Page.Request.QueryString[PXUrl.HidePageTitle];

        if (!string.IsNullOrEmpty(hide))
        {
            this.Visible = false; return;
        }

        this.Page.InitComplete += new EventHandler(Page_InitComplete);

        if (PXDataSource.RedirectHelper.IsPopupPage(Page))
        {
            if (!PXList.Provider.HasList(PXSiteMap.CurrentNode.ScreenID))
            {
                tlbPath.Items["syncTOC"].Visible = false;
            }
            this.FavoriteAvailable = false;
            if (!PXDataSource.RedirectHelper.IsPopupInline(Page))
            {
                GetBranchCombo().Enabled = false;
            }
        }

        if (PXSiteMap.IsPortal)
        {
            this.CustomizationAvailable = PXAccess.GetAdministratorRoles().Any(System.Web.Security.Roles.IsUserInRole);
            this.BranchAvailable        = false;
            this.FavoriteAvailable      = false;
            pnlTBR.CssClass             = "panelTBRSP";
        }

        JSManager.RegisterModule(new MSScriptRenderer(Page.ClientScript), typeof(AppJS), AppJS.PageTitle);

        if (PXContext.PXIdentity.Authenticated)
        {
            userName = PXContext.PXIdentity.IdentityName;
            string branch = PXAccess.GetBranchCD();
            if (!string.IsNullOrEmpty(branch))
            {
                userName += ":" + branch;
            }
        }

        if (screenID == null)
        {
            this.screenID = ControlHelper.GetScreenID();
        }
        if (screenTitle == null)
        {
            this.screenID = ControlHelper.GetScreenID();
            //PX.Common.PXContext.SetScreenID(screenID); // moved to data source

            if (System.Web.SiteMap.CurrentNode != null)
            {
                if (company == null || System.Web.SiteMap.CurrentNode.ParentNode != null)
                {
                    screenTitle = PXSiteMap.CurrentNode.Title;
                }
                else
                {
                    screenTitle = company;
                }
            }
        }

        var date = PXContext.GetBusinessDate();

        if (date != null)
        {
            PXDateTimeEdit.SetDefaultDate((DateTime)date);
        }

        if (!Page.IsCallback)
        {
            Session.Remove("StoredSearch");
        }
        Uploader.FileUploadFinished += Uploader_FileUploadFinished;
        tlbTools.ItemCreate         += tlbTools_ItemCreate;
    }