Beispiel #1
0
        public IHttpActionResult Comment(Course course)
        {
            int bl = 0;

            if (course.Name == ElearnerDataLayoutActions.GetCourseFromDb(3, null).Name)
            {
                bl = 1;
            }


            return(Ok(course));
        }
Beispiel #2
0
        public ActionResult SearchResult(SearchViewModel vm)
        {
            vm.SearchResults = new List <Course>();

            if (!ModelState.IsValid || vm.Search() == null)
            {
                TempData["InvalidSearchMessage"] = "Invalid Search";
                return(RedirectToAction("Index"));
            }

            foreach (var item in vm.Search())
            {
                vm.SearchResults.Add(ElearnerDataLayoutActions.GetCourseFromDb(item.Id, null));
            }

            return(View(vm));
        }
Beispiel #3
0
        public IHttpActionResult Comment()
        {
            List <Course> list = new List <Course>
            {
                ElearnerDataLayoutActions.GetCourseFromDb(2, null),
                ElearnerDataLayoutActions.GetCourseFromDb(3, null),
                ElearnerDataLayoutActions.GetCourseFromDb(4, null),
                ElearnerDataLayoutActions.GetCourseFromDb(5, null),
                ElearnerDataLayoutActions.GetCourseFromDb(6, null)
            };


            List <Course> list2 = new List <Course>();

            list2.Add(new Course {
                Name = list[0].Name, Id = list[0].Id, Duration = list[0].Duration, Price = list[0].Price, TeacherId = list[0].TeacherId, Description = list[0].Description
            });

            return(Ok(list2));
        }
Beispiel #4
0
        // GET: Courses
        public ActionResult CourseView(int id)
        {
            Course queryResult = ElearnerDataLayoutActions.GetCourseFromDb(id, null);

            return(View(queryResult));
        }