예제 #1
0
        public ActionResult Art(int categoryId, int take = 25, int skip = 0)
        {
            var category = _categoryService.GetCategory(categoryId);

            var model = new GalleryPaintingModel()
            {
                Category  = category ?? new CategoryModel(),
                Paintings = category != null?_paintingService.GetPaintingsByCategory(category.Id, take, skip) : new PaintingModelList()
            };

            return(View(model));
        }
예제 #2
0
        private PaintingModelList _GetPaintings(int?id)
        {
            PaintingModelList model = null;

            if (id.HasValue)
            {
                model = _paintingService.GetPaintingsByCategory(id.Value, 100, 0);
            }
            else
            {
                model = _paintingService.GetPaintings();
            }

            return(model);
        }