Beispiel #1
0
 private void btnTreThamGia_Click(object sender, EventArgs e)
 {
     string[] lopThamGia = DichVuSucKhoeBLL.GetListLopThamGia(maDV);
     if (dgvListLop.SelectedRows.Count > 0)
     {
         if (!CheckLopThamGia(dgvListLop.SelectedRows[0].Cells["MaLop"].Value.ToString(), lopThamGia))
         {
             MessageBox.Show("Lớp này không tham gia dịch vụ y tế này, bạn cần chọn và lưu lớp này tham gia dịch vụ trước mới có thể chỉnh sửa danh sách trẻ tham gia dịch vụ.",
                             "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             frmMain parentForm = (this.Parent.Parent as frmMain);
             parentForm.UpdateSubView("DanhSachTreThamGiaDichVu");
             View_DanhSachTreThamGiaDichVu view = (View_DanhSachTreThamGiaDichVu)parentForm.GetSubView("DanhSachTreThamGiaDichVu");
             view.LoadForm(maDV, dgvListLop.SelectedRows[0].Cells["MaLop"].Value.ToString());
         }
     }
 }
Beispiel #2
0
 private void dgvListLop_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     string[] lopThamGia = DichVuSucKhoeBLL.GetListLopThamGia(maDV);
     listLop.Clear();
     if (lopThamGia != null)
     {
         for (int i = 0; i < dgvListLop.RowCount; i++)
         {
             DataGridViewCheckBoxCell chkBoxCell = (DataGridViewCheckBoxCell)dgvListLop.Rows[i].Cells["CheckBox"];
             if (CheckLopThamGia(dgvListLop.Rows[i].Cells["MaLop"].Value.ToString(), lopThamGia))
             {
                 chkBoxCell.Value = "true";
                 listLop.Add(dgvListLop.Rows[i].Cells["MaLop"].Value.ToString(), true);
             }
             else
             {
                 chkBoxCell.Value = "false";
                 listLop.Add(dgvListLop.Rows[i].Cells["MaLop"].Value.ToString(), false);
             }
         }
     }
 }