protected void Submit_Click(object sender, EventArgs e)
    {
        BCS requestDirector = new BCS();

        try
        {
            Panel1.Visible = true;
            Program        program   = requestDirector.FindProgram(FindStudentsByProgramTextBox.Text);
            TableHeaderRow HeaderRow = new TableHeaderRow();


            TableHeaderCell StudentIDHeaderCell = new TableHeaderCell();
            StudentIDHeaderCell.Text = "Student ID";
            HeaderRow.Cells.Add(StudentIDHeaderCell);

            TableHeaderCell FirstNameHeaderCell = new TableHeaderCell();
            FirstNameHeaderCell.Text = "First Name";
            HeaderRow.Cells.Add(FirstNameHeaderCell);

            TableHeaderCell LastNameHeaderCell = new TableHeaderCell();
            LastNameHeaderCell.Text = "Last Name";
            HeaderRow.Cells.Add(LastNameHeaderCell);

            TableHeaderCell EmailHeaderCell = new TableHeaderCell();
            EmailHeaderCell.Text = "Email Address";
            HeaderRow.Cells.Add(EmailHeaderCell);

            StudentTable.Rows.Add(HeaderRow);

            foreach (Student student in program.EnrolledStudents)
            {
                // Create a TableRow for each student
                TableRow StudentTableRow = new TableRow();
                // Create a TableCell for each property of a Student
                // and add the TableCell to the TableRow
                TableCell StudentIDCell = new TableCell();
                // StudentIDCell.BorderStyle = BorderStyle.Inset
                StudentIDCell.Text = student.StudentId;
                StudentTableRow.Cells.Add(StudentIDCell);
                TableCell FirstNameCell = new TableCell();
                FirstNameCell.Text = student.FirstName;
                StudentTableRow.Cells.Add(FirstNameCell);
                TableCell LastNameCell = new TableCell();
                LastNameCell.Text = student.LastName;
                StudentTableRow.Cells.Add(LastNameCell);
                TableCell EmailCell = new TableCell();
                EmailCell.Text = student.Email;
                StudentTableRow.Cells.Add(EmailCell);
                // Add the TableRow to the Table
                StudentTable.Rows.Add(StudentTableRow);
            }
        }
        catch (Exception)
        {
            Panel1.Visible    = false;
            MessageLabel.Text = "Error loading program info";
        }
    }
예제 #2
0
 public void OnPostEdit(string id)
 {
     if (ModelState.IsValid)
     {
         bool confirm         = false;
         BCS  RequestDirector = new BCS();
         programName = RequestDirector.FindProgram(id);
         Message     = $"Edit : {confirm}";
     }
 }
예제 #3
0
        public void OnPost(string id)
        {
            BCS RequestDirector = new BCS();

            program          = RequestDirector.FindProgram(id);
            ProgramCode1     = program.ProgramCode;
            Description      = program.Description;
            EnrolledStudents = program.EnrolledStudents;

            Message = $"Viewing {program.ProgramCode}";
        }
예제 #4
0
        public void OnGet(string programCode)
        {
            RequestDirector = new BCS();
            NAITProgram SelectedProgram = new NAITProgram()
            {
                ProgramCode = programCode,
                Description = RequestDirector.FindProgram(programCode).Description
            };

            ProgramCode = SelectedProgram.ProgramCode;
            Description = SelectedProgram.Description;
        }
예제 #5
0
        public void OnPost()
        {
            searchedProgram = _requestDirector.FindProgram(SearchBox);

            ProgramCode      = searchedProgram.ProgramCode;
            Description      = searchedProgram.Description;
            EnrolledStudents = searchedProgram.EnrolledStudent;

            if (searchedProgram == null)
            {
                Message = "Program Does Not Exist";
            }
        }