Exemplo n.º 1
0
        public string Get()
        {
            List <Course_Week> course_weeklist = Course_WeekManager.GetFullCourse_Weeklist();
            var json = JsonConvert.SerializeObject(course_weeklist);

            return(json);
        }
Exemplo n.º 2
0
        public ActionResult ViewStudentCourse(int courseid, int loggedid)
        {
            List <Course_Week> course_weeklist = Course_WeekManager.GetFullCourse_Weeklist();

            //fillters out courses_week which are not corresponded to given courseid
            for (int i = course_weeklist.Count - 1; i >= 0; i--)
            {
                if (course_weeklist[i].CourseId != courseid)
                {
                    course_weeklist.RemoveAt(i);
                }
            }
            //get coursename from courseid and add to viewbag
            Course c = CourseManager.getObjectById(courseid);

            ViewBag.coursname    = c.Title;
            ViewBag.coursenumber = c.Coursenumber;

            ViewBag.loggedid = loggedid;
            return(View(course_weeklist));
        }