@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<style>
th {
background-color: antiquewhite;
}
th, td{
padding: 10px;
}
</style>
@using (Html.BeginForm())
{
<div class="text-center">
<h1 class="display-4">Project 4: Advanced Project</h1>
<h3>Aurel Villyani</h3>
@* <button class="btn-primary" type="submit" value="get_instructor_list" asp-page-handler="AccessInstructorList">Get Instructor List</button>*@
@if (ViewData["showInstructorList"] != null)
{
<label for="instructorList">Select an instructor: </label>
@Html.DropDownList("instructorList", (IEnumerable<SelectListItem>)ViewData["showInstructorList"])
}
<button asp-page-handler="GetInstructorInfo">Get Instructor Info</button>
@if (ViewData["showInstructorInformation"] != null)
{
var showData = ViewData["showInstructorInformation"] as System.Data.DataTable;
var students = ViewData["students"] as System.Data.DataTable;
// Get student in course
//
@foreach (System.Data.DataRow row in showData.Rows)
{
<table>
<tr>
<th>Course No</th>
<th>Course Name</th>
<th>Students</th>
<th>Section Number</th>
<th>Starting Date</th>
<th>Location</th>
<th>Capacity</th>
</tr>
<tr>
<td>@row["course_id"]</td>
<td>@row["course_name"]</td>
<td>
<table>
<tr>
<th>Student ID</th>
<th>Student Name</th>
</tr>
@foreach (System.Data.DataRow student in students.Rows)
{
if (student["course_id"].Equals(row["course_id"]) && student["section_number"].Equals(row["section_number"]))
{
<tr>
<td>@student["student_id"]</td>
<td>@student["student_name"]</td>
</tr>
}
}
</table>
</td>
<td>@row["section_number"]</td>
<td>@row["starting_date"]</td>
<td>@row["location"]</td>
<td>@row["capacity"]</td>
</tr>
</table>
}
}
</div>
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}