private void btnLuu_Click(object sender, EventArgs e) { try { if ((int.Parse(txtSoTheLoai.Text) == soTheLoaiCu && kiemTra) || (int.Parse(txtSoTheLoai.Text) != soTheLoaiCu && kiemTra && XacNhanCapNhap)) { qdDTO.SoTheLoai = int.Parse(txtSoTheLoai.Text); qdDTO.HanNhanSach = int.Parse(txtHanNhanSach.Text); if (qdBUS.KiemTra(qdDTO) && qdBUS.Update(qdDTO)) { MessageBox.Show("Cập nhập thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Cập nhập không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Bạn chưa cập nhập tên thể loại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { MessageBox.Show("Thông tin nhập không đúng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }