Esempio n. 1
0
        //
        // GET: /Admin/Beer/Create
        public ActionResult Create(string breweryId)
        {
            var brewery = _breweryOrchestrator.GetById(breweryId);
            var styles  = _styleOrchestrator.GetStyles();

            if (null != brewery)
            {
                var vm = new CreateBeerViewModel(styles)
                {
                    BreweryId = brewery.Id, BreweryName = brewery.Name
                };
                return(View(vm));
            }

            ModelState.AddModelError("Brewery", "Brewery with that id does not exist.");
            return(View(new CreateBeerViewModel()
            {
                BreweryId = breweryId
            }));
        }
Esempio n. 2
0
        // GET: Admin/Style
        public ActionResult Index()
        {
            var styles = _styleOrchestrator.GetStyles();

            return(View(styles));
        }