Example #1
0
        public ActionResult Index()
        {
            if (Request.Cookies.AllKeys.Contains(CookiesNames.LandingVisited))
            {
                var userInfo = new UserDataContainer();

                var news   = newsManager.GetListMatchingUserGroups(userInfo, "PostingDate");
                var result = new NewsListPageView(Mapper.Map <NewsItemViewModel, NewsItem>(news));

                return(View(result));
            }

            return(RedirectToRoute("Landing"));
        }
Example #2
0
        public ActionResult GetList(string groupName)
        {
            var userdata = new UserDataContainer();
            IEnumerable <NewsItemViewModel> news;

            if (groupName != "All")
            {
                news = Mapper.Map <NewsItemViewModel, NewsItem>(newsManager.GetListForGroup(groupName));
            }
            else
            {
                news = Mapper.Map <NewsItemViewModel, NewsItem>(newsManager.GetListMatchingUserGroups(userdata));
            }

            var result = new NewsListPageView(news);

            return(PartialView("NewsList", result));
        }