Ejemplo n.º 1
0
        private void comboCourse_SelectedIndexChanged(object sender, EventArgs e)
        {
            btnStopAttendance.Visible = false;
            lblCourse.Visible         = false;
            lblRegistered.Visible     = false;
            btnTakeAttendance.Enabled = false;

            if (comboCourse.SelectedIndex > 0)
            {
                _courseId       = comboCourse.SelectedValue.ToString();
                _studentFingers = _repo.GetFingersOfCourseStudents(_courseId);
                if (_studentFingers == null)
                {
                    Base.ShowError("", "There is no active semester. You cannot take attendance");
                    return;
                }
                if (_studentFingers.Count == 0)
                {
                    Base.ShowError("", "There is no registered students with fingerprints enrolled. You cannot take attendance");
                    return;
                }

                btnTakeAttendance.Enabled = true;
                lblCourse.Text            = comboCourse.SelectedText;
                lblCourse.Visible         = true;
                lblRegistered.Text        = "Registered Students (with Fingerprints enrolled): " + _studentFingers.Select(x => x.StudentId).Distinct().Count().ToString();
                lblRegistered.Visible     = true;

                comboScanner.Items.Clear();
                comboScanner.Items.Add("Digital Persona Scanner");
                comboScanner.SelectedIndex = 0;
                comboScanner.Enabled       = true;

                LoadTodayAttendanceForCourse();
            }
        }