public void noHoursFrankBogacki() { CAFEData test = new CAFEData(); List <Faculty> facList = test.searchFaculty("Frank", "Bogacki"); Assert.AreEqual(1, facList.Count); int facID = facList[0].FacultyID; int termID = test.getTermID(new DateTime(2010, 4, 12)); Assert.AreEqual(8, termID); Assert.AreEqual(0, test.getOfficeHours(facID, termID).Count); }
public void CheckBrinkmanHours() { CAFEData test = new CAFEData(); List <Faculty> facList = test.searchFaculty("Barry", "Brinkman"); Assert.AreEqual(1, facList.Count); int facID = facList[0].FacultyID; Assert.AreEqual(109, facID); int termID = test.getTermID(new DateTime(2010, 4, 12)); Assert.AreEqual(8, termID); List <OfficeHour> hourList = test.getOfficeHours(facID, termID); Assert.AreEqual(4, hourList.Count); Assert.AreEqual("Monday", hourList[0].Day); Assert.AreEqual(15, hourList[0].FromTime.Hour); Assert.AreEqual(0, hourList[0].FromTime.Minute); Assert.AreEqual(17, hourList[0].ToTime.Hour); Assert.AreEqual(0, hourList[0].ToTime.Minute); Assert.AreEqual("Thursday", hourList[1].Day); Assert.AreEqual(13, hourList[1].FromTime.Hour); Assert.AreEqual(0, hourList[1].FromTime.Minute); Assert.AreEqual(15, hourList[1].ToTime.Hour); Assert.AreEqual(0, hourList[1].ToTime.Minute); Assert.AreEqual("Friday", hourList[2].Day); Assert.AreEqual(9, hourList[2].FromTime.Hour); Assert.AreEqual(0, hourList[2].FromTime.Minute); Assert.AreEqual(10, hourList[2].ToTime.Hour); Assert.AreEqual(0, hourList[2].ToTime.Minute); Assert.AreEqual("Friday", hourList[3].Day); Assert.AreEqual(13, hourList[3].FromTime.Hour); Assert.AreEqual(30, hourList[3].FromTime.Minute); Assert.AreEqual(14, hourList[3].ToTime.Hour); Assert.AreEqual(30, hourList[3].ToTime.Minute); }
private void updateAvailableHoursTable() { Label2.Text = currentProf + "'s Office Hours"; if (Session["email"] != null) { Label6.Text = Session["email"].ToString(); } else { Label10.Text = "**You are not logged in! Please click 'Go Back' and log in to use the system.**"; Button3.Enabled = false; Button3.UseSubmitBehavior = false; } int currentTerm = datasource.getTermID(Calendar1.SelectedDate); List <CAFEDataInterface.Faculty> facultyRecords = datasource.searchLastName(currentProf); int currentFacultyID = facultyRecords[0].FacultyID; string currentFacultyEmail = facultyRecords[0].Email; string currentOffice = facultyRecords[0].Office; //this.setFacultyEmail(currentFacultyEmail); this.setFacultyOffice(currentOffice); string email = facultyRecords[0].Email.ToString(); string office = facultyRecords[0].Office.ToString(); HiddenField2.Value = email; Label17.Text = "Office: " + office; Label18.Text = "For: " + Calendar1.SelectedDate.DayOfWeek.ToString() + " (Select Above)"; List <CAFEDataInterface.OfficeHour> currentOfficeHours = datasource.getOfficeHours(currentFacultyID, currentTerm); Table1.Rows.Clear(); TableRow tRow = new TableRow(); Table1.Rows.Add(tRow); TableCell tCell = new TableCell(); tRow.Cells.Add(tCell); tCell.Text = findDayInOfficeHours(currentOfficeHours, "Monday"); tRow.Cells.Add(tCell); TableRow tRow2 = new TableRow(); Table1.Rows.Add(tRow2); TableCell tCell2 = new TableCell(); tRow2.Cells.Add(tCell2); tCell2.Text = findDayInOfficeHours(currentOfficeHours, "Tuesday"); tRow2.Cells.Add(tCell2); TableRow tRow3 = new TableRow(); Table1.Rows.Add(tRow3); TableCell tCell3 = new TableCell(); tRow3.Cells.Add(tCell3); tCell3.Text = findDayInOfficeHours(currentOfficeHours, "Wednesday"); tRow3.Cells.Add(tCell3); TableRow tRow4 = new TableRow(); Table1.Rows.Add(tRow4); TableCell tCell4 = new TableCell(); tRow4.Cells.Add(tCell4); tCell4.Text = findDayInOfficeHours(currentOfficeHours, "Thursday"); tRow4.Cells.Add(tCell4); TableRow tRow5 = new TableRow(); Table1.Rows.Add(tRow5); TableCell tCell5 = new TableCell(); tRow5.Cells.Add(tCell5); tCell5.Text = findDayInOfficeHours(currentOfficeHours, "Friday"); tRow5.Cells.Add(tCell5); this.radioList(currentOfficeHours); if (RadioButtonList1.Text == null || RadioButtonList1.Text == "") { Button3.UseSubmitBehavior = false; Button3.Enabled = false; } }