protected void btnDN_Click(object sender, EventArgs e) { try { NguoiDungDTO ndDTO = new NguoiDungDTO(); ndDTO.Username = txtTK.Text; ndDTO.Pass = txtMK.Text; if (NguoiDungBUS.ktraDangNhap(ndDTO) == true) { //Neu dang nhap thanh cong DataRow dr = NguoiDungBUS.LayTenDangNhap(ndDTO).Rows[0]; Session["TenDangNhap"] = dr["TenDangNhap"]; } kt(); } catch (Exception ex) { } }
protected void btnDMK_Click(object sender, EventArgs e) { try { NguoiDungDTO ndDTO = new NguoiDungDTO(); ndDTO.Username = txtTK.Text; ndDTO.Pass = txtMKcu.Text; ndDTO.Newpass = txtMKmoi.Text; if (NguoiDungBUS.ktraDangNhap(ndDTO) == true) { NguoiDungBUS.DoiMatKhau(ndDTO); lblThongBao.Text = "Đổi thành công"; } else { lblThongBao.Text = "Đổi thất bại"; } } catch { } }
protected void btnLogin_Click(object sender, EventArgs e) { NguoiDungDTO ndDTO = new NguoiDungDTO(); ndDTO.Username = txtUsername.Text; ndDTO.Pass = txtPassword.Text; if (NguoiDungBUS.ktraDangNhap(ndDTO) == true) { //Neu dang nhap thanh cong DataRow dr = NguoiDungBUS.LayTenDangNhap(ndDTO).Rows[0]; Session["Admin"] = dr["TenDangNhap"]; Response.Write("<script type='text/javascript'>" + "alert('Đăng nhập thành công !!!');" + "window.location.href = \"Default.aspx\";" + "</script>"); } else { Response.Write("<script type='text/javascript'>" + "alert('Đăng nhập thất bại !!!');" + "</script>"); } }