Esempio n. 1
0
        public ActionResult ResultStudent([Bind(Include = "TermID,search")] SearchView s)
        {
            ViewBag.Message = "The result page";
            Student student = db.People.Where( st => (st.UserName == s.search)).First().Student ;

            ScheduleDisplay display = new ScheduleDisplay();
            //student.Enrolls
            foreach(Enroll e in student.Enrolls)
            {
                if (e.Section.Term.TermID == s.TermID)
                    display.addTimes(e.Section.STimes);
            }

            ViewBag.scheduleDisplay = display;
            return View();
        }
Esempio n. 2
0
        public ActionResult ResultCourse([Bind(Include = "TermID,search")] SearchView s)
        {
            ViewBag.Message = "The result page";

            Course course = db.Courses.Where(st => ( (st.Department.DepartID + st.CourseNum) == s.search)).First();

            ScheduleDisplay display = new ScheduleDisplay();
            //student.Enrolls
            foreach (Section e in course.Sections)
            {
                if (e.TermID == s.TermID)
                    display.addTimes(e.STimes);
            }
            ViewBag.scheduleDisplay = display;
            return View();
        }