Ejemplo n.º 1
0
    protected void btnXacnhan_Click(object sender, EventArgs e)
    {
        string taikhoan = txttaikhoan.Text.ToString();
        string traloi   = dll.getXacNhan(taikhoan);
        string matkhau  = "123456";

        if (taikhoan == "" && txttraloi.Text == "")
        {
            Response.Write("<script language='JavaScript'>alert('Tài khoản hoặc câu trả lời không đúng. Vui lòng nhập lại!');</script>");
            txttaikhoan.Focus();
        }

        if (traloi == txttraloi.Text.ToString())
        {
            NguoiDungDTO nd = new NguoiDungDTO();
            nd.Taikhoan = taikhoan;
            nd.Matkhau  = matkhau;
            dll.UpdateNguoidung(nd);
            Response.Write("<script language='JavaScript'>alert('Thành công! Mật khẩu của bạn là: 123456');</script>");
            Response.Redirect("~/Dangnhap.aspx");
        }
        else
        {
            Response.Write("<script language='JavaScript'>alert('Thất bại!');</script>");
            Cleartextbox();
        }
    }