private void btnLuu_Click(object sender, EventArgs e) { if (Them) { try { qlMH.Tao_tai_khoan(txtMaSV.Text, txtMatKhau.Text, txtTenSV.Text, (string)cbbKhoa.SelectedValue, txtLop.Text, txtNienKhoa.Text); MessageBox.Show("Đã thêm xong!"); } catch (SqlException) { MessageBox.Show("Lỗi dữ liệu nhập!"); } } else { try { qlMH.Sua_thong_tin(txtMaSV.Text, txtMatKhau.Text, txtTenSV.Text, (string)cbbKhoa.SelectedValue, txtLop.Text, txtNienKhoa.Text); } catch (SqlException) { MessageBox.Show("Không đủ thông tin để cập nhật !"); } } LoadData(); }