コード例 #1
0
        public void getCourseSectionsAPITest()
        {
            Course course = proxy.getCourse(1);

            Section[] sections = this.proxy.getCourseSections(course);
            Assert.IsNotNull(sections);
        }
コード例 #2
0
        public ActionResult CourseDetail(int courseID)
        {
            if (!loggedIn())
            {
                return(RedirectToAction("Index", "Login", new { redirectAction = "CourseList", redirectController = "Course" }));
            }

            Course course = proxy.getCourse(courseID);

            ViewData["Title"] = "Course Detail";
            ViewData["Role"]  = Session["role"];
            return(View(course));
        }
コード例 #3
0
        private SectionDisplay getSectionData(Section section)
        {
            string fName       = proxy.getUser(section.InstructorID).FirstName;
            string lName       = proxy.getUser(section.InstructorID).LastName;
            int    buildingNum = proxy.getLocation(section.LocationID).BuildingID;
            int    roomNum     = proxy.getLocation(section.LocationID).RoomNumber;

            SectionDisplay sectionData = new SectionDisplay();

            sectionData.sectionID      = section.ID;
            sectionData.instructorName = fName + " " + lName;
            sectionData.courseName     = proxy.getCourse(section.CourseID).Name;
            sectionData.locationName   = "Building " + buildingNum + ", Room " + roomNum;

            return(sectionData);
        }
コード例 #4
0
 public ActionResult SectionList(int courseID)
 {
     ViewData["Title"] = "Sections of " + (proxy.getCourse(courseID)).Name;
     return(PartialView(proxy.getCourseSections(proxy.getCourse(courseID))));
 }