public async Task <IActionResult> Edit(int id, [Bind("Reserva_MesaId,Numero,Data_Reserva,Hora_Reserva,Pessoas")] Reserva_Mesa reserva_Mesa) { if (id != reserva_Mesa.Reserva_MesaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reserva_Mesa); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Reserva_MesaExists(reserva_Mesa.Reserva_MesaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reserva_Mesa)); }
public async Task <IActionResult> Create([Bind("Reserva_MesaId,Numero,Data_Reserva,Hora_Reserva,Pessoas")] Reserva_Mesa reserva_Mesa) { if (ModelState.IsValid) { _context.Add(reserva_Mesa); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(reserva_Mesa)); }