Exemple #1
0
    protected void btndoimatkhau_Click(object sender, EventArgs e)
    {
        nguoidungBLL         bs = new nguoidungBLL();
        List <userpublicDAL> ds = (List <userpublicDAL>)Session["userpublic"];

        if (bs.xacthuc(txtmk.Text, ds[0].id_user) == true)
        {
            bool tf = bs.qenMatKhau_doiMatKhau(txtmk2.Text, ds[0].id_user);

            if (tf == true)
            {
                lbError.Text = "Đổi mật khẩu thành công !";
                txtmk.Text   = "";
                txtmk1.Text  = "";
                txtmk2.Text  = "";
            }
            else
            {
                lbError.Text = "Đổi mật khẩu thất bại !";
            }
        }
        else
        {
            lbError.Text = "Mật khẩu cũ không chính xác !";
        }
    }
Exemple #2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        nguoidungBLL bs = new nguoidungBLL();
        int          id = Convert.ToInt32(Session["quenmatkhau"]);
        bool         tf = bs.qenMatKhau_doiMatKhau(txtmk1.Text, Convert.ToInt32(txtmk2.Text));

        if (tf == true)
        {
            lbError.Text = "Đổi mật khẩu thành công !";
            Session.Remove("quenmatkhau");
        }
        else
        {
            lbError.Text = "Đổi mật khẩu thất bại !";
        }
    }
    private bool doimatkhau(int id)
    {
        bool         t  = false;
        nguoidungBLL bs = new nguoidungBLL();

        if (txtMK1.Text == txtMK2.Text)
        {
            bool tf = bs.qenMatKhau_doiMatKhau(txtMK2.Text, id);
            t = tf;
        }
        else
        {
            lbError.Text = "<div class='error'>"
                           + "<div class='tl'></div><div class='tr'></div>"
                           + "<div class='desc'>"
                           + "<p>Mật khẩu mới không chính xác !</p>"
                           + "</div>"
                           + "<div class='bl'></div><div class='br'></div>"
                           + "</div>";
        }


        return(t);
    }