public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Equipement).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EquipementExists(Equipement.EquipementId)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Utilisateurs.Add(Utilisateur); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Utilisateur = await _context.Utilisateurs.FindAsync(id); if (Utilisateur != null) { _context.Utilisateurs.Remove(Utilisateur); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Equipement = await _context.Equipement.FindAsync(id); if (Equipement != null) { _context.Equipement.Remove(Equipement); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Reservation = await _context.Reservations.FindAsync(id); if (Reservation != null) { _context.Reservations.Remove(Reservation); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }