示例#1
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            ViewBag.siteName  = ConfigurationManager.AppSettings["siteName"].ToString();
            ViewBag.company   = ConfigurationManager.AppSettings["company"].ToString();
            ViewBag.companyEn = ConfigurationManager.AppSettings["companyEn"].ToString();
            ViewBag.address   = ConfigurationManager.AppSettings["address"].ToString();
            ViewBag.addressEn = ConfigurationManager.AppSettings["addressEn"].ToString();

            ViewBag.UIC           = ConfigurationManager.AppSettings["UIC"].ToString();
            ViewBag.email         = ConfigurationManager.AppSettings["email"].ToString();
            ViewBag.tel           = ConfigurationManager.AppSettings["tel"].ToString();
            ViewBag.bankAccount   = ConfigurationManager.AppSettings["bankAccount"].ToString();
            ViewBag.hasBankAcount = ConfigurationManager.AppSettings["hasBankAcount"].ToString() == "true";
            ViewBag.manager       = ConfigurationManager.AppSettings["manager"].ToString();
            ViewBag.managerEn     = ConfigurationManager.AppSettings["managerEn"].ToString();

            //var a = this.Request.Url.ToString();


            base.Initialize(requestContext);

            if (Session != null && Session["user"] != null)
            {
                ViewBag.user = Session["user"];
            }
            else if (User.Identity.IsAuthenticated)
            {
                var user = UserHeppler.GetUserById(User.Identity.Name);
                Session["user"] = user;
                ViewBag.user    = Session["user"];
            }
        }
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            if (Session != null && Session["user"] != null)
            {
                ViewBag.user = Session["user"];
            }
            else if (User.Identity.IsAuthenticated)
            {
                var user = UserHeppler.GetUserById(User.Identity.Name);
                Session["user"] = user;
                ViewBag.user    = Session["user"];
            }
        }