Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("BrewID,CreateDate,Name,Description,Style,Yield,OriginalGravity,FinalGravity,ABV")] Brew brew)
        {
            if (ModelState.IsValid)
            {
                _context.Add(brew);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(brew));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("IngredientID,Amount,IngredientName,BrewID")] Ingredient ingredient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ingredient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrewID"] = new SelectList(_context.Brew, "BrewID", "BrewID", ingredient.BrewID);
            return(View(ingredient));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("StepID,StepNote,BrewID")] Step step)
        {
            if (ModelState.IsValid)
            {
                _context.Add(step);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrewID"] = new SelectList(_context.Brew, "BrewID", "Description", step.BrewID);
            return(View(step));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("NoteID,DateLogged,NoteDescription,BrewID")] Note note)
        {
            if (ModelState.IsValid)
            {
                _context.Add(note);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrewID"] = new SelectList(_context.Brew, "BrewID", "BrewID", note.BrewID);
            return(View(note));
        }