private void btDangNhap_Click(object sender, EventArgs e) { NguoiDungBLL nguoidungbll = new NguoiDungBLL(); string username = tbusername.Text.ToString(); string pass = tbpassword.Text.ToString(); if (nguoidungbll.DangNhap(username, pass)) { Form1 form = new Form1(); form.Show(); } else { MessageBox.Show("loi dang nhap", "thong bao", MessageBoxButtons.OK, MessageBoxIcon.Warning); tbusername.Text = ""; tbpassword.Text = ""; } }
private void btXacNhan_Click(object sender, EventArgs e) { NguoiDungBLL nguoidungbll = new NguoiDungBLL(); string username = tbTenDangNhap.Text.Trim(); string pass = tbMatKhauCu.Text.Trim(); string passnew = tbMatKhauMoi.Text.Trim(); string xacnhanpass = bXacNhanMK.Text.Trim(); NguoiDungEntities nguoidungenti = new NguoiDungEntities(); nguoidungenti.Username = tbTenDangNhap.Text.Trim(); nguoidungenti.Pass = tbMatKhauCu.Text.Trim(); nguoidungenti.Pass = tbMatKhauMoi.Text.Trim(); nguoidungenti.Pass = bXacNhanMK.Text.Trim(); if (nguoidungbll.DangNhap(username, pass)) { nguoidungbll.update(nguoidungenti); MessageBox.Show("thay doi thanh cong", "thong bao", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("thay doi that bai", "thong bao", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }