internal StudentSelectForm(Student[] students)
 {
     InitializeComponent();
     this.students = students;
     this.Width = 300;
     for (int i = 0; i < students.Length; i++) {
         PictureBox studentImage = new PictureBox();
         studentImage.ImageLocation = students[i].imagePath;
         studentImage.Width = PICTURE_WIDTH;
         studentImage.Height = PICTURE_HEIGHT;
         studentImage.Left = HORIZONTAL_MARGIN;
         studentImage.Top = VERTICAL_MARGIN + (RECORD_DIVIDE * i);
         studentImage.Click += selectStudent;
         this.Controls.Add(studentImage);
     }
 }
示例#2
0
 internal void addRecord(Student student)
 {
     grid.Rows.Add(student, student.id);
 }
示例#3
0
 public void removeRecord(Student student)
 {
     grid.removeRecord<Student>(student);
 }
示例#4
0
 //Displayes student being looked up
 private void displayLookup(Student student)
 {
     ui.lookupPic.ImageLocation = student.imagePath;
     ui.recordBtn.Enabled = true;
     currentLookup = student;
 }
示例#5
0
 //Function to write the students to a file
 private void writeStudents(Student[] students, string filePath)
 {
     StreamWriter file = new StreamWriter(filePath);
     foreach (Student s in students) {
         file.WriteLine (s.ToString () + '\t' + s.id.ToString());
     }
     file.Close();
 }
示例#6
0
 //Records attendance of Student.
 private void recordAttendance(Student student)
 {
     studentGrid.removeRecord(student);
     students.Remove(student);
     ui.updateSearchBox<Student>(students);
     ui.studentPic.ImageLocation = student.imagePath;
     attendees.Add(student);
     ui.writeStatus(student.ToString() + " [" + student.id.ToString() + "] " + "attended");
 }
 private void selectStudent(object sender, EventArgs e)
 {
     PictureBox box = (PictureBox) sender;
     this.selectedStudent = students.First(student => student.imagePath.Equals(box.ImageLocation));
     this.Close();
 }