private void btnCapNhatNV_Click(object sender, EventArgs e) { try { TaiKhoan x = new TaiKhoan(); x.CapNhat(txtTaiKhoanNV.Text, txtMatKhauNV.Text, txtQuyenNV.Text, txttenNguoiDungNV.Text, null, ref err); LoadData(); MessageBox.Show("Cập Nhật Thành Công"); } catch (SqlException) { MessageBox.Show("Lỗi Rồi!!!"); } }
private void btnCapNhat_Click(object sender, EventArgs e) { try { if (txtMatKhau.Text == "" || txtTaiKhoan.Text == "" || cboLoaiTK.Text == "") { MessageBox.Show("Vui lòng điền đầy đủ thông tin"); } else { tk.CapNhat(txtTaiKhoan.Text, txtMatKhau.Text, cboLoaiTK.Text); MessageBox.Show("Cập nhật tài khoản thành công"); hienthi(); txtMatKhau.Clear(); txtTaiKhoan.Clear(); cboLoaiTK.Text = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }