예제 #1
0
        public static async Task <T> ByIdWholeWorkForAll <T>(string domain, string ApiUniversity, string strid)
        {
            string queryString = @"api/" + ApiUniversity + "?strid=" + strid;
            T      Courses     = await CoursesControllerUtl.GetFromApiForAllSingle <T>(domain, queryString);

            return(Courses);
        }
        public async Task <ActionResult> GetRankings(string strid)
        {
            AllCollegeCourseModel SingleCourse = await CoursesControllerUtl.ByIdWholeWorkForAll <AllCollegeCourseModel>(domain, "AllCollege", strid);

            List <Ranking> rankings = SingleCourse.rankingdata;

            return(PartialView(rankings));
        }
        public async Task <ActionResult> GetComments(string strid)
        {
            AllCollegeCourseModel SingleCourse = await CoursesControllerUtl.ByIdWholeWorkForAll <AllCollegeCourseModel>(domain, "AllCollege", strid);

            List <Comment> comments = SingleCourse.commentdata;

            return(PartialView(comments));
        }
예제 #4
0
        public static async Task <IEnumerable <T> > BySearchAllWholeWork <T>(string domain, string ApiUniversity, string query)
        {
            IEnumerable <T> Courses     = null;
            string          queryString = null;

            if (query == null)
            {
                queryString = CoursesControllerUtl.QueryStringGenerator(ApiUniversity, query, 100);
                Courses     = await CoursesControllerUtl.GetFromApi <T>(domain, queryString);
            }
            else
            {
                queryString = CoursesControllerUtl.QueryStringGenerator(ApiUniversity, query);
                Courses     = await CoursesControllerUtl.GetFromApi <T>(domain, queryString);
            }

            return(Courses);
        }
        public async Task <ActionResult> GetCourseDetail(string strid)
        {
            AllCollegeCourseModel SingleCourse = await CoursesControllerUtl.ByIdWholeWorkForAll <AllCollegeCourseModel>(domain, "AllCollege", strid);

            return(View(SingleCourse));
        }
        //[ChildActionOnly]
        public async Task <ActionResult> GetBySearchAll(string college = "NTU", string query = null)
        {
            IEnumerable <AllCollegeCourseModel> AllCollegeCourses = await CoursesControllerUtl.BySearchAllWholeWorkForAll <AllCollegeCourseModel>(domain, "AllCollege", college, query);

            return(PartialView(AllCollegeCourses));
        }
        public async Task <ActionResult> GetNckuBySearchAll(string query = null)
        {
            IEnumerable <NckuCourseModel> nckuCourses = await CoursesControllerUtl.BySearchAllWholeWork <NckuCourseModel>(domain, "ncku", query);

            return(PartialView(nckuCourses));
        }
        public async Task <ActionResult> PostRanking(string strid, Ranking ranking)
        {
            AllCollegeCourseModel SingleCourse = await CoursesControllerUtl.ByIdWholeWorkForAll <AllCollegeCourseModel>(domain, "AllCollege", strid);

            return(PartialView(SingleCourse));
        }