コード例 #1
0
        public void howManyGustafson()
        {
            CAFEData test = new CAFEData();

            Assert.AreEqual(2, test.searchLastName("Gustafson").Count);
        }
コード例 #2
0
        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;
            }
        }