private void btnApDungTatCa_Click(object sender, EventArgs e) { for (int i = 0; i < dgvListTre.Rows.Count; i++) { listTre[dgvListTre.Rows[i].Cells["MaTre"].Value.ToString()] = true; } if (DichVuSucKhoeBLL.CapNhatTreThamGiaDichVu(listTre, maDV)) { MessageBox.Show("Cập nhật trẻ tham gia thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadDataGridView(); } }
private void btnLuu_Click(object sender, EventArgs e) { for (int i = 0; i < dgvListTre.Rows.Count; i++) { string maTre = dgvListTre.Rows[i].Cells["MaTre"].Value.ToString(); if (dgvListTre.Rows[i].Cells["CheckBox"].Value.ToString() == "true" || dgvListTre.Rows[i].Cells["CheckBox"].Value.ToString() == "True") { listTre[maTre] = true; } else { listTre[maTre] = false; } } if (DichVuSucKhoeBLL.CapNhatTreThamGiaDichVu(listTre, maDV)) { MessageBox.Show("Cập nhật trẻ tham gia thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }