コード例 #1
0
        //xóa nhóm
        private void Btnxoanhom_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(
                    "Ban co that su muon xoa khong?",
                    "Thong bao",
                    MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.OK)
            {
                bool flag = dtgvnhom.CurrentRow.Selected;
                if (flag)
                {
                    string tenNhom = dtgvnhom.SelectedCells[0].Value.ToString();
                    string maNhom  = Nhom.getMaTuTenNhom(tenNhom, path);
                    Nhom.xoaNhom(path, maNhom);
                }

                MessageBox.Show("Da xoa thanh cong!",
                                "Thong bao", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //refresh
            refreshdtgvnhom();
        }