private void btnThem_Click(object sender, EventArgs e) { clsUser user = new clsUser(); user.User_name = txtTenNguoiDung.Text; user.Password = clsThamSoUtilities.CalculateMD5Hash(txtPwd.Text); if (user.Insert() == 1) { MessageBox.Show("Thêm thành công!"); } }
private void btnDangNhap_Click(object sender, EventArgs e) { string username = txtTenDN.Text; string passwd = txtPwd.Text; string hash =clsThamSoUtilities. CalculateMD5Hash(passwd); clsUser user = new clsUser(); if (user.checkPasswd(username, hash)==true) { Utilities.clsThamSoUtilities.isSectionLogin = true; MessageBox.Show("Bạn đã đăng nhập thành công!"); this.Close(); } }
public frmQuanTriNguoiDung() { InitializeComponent(); clsUser user = new clsUser(); gridUser.DataSource = user .GetAllData(); }