private void loadData() { firstName = firstText.Text; lastName = lastText.Text; nuid = studentText.Text; if(string.IsNullOrEmpty(firstName) || string.IsNullOrWhiteSpace(firstName) || string.IsNullOrEmpty(lastName) || string.IsNullOrWhiteSpace(lastName) || string.IsNullOrEmpty(nuid) || string.IsNullOrWhiteSpace(nuid)) { StudentRegistrationWarning popup = new StudentRegistrationWarning(); DialogResult dialogresult = popup.ShowDialog(); if (dialogresult == DialogResult.OK) { popup.Close(); } popup.Dispose(); } dept = comboBoxDepartment.SelectedItem.ToString(); if (radioButtonFullTime.Checked == true) { enrollType = "Full Time"; } else { enrollType = "Part Time"; } Student student = new Student(nuid, firstName, lastName, dept, enrollType); mockStudentList.Add(student); }
private void button1_Click(object sender, EventArgs e) { firstName = firstText.Text; lastName = lastText.Text; nuid = studentText.Text; dept = comboBoxDepartment.SelectedItem.ToString(); if (radioButtonFullTime.Checked == true) { enrollType = "Full Time"; } else { enrollType = "Part Time"; } Student student = new Student(nuid, firstName, lastName, dept, enrollType); mockStudentList.Remove(student); }