private void btnCheckAll_Click(object sender, EventArgs e)
 {
     bool bStopCheckin = false;
     while (bStopCheckin == false)
     {
         CheckinStdFrm frm = new CheckinStdFrm();
         frm.TimeLate = dtLate.Value.TimeOfDay;
         frm.Parent = this;
         frm.SubID = (int)dgvSubject.CurrentRow.Cells["ID"].Value;
         frm.Year = (string)dgvSubject.CurrentRow.Cells["SubYear"].Value;
         frm.Term = (string)dgvSubject.CurrentRow.Cells["SubTerm"].Value;
         frm.ShowDialog();
         frm.GetStopAutoCheckin(ref bStopCheckin);
         dgvSubject_SelectionChanged(null, null);
     }
 }
        void checkinStd_Click(object sender, EventArgs e)
        {
            if (dgvStudent.CurrentRow == null && dgvSubject.CurrentRow == null)
            {
                return;
            }

            CheckinStdFrm frm = new CheckinStdFrm();
            frm.TimeLate = dtLate.Value.TimeOfDay;
            frm.Parent = this;
            frm.Term = (string)dgvSubject.CurrentRow.Cells["SubTerm"].Value;
            frm.SubID = (int)dgvSubject.CurrentRow.Cells["ID"].Value;
            frm.Year = (string)dgvSubject.CurrentRow.Cells["SubYear"].Value;
            frm.ShowDialog();

            dgvSubject_SelectionChanged(null, null);
        }