private void bnDelete_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { int ID =Convert.ToInt32(gridView1.GetFocusedRowCellValue("ID")); DialogResult result = MessageBox.Show("Bạn có muốn xóa nhóm dịch vụ " + ID + " này không?", "Xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO(); aServiceGroupsBO.Delete_ByID(ID); MessageBox.Show("Xóa thành công","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Information); this.ReloadData(); bnAdd.Enabled = true; bnEdit.Enabled = false; lblID.Text = ""; txtName.Text = ""; cbxDisable.SelectedIndex = 0; if (afrmIns_Services != null) { this.afrmIns_Services.ReloadData(); } } } catch (Exception ex) { MessageBox.Show("frmIns_ServiceGroups.bnDelete_ButtonClick\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }