private void button5_Click(object sender, EventArgs e) { //DataRowView item = (DataRowView) txtDeptID.SelectedItem; //MessageBox.Show(item.Row[0].ToString()); //string CatId = item.Row[0].ToString(); if (txtDeptID.Text.Equals("NONE")) { Alert.Show("Bạn không được xóa mặt hàng này", Color.Red); return; } DataTable tmp = get_service.GetAllInventoryByDept(StaticClass.storeId, txtDeptID.Text); if (tmp.Rows.Count > 0) { if (MessBox2Choice.ShowBox("neu xoa thi nhung mat hang thuoc loai nay se dc set None", Color.YellowGreen).Equals(System.Windows.Forms.DialogResult.Yes)) { get_service.DeleteDept(txtDeptID.Text, StaticClass.storeId); } return; } get_service.DeleteDept(txtDeptID.Text, StaticClass.storeId); departs = get_service.GetAllDepartments2(StaticClass.storeId); limit = departs.Rows.Count - 1; button8_Click(button8, null); }