예제 #1
0
        // GET: BeerType
        public ActionResult Index()
        {
            var model = new BeerTypeViewModelIndex();

            model.BeerTypeViewModelList = _beerTypeService.GetAll().ToBeerTypeModelList();
            return(View(model));
        }
예제 #2
0
        public ActionResult Filter(BeerTypeViewModelFilter filter)
        {
            var model = new BeerTypeViewModelIndex(filter);

            if (string.IsNullOrWhiteSpace(filter.StringFilter))
            {
                model.BeerTypeViewModelList = _beerTypeService.GetAll().ToBeerTypeModelList();
            }
            else
            {
                model.BeerTypeViewModelList = _beerTypeService.GetByName(filter.StringFilter).ToBeerTypeModelList();
            }
            return(View("Index", model));
        }