private void BtnLuu_Click(object sender, EventArgs e) { if (Them) { try { BLAccount blacc = new BLAccount(); blacc.AddNV(this.txtBoxHoTen.Text, this.txtBoxCMND.Text, this.dtpNamsinh.Text, this.txtBoxLuong.Text, Convert.ToString(cbBoxChucVu.SelectedIndex + 1), err); LoadData(); this.dgvThongTinNV.Enabled = true; MessageBox.Show("Đã thêm xong!"); } catch (SqlException) { MessageBox.Show("Không thêm được. Lỗi rồi!"); } } else { BLAccount blacc = new BLAccount(); blacc.UpdateNV(this.txtID.Text, this.txtBoxHoTen.Text, this.txtBoxCMND.Text, this.dtpNamsinh.Text, this.txtBoxLuong.Text, Convert.ToString(cbBoxChucVu.SelectedIndex + 1), err); LoadData(); this.dgvThongTinNV.Enabled = true; MessageBox.Show("Đã sửa xong!"); } }