Example #1
0
    protected void btn_change_Click(object sender, EventArgs e)
    {
        oldpass = txt_oldpass.Text;
        class_admin_login adm = new class_admin_login();
        int i = adm.comppass(oldpass, txt_newpass.Text);

        if (i == 1)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('You Have Successfully Changed Password')", true);
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Wrong Old Password')", true);
        }
    }
Example #2
0
    protected void btn_login_Click(object sender, EventArgs e)
    {
        email    = txt_username.Text;
        password = txt_password.Text;
        class_admin_login adm = new class_admin_login();
        int i = adm.select(email, password);

        if (i == 1)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('You Have Successfully Logged In')", true);
            adm.update(email);
            Session["admin_email"] = email;
            Response.Redirect("dashboard.aspx");
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Wrong Username or Password')", true);
        }
    }