예제 #1
0
        public ActionResult ById(int?id)
        {
            var issue = id.HasValue ? IssueController.GetById(id.Value) : null;

            if (issue == null)
            {
                return(RedirectToAction("Index"));
            }

            return(View(issue));
        }
예제 #2
0
        public ActionResult Category(int?id)
        {
            var categoryList = LayoutHelper.GetCategories();

            var category = id.HasValue ? categoryList.FirstOrDefault(cat => cat.Id == id.Value) : null;

            if (category == null)
            {
                return(RedirectToAction("Index"));
            }

            var issues = IssueController.InternalGetIssues(0, -1, category.Id);

            return(View(new CategryIssues(issues.Data)
            {
                Category = category, Total = issues.TotalCount
            }));
        }