Пример #1
0
        public ActionResult News(int id)
        {
            CategoryService categoryService = new CategoryService();
            NewsService newsService = new NewsService();
            CourseService CoursesService = new CourseService();

            NewsModel model = new NewsModel();
            model.News = newsService.GetAllNews();
            model.Courses = CoursesService.GetTopCourses();
            model.CurrentNews = newsService.GetNews(id);
            model.Categories = categoryService.GetAllCategory();
            return View(model);
        }
Пример #2
0
        //
        // GET: /Home/
        public ActionResult Index()
        {
            CategoryService categoryService = new CategoryService();
            NewsService newsService = new NewsService();
            CourseService topCoursesService = new CourseService();

            MainPageModel model = new MainPageModel();
            model.News = newsService.GetAllNews();
            model.Courses = topCoursesService.GetTopCourses();

            model.Categories = categoryService.GetAllCategory();
            return View(model);
        }