Example #1
0
        // GET: Admin/NewsGroup/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NewsGroup newsGroup = _newsGroupService.GetById(id);

            if (newsGroup == null)
            {
                return(HttpNotFound());
            }
            return(View(newsGroup));
        }
        // GET: Admin/NewsGroups/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var newsGroup = await _newsGroupService.GetById(id);

            if (newsGroup == null)
            {
                return(NotFound());
            }

            return(View(newsGroup));
        }
Example #3
0
        public ActionResult Groups(int?id, string group, int page = 1, int pageSize = 6)
        {
            try
            {
                NewsGroup newsGroup;
                if (id != null && group == null)
                {
                    newsGroup = _newsGroupService.GetById(id);
                    group     = newsGroup.AliasName;
                }
                else
                {
                    newsGroup = _newsGroupService.GetByAlians(group);
                }
                ViewBag.group = group;

                return(View(newsGroup.News.ToPagedList(page, pageSize)));
            }
            catch
            {
                return(View("_NotFound"));
            }
        }