public async Task <IActionResult> Edit(string id, [Bind("Id,Name,AccessNumber")] TypeReservation typeReservation) { if (id != typeReservation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(typeReservation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeReservationExists(typeReservation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(typeReservation)); }
public async Task <IActionResult> Edit(int id, [Bind("id_type,Nom,NombreApp")] TypeReservation typeReservation) { if (id != typeReservation.id_type) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(typeReservation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeReservationExists(typeReservation.id_type)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(typeReservation)); }
public async Task <IActionResult> Create([Bind("Id,Name,AccessNumber")] TypeReservation typeReservation) { if (ModelState.IsValid) { _context.Add(typeReservation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typeReservation)); }
public async Task <ActionResult> Edit(int id, TypeReservation typeReservation) { try { _context.Update(typeReservation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public async Task <ActionResult> Create(TypeReservation typeReservations) { try { _context.TypeReservations.Add(typeReservations); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
// GET: TypeReservationController/Delete/5 public ActionResult Delete(int id, TypeReservation typeReservation) { var deletera = _context.TypeReservations.Find(id); return(View(deletera)); }