示例#1
0
        private void StudentSaveButton_Click(object sender, EventArgs e)
        {
            if (department == null)
            {
                MessageBox.Show("Please Create Department First!");
                return;
            }

            Student student = new Student();

            student.Name  = studentNameTextBox.Text;
            student.RegNo = regNoTextBox.Text;
            student.Email = emailTextBox.Text;

            bool isAdded = department.AddStudent(student);

            if (isAdded)
            {
                studentNameTextBox.Text = "";
                regNoTextBox.Text       = "";
                emailTextBox.Text       = "";
            }
            else
            {
                MessageBox.Show("Department Capacity Full!");
            }
        }
示例#2
0
        private void StudentSaveButton_Click(object sender, EventArgs e)
        {
            Student student = new Student();

            student.Name  = studentNameTextBox.Text;
            student.RegNo = regNoTextBox.Text;
            student.Email = emailTextBox.Text;

            bool isAdded = department.AddStudent(student);

            if (isAdded)
            {
                studentNameTextBox.Text = "";
                regNoTextBox.Text       = "";
                emailTextBox.Text       = "";
            }
        }
 private void StudentSaveButton_Click(object sender, EventArgs e)
 {
     student       = new Student();
     student.RegNo = regNoTextBox.Text;
     student.Name  = studentNameTextBox.Text;
     student.Email = emailTextBox.Text;
     if (department.GetStudents().Count < 5)
     {
         department.AddStudent(student);
     }
     else
     {
         MessageBox.Show("Student is Overflow");
     }
     regNoTextBox.Text       = "";
     studentNameTextBox.Text = "";
     emailTextBox.Text       = "";
 }