protected void ModifyStudentButton_Click(object sender, EventArgs e) { BCS RequestDirector = new BCS(); Student EnrolledStudent = new Student(); EnrolledStudent.StudentId = StudentIdTB.Text; EnrolledStudent.FirstName = FirstNameTextBox.Text; EnrolledStudent.LastName = LastNameTextBox.Text; EnrolledStudent.Email = EmailTextBox.Text; try { bool confirmation = RequestDirector.ModifyStudent(EnrolledStudent); if (confirmation) { MessageLabel.Text = ("Changed Successfully"); Panel1.Visible = false; } else { MessageLabel.Text = ("Change unsuccessful"); } } catch (Exception ex) { MessageLabel.Text = "Change unsuccessful"; } }
public void OnPostModifyStudent(string studentId, string firstName, string lastName, string email, string programList) { ModifiedStudent = new Student(); ModifiedStudent.StudentId = studentId; ModifiedStudent.FirstName = firstName; ModifiedStudent.LastName = lastName; ModifiedStudent.Email = email; ModifiedStudent.ProgramCode = programList; Success = _requestDirector.ModifyStudent(ModifiedStudent); if (Success == true) { Message = "Student Update Successful"; } else { Message = "Student Update failed"; } }
public void OnPostEdit(string studentIDField) { if (ModelState.IsValid) { bool confirm = false; BCS RequestDirector = new BCS(); Student modifyStudent = new Student() { StudentID = studentIDField, FirstName = FirstNameField, LastName = LastNameField, Email = EmailField }; confirm = RequestDirector.ModifyStudent(modifyStudent); Message = $"Edit : {confirm}"; } }
public void OnPost() { if (ModelState.IsValid) { bool Confirmation; Student AcceptedStudent = new Student { StudentID = StudentIDField, FirstName = FirstNameField, LastName = LastNameField, Email = EmailField }; BCS RequestDirector = new BCS(); Confirmation = RequestDirector.ModifyStudent(AcceptedStudent); Message = $"Edit :{Confirmation} {AcceptedStudent.FirstName} {AcceptedStudent.LastName} {AcceptedStudent.StudentID}"; } else { Message = $"Not Valid"; } }