コード例 #1
0
ファイル: Home.aspx.cs プロジェクト: chowdaryak92/Blood-Bank
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        RegistrationDAO registrationDAO = new RegistrationDAO();

        string LoginEmail    = LoginEmailText.Text;
        string LoginPassword = LoginPassText.Text;

        int temp = registrationDAO.CheckExistingMember(LoginEmail);

        if (temp == 1)
        {
            //user exists
            string DBPassword = registrationDAO.CheckLogin(LoginEmail);



            if (LoginPassword == DBPassword)
            {
                if (LoginEmail == "Admin")
                {
                    Session["Admin"] = "Admin";
                    Panel3.Visible   = true;
                    Panel1.Visible   = false;
                    Panel2.Visible   = false;
                    // Response.Write("Password is correct");
                }
                else
                {
                    Session["New"]      = registrationDAO.GetNameAfterLogin(LoginEmail);
                    Session["Email"]    = LoginEmail;
                    Session["Password"] = LoginPassword;

                    Session["ID"] = registrationDAO.GetIDAfterLogin(LoginEmail);
                    //Response.Write("Password is correct");
                    //Response.Redirect("Account_Pages/Profile.aspx");
                    Response.Redirect("Home.aspx");
                }
            }
            else
            {
                PassLabel.Text = "Password is incorrect";
                //Response.Write("Password is incorrect");
            }
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        RegistrationDAO registrationDao = new RegistrationDAO();

        memberExists = false;

        if (IsPostBack)
        {
            string email = EmailText.Text;

            int temp = registrationDao.CheckExistingMember(email);

            if (temp == 1)
            {
                Response.Write("User Already Exists");

                memberExists = true;
            }
        }
    }