Пример #1
0
        public IActionResult Create()
        {
            ViewBag.CategoryList = galleryItemCategoryService.GetGalleryItemCategories();
            ViewBag.GalleryList  = new SelectList(galleryService.GetGalleries(), "Id", "Name");
            var galleryItem = new GalleryItemViewModel();

            return(View(galleryItem));
        }
Пример #2
0
        public ActionResult Index(int top = 6)
        {
            var modelData = GalleryService.GetGalleries(top);

            ViewBag.IsAdminUser = GalleryService.IsAdminUser(User);
            return(View("Index", modelData));
        }
Пример #3
0
        public IActionResult Index()
        {
            var result = _galleryService.GetGalleries();

            if (result.Success)
            {
                return(View(result.Data.Where(x => x.IsActive == true).ToList()));
            }
            return(View());
        }
        public IActionResult ListGallery()
        {
            var result = _galleryService.GetGalleries();

            if (result.Success)
            {
                return(View(result.Data));
            }
            ViewData["GeneralError"] = Messages.GeneralError;
            return(View());
        }
Пример #5
0
 public IActionResult GetGalleries()
 {
     try
     {
         return(Ok(_galleryService.GetGalleries()));
     }
     catch (Exception ex)
     {
         _logger.LogError("Error", ex);
         return(BadRequest());
     }
 }