public async Task <IActionResult> Edit(int id, [Bind("Id, DayOfTheWeek, TypeOfDrink, DrinkPrice, HappyHourStartTime, HappyHourEndTime, ApplicationId")] DrinkSpecial drinkSpecial) { if (id != drinkSpecial.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(drinkSpecial); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DrinkSpecialExists(drinkSpecial.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(drinkSpecial)); }
public async Task <IActionResult> Create([Bind("Id ,DayOfTheWeek, TypeOfDrink, DrinkPrice, HappyHourStartTime, HappyHourEndTime, ApplicationId")] DrinkSpecial drinkSpecial) { if (ModelState.IsValid) { _context.Add(drinkSpecial); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(drinkSpecial)); }