示例#1
0
        //public ExternalUserSession SessionUser
        //{
        //    get
        //    {
        //        if (Session["_SessionUser"] == null)
        //        {
        //            return null;
        //        }
        //        else
        //        {
        //            return (ExternalUserSession)Session["_SessionUser"];
        //        }
        //    }
        //    set
        //    {
        //        Session["_SessionUser"] = value;
        //    }
        //}

        #endregion

        #region Private Methods

        protected new void LoadHeader()
        {
            string lUrl;

            //TODO: descomentar esse trecho antes de fechar a versão
            //if (this.SessionUser == null)
            //{
            //    Session["RedirectAfterLogin"] = Request.Url.PathAndQuery;

            //    if (Session["RedirectAfterLogoff"] != null)
            //        lUrl = Session["RedirectAfterLogoff"].ToString();
            //    else
            //        lUrl = this.MasterPage.BaseURL + "LogOff.aspx";

            //    Response.Redirect(lUrl);
            //}
            //else
            //{
            //    Session["RedirectAfterLogin"] = null;
            //}

            if (Request["imp"] != null)
            {
                decimal lNewID = 0;

                if (decimal.TryParse(Request["imp"], out lNewID))
                {
                    //if (LocalInstance.ValidatedSettings.AllowProviderImpersonation)
                    //{
                    //    if (Request["pass"] == DateTime.Now.Minute.ToString())
                    //    {
                    //        this.SessionUser.ProviderID = lNewID;
                    //        this.SessionUser.Impersonated = true;
                    //    }
                    //}
                }
            }

            //código utilizado abaixo para agilizar homologação
            //if (this.SessionUser.Impersonated)
            //{
            //    this.Title += " IMPERSONATING PRV_ID " + this.SessionUser.ProviderID.ToString();
            //}

            base.LoadHeader();

            this.MasterPage.PageH3 = CultureHub.GetLocalResc("PageH3");

            this.MasterPage.AddJavaScriptBodyOnLoad("PageInit();");
        }
示例#2
0
        protected void LoadHeader()
        {
            string lUrl;

            if (this.SessionUser == null && this.IsNotAuthenticated == false)
            {
                #region Código para autenticação manual, utilizada para debugar projeto

                ////Logon manual para debugar código
                //OperationResult lResult = new OperationResult();

                //lResult = LoginHub.LogUser("ADMIN", "103", "A", LocalInstance.ValidatedSettings.WebAdminLogonSettings);

                //if (lResult.IsValid)
                //{

                //    //Session["_SessionUser"] = (ExternalUserSession)lResult.ReturnObject;
                //    Session["_SessionUser"] = (SystemUserSession)lResult.ReturnObject;

                //}

                #endregion

                Session["RedirectAfterLogin"] = Request.Url.PathAndQuery;

                if (Session["RedirectAfterLogoff"] != null)
                {
                    lUrl = Session["RedirectAfterLogoff"].ToString();
                }
                else
                {
                    lUrl = this.MasterPage.BaseURL + "LogOff.aspx";
                }

                Response.Redirect(lUrl);
            }
            else
            {
                Session["RedirectAfterLogin"] = null;
            }

            this.MasterPage.PageH3 = CultureHub.GetLocalResc("PageH3");


            //Somente insere as bibliotecas JQuery se houver necessidade
            if (this.HasCalendar || this.HasMaskedInput)
            {
                this.MasterPage.AddJavaScript(@"jquery/js/jquery-1.3.2.min.js");
                this.MasterPage.AddJavaScript(@"jquery/js/jquery-ui-1.7.1.custom.min.js");
            }

            if (this.HasCalendar)
            {
                //this.MasterPage.AddJavaScript("DatePickerV2.js");
                //this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/DatePicker.css");

                this.MasterPage.AddJavaScript(@"jquery/js/jquery.datepick-pt-BR.js");
                this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/JQueryDatePicker/smoothness/jquery-ui-1.7.1.custom.css");
            }

            if (this.HasMaskedInput)
            {
                this.MasterPage.AddJavaScript("jquery/js/jquery.maskedinput-1.2.2.min.js");
            }



            this.MasterPage.AddJavaScript("lib/prototype.js");
            this.MasterPage.AddJavaScript("scriptaculous/scriptaculous.js");

            this.MasterPage.AddJavaScript("Base.js");
            this.MasterPage.AddJavaScript("Dialogs.js");

            this.MasterPage.AddCSS("base.css");

            this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/Style.css");
            this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/Menu.css");

            if (this.HasValidation)
            {
                this.MasterPage.AddJavaScript("Validation.js");
            }

            if (this.HasGrid)
            {
                //this.MasterPage.AddJavaScript("WebGrid.js");
                //this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/WebGrid.css");
                this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/DefaultGrid.css");
            }

            if (this.HasAddress)
            {
                this.MasterPage.AddJavaScript("AddressPhone.js");
                this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/AddressPhone.css");
            }

            if (this.HasPhone)
            {
                this.MasterPage.AddJavaScript("AddressPhone.js");
                this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/AddressPhone.css");
            }

            if (this.HasMasterPageHidden)
            {
                this.MasterPage.AddCSS(this.MasterPage.SkinFolder + "/MasterPageHidden.css");
            }


            LoadPageJsAndCSS();
        }