Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = Context.User.Identity;

            if (user.IsAuthenticated)
            {
                litStatus.Text       = Context.User.Identity.Name;
                loginLink.Visible    = false;
                linkRegister.Visible = false;
                linkLogout.Visible   = true;
                litStatus.Visible    = true;

                PurchaseModel model  = new PurchaseModel();
                string        userId = HttpContext.Current.User.Identity.GetUserId();
                litStatus.Text = string.Format("{0}({1})", Context.User.Identity.Name, model.getAmountOfOrders(userId));
            }
            else
            {
                loginLink.Visible    = true;
                linkRegister.Visible = true;
                linkLogout.Visible   = false;
                litStatus.Visible    = false;
            }
        }