private void btnCapNhat_Click(object sender, EventArgs e) { if (KiemTra()) { LoaiTaiKhoanDAL db = new LoaiTaiKhoanDAL(); if (isUpdate) { db.Update(ID, txtTenLoai.Text); MessageBox.Show("Cập nhật thành công", "Thành công", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); } else { db.Insert(txtTenLoai.Text); MessageBox.Show("Thêm mới thành công", "Thành công", MessageBoxButtons.OK, MessageBoxIcon.Information); txtTenLoai.Text = String.Empty; } } else { MessageBox.Show("Bạn phải điền đủ thông tin", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }