Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["USER"] != null && UserDBHelper.IsUserAdmin(Session["USER"].ToString()))
     {
         litTalk.Text = "Welcome " + Session["USER"];
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Form.DefaultButton = this.btnExamID.UniqueID;
     if (Session["USER"] != null && !UserDBHelper.IsUserAdmin(Session["USER"].ToString()))
     {
         litTalk.Text = "Welcome " + Session["USER"];
     }
 }
Ejemplo n.º 3
0
        protected void btnSignIn_Click(object sender, EventArgs e)
        {
            int?userId = UserDBHelper.IsCredentialsValid(txtUserName.Text, txtPassword.Text);

            if (userId != null)
            {
                Session["USER"]   = txtUserName.Text;
                Session["USERID"] = userId;
                if (UserDBHelper.IsUserAdmin(Session["USER"].ToString()))
                {
                    Session["ISADMIN"] = "1";
                    Response.Redirect("AdminHome.aspx");
                }
                Response.Redirect("Home.aspx");
            }
        }