private void btnXoaTheLoai_Click(object sender, EventArgs e) { if (lvwTheLoai.SelectedItems.Count == 0) { return; } DialogResult drl = MessageBox.Show("Bạn thực sự muốn xóa Thể loại [" + lvwTheLoai.SelectedItems[0].SubItems[1].Text + "] và tất cả bài trong thể loại này không ?", "xóa album", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (drl == DialogResult.Cancel) { return; } string matheloaiđangcchon = lvwTheLoai.SelectedItems[0].Tag.ToString(); TheLoai_BUS a = new TheLoai_BUS(matheloaiđangcchon); int loi = a.xoaTheLoai(); if (loi == 0) { MessageBox.Show("Đã xóa thành công mã thể loại [" + matheloaiđangcchon + "] ", "thành công hehe", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("xóa thất bại mã thể loại [" + matheloaiđangcchon + "] ", "thất bại huhu", MessageBoxButtons.OK, MessageBoxIcon.Warning); } loadlai_listview(); }