Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Append anti-CSRF token to Logoff URL
                var url = new HRef(ResolveUrl("~/Default.aspx?action=logoff"));
                url["token"] = AntiCsrf.Current.SecureToken;
                LogoutMenuLink.NavigateUrl = url.ToString();

                InitSearchBox();
                InitMenuStyleButton();
                InitMenuModeButton();
                InitLangMenuButton();

                //cbxEnableCompactMode.Checked = _compactMode;

                litVersion.Text = FineUIPro.GlobalConfig.ProductVersion;

                InitOnlineUserCount();
                btnUserName.Text           = UserInfo.Current.ChineseName;
                linkCompanyTitle.InnerText = UserInfo.Current.CompanyName;
                btnUserName.IconUrl        = UserInfo.Current.UserPortraitPath;

                //Tab1.IFrameUrl = "~/Home2.aspx";
                //Tab1.RefreshIFrame();
            }
        }
        //////////////////////////////////////////////////////////////////////////
        // Reads
        //////////////////////////////////////////////////////////////////////////

        /**
         * Call "read" to lookup an entity record by it's unique identifier.
         * If not found then return null or throw an UnknownRecException based
         * on checked.
         * NOTE: Was final
         */
        public HDict readById(HRef id, bool bChecked)
        {
            HDict rec = readById(id);

            if (rec != null)
            {
                return(rec);
            }
            if (bChecked)
            {
                throw new Exception("rec not found for: " + id.ToString());
            }
            return(null);
        }
Esempio n. 3
0
        public static void RedirectToAccessDeniedPage(string reasonCode, bool useStaticPage, string queryString)
        {
            if (useStaticPage)
            {
                HttpContext.Current.Response.Redirect("~/Local/AccessDenied.htm?" + reasonCode, true);
            }
            else
            {
                Authentication.SignOut();
                HttpContext.Current.Session.Abandon();

                HRef page = new HRef(Global.SiteRootPath + "/AccessDenied.aspx");
                page["ReasonCode"] = reasonCode;
                page.Merge(queryString);
                HttpContext.Current.Response.Redirect(page.ToString(), true);
            }
        }