Beispiel #1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (int.TryParse(DeleteStudentTextBox.Text, out int studentid))
     {
         StudentMapper.DeleteStudentByID(studentid);
     }
     UpdateStudentsList(StudentMapper.ReadAllStudents());
 }
Beispiel #2
0
        private void InsertStudentButtonClicked_Click(object sender, EventArgs e)
        {
            Student newStudent = new Student()
            {
                Name      = textBoxStudentName.Text,
                StudentID = int.Parse(textBoxStudentID.Text)
            };

            StudentMapper.CreateStudent(newStudent);
            UpdateStudentsList(StudentMapper.ReadAllStudents());
        }
Beispiel #3
0
 private void LoadRoomsAndStudents(object sender, EventArgs e)
 {
     UpdateRoomList(DormRoomMapper.GetAllRooms());
     UpdateStudentsFromRoomList(StudentMapper.ReadAllStudents());
     UpdateStudentsList(StudentMapper.ReadAllStudents());
 }