Beispiel #1
0
        // GET: Categories
        public ActionResult Index([FromQuery] CategorySearch categorySearch)
        {
            categorySearch.PageNumber = 0;
            var categories = _searchCategoriesCommand.Execute(categorySearch);

            return(View(categories.Data));
        }
 // GET: Products/Create
 public ActionResult Create()
 {
     ViewBag.Manufacturers = new SelectList(_getManufacturers.Execute(), "ManufacturerId", "Name");
     ViewBag.Categories    = new SelectList(_getCategories.Execute(), "CategoryId", "Name");
     ViewBag.Suppliers     = new SelectList(_getSuppliers.Execute(), "SupplierId", "Name");
     return(View());
 }
Beispiel #3
0
        // GET: Categories
        public ActionResult Index(string sortOrder, string searchString, CategoryQuery query)
        {
            ViewBag.CategorySortParam = String.IsNullOrEmpty(sortOrder) ? "category_desc" : "";
            ViewBag.CurrentSortOrder  = sortOrder;
            ViewBag.CurrentFilter     = searchString;

            var categoryList = _getCategories.Execute(query);

            return(View(categoryList));
        }
Beispiel #4
0
 public ActionResult <IEnumerable <CategoryDto> > Get([FromQuery] CategoryQuery query)
 {
     try
     {
         return(Ok(_getCategories.Execute(query)));
     }
     catch (NotFoundException)
     {
         return(NotFound());
     }
 }
Beispiel #5
0
 public IActionResult Get(int id)
 {
     try
     {
         var search = new NameSearch
         {
             Id = id
         };
         var result = _getCategories.Execute(search);
         return(Ok(result.First()));
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Beispiel #6
0
 public IActionResult GetAll([FromQuery] CategorySearch request)
 {
     try
     {
         var response = _getCategoriesCommand.Execute(request);
         return(Ok(response));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex.Message));
     }
 }
 public IActionResult Get([FromQuery] CategorySearch search)
 {
     try
     {
         var dto = _getCategoriesCommand.Execute(search);
         return(Ok(dto));
     }
     catch (EntityNotFoundException)
     {
         return(Conflict("There's no data for your request."));
     }
 }
Beispiel #8
0
 // GET: Cars/Create
 public ActionResult Create()
 {
     ViewBag.Categories = _getCategoriesCommand.Execute(new CategorySearch {
     });
     ViewBag.Types      = _getTypesCommand.Execute(new TypeSearch {
     });
     ViewBag.Fuels      = _getFuelsCommand.Execute(new FuelSearch {
     });
     ViewBag.Models     = _getModelsCommand.Execute(new ModelSearch {
     });
     ViewBag.Brands     = _getBrandsCommand.Execute(new BrandSearch {
     });
     return(View());
 }
Beispiel #9
0
 public IActionResult Get([FromQuery] CategorySearch search)
 {
     try
     {
         var kategorija = _getCategoriesCommand.Execute(search);
         return(Ok(kategorija));
     }
     catch (EntityNotFoundException e)
     {
         if (e.Message == "Kategorija doesn't exist.")
         {
             return(NotFound(e.Message));
         }
         return(UnprocessableEntity(e.Message));
     }
 }
        public IActionResult Index([FromQuery] ArticleSearch articleSearch, CategorySearch categorySearch)
        {
            articleSearch.PageNumber = 0;
            var articles = _searchArticlesCommand.Execute(articleSearch);

            categorySearch.PageNumber = 0;
            var categories = _searchCategoriesCommand.Execute(categorySearch);

            var viewModel = new HomeViewModel
            {
                Articles   = articles.Data,
                Categories = categories.Data
            };

            return(View(viewModel));
        }
Beispiel #11
0
 public ActionResult Get([FromQuery] CategorySearch search)
 => Ok(getCategoriesCommand.Execute(search));
Beispiel #12
0
 public IActionResult Get([FromQuery] CategoryQuery query)
 {
     return(Ok(_getCommand.Execute(query)));
 }
Beispiel #13
0
 public ActionResult <PagedResponse <CategoryDto> > Get([FromQuery] CategorySearch categorySearch)
 => Ok(_searchCategoriesCommand.Execute(categorySearch));
 //[LoggedIn("Admin")]
 // GET: News/Create
 public ActionResult Create()
 {
     ViewBag.Categories = _getCategoriesCommand.Execute(null);
     return(View());
 }
 public ActionResult <IEnumerable <CategoryDTO> > Get([FromQuery] CategorySearch query)
 {
     return(Ok(_getCommand.Execute(query)));
 }
Beispiel #16
0
 //[ClaimRequirement(_user.RoleName, "Admin")]
 // GET: News/Create
 public ActionResult Create()
 {
     ViewBag.Korisnik   = HttpContext.Session.GetString("User");
     ViewBag.Categories = _getCategoriesCommand.Execute(null);
     return(View());
 }
Beispiel #17
0
        // GET: Category
        public ActionResult Index(CategoryQuery search)
        {
            var categories = _getCommand.Execute(search);

            return(View(categories));
        }
Beispiel #18
0
 private IEnumerable GetCategories(CategorySearch search)
 {
     return(_categoryCommand.Execute(search));
 }
Beispiel #19
0
 public IActionResult Get([FromQuery] CategorySearch query)
 => Ok(_getCommand.Execute(query));
Beispiel #20
0
        // GET: Categories
        public ActionResult Index(CategorySearch search)
        {
            var result = _getCommand.Execute(search);

            return(View(result));
        }
        public ActionResult <IEnumerable <CategoryDto> > Get([FromQuery] CategorySearch search)
        {
            var categories = _getCommand.Execute(search);

            return(Ok(categories));
        }
 public IActionResult Get([FromQuery] CategoriesSearch query)
 {
     return(Ok(_getCommands.Execute(query)));
 }
        public ActionResult Index(CategorySearch model)
        {
            var response = _listCategoryCommand.Execute(model);

            return(View(response));
        }