public async Task <IActionResult> Edit(Guid id, [Bind("ID,Name,Type,Location,Available")] Resource resource) { if (id != resource.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(resource); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResourceExists(resource.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(resource)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,Active,ExpirationDate")] Subscription subscription) { if (id != subscription.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(subscription); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SubscriptionExists(subscription.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(subscription)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ID,Amount,ServiceType")] Invoice invoice) { if (id != invoice.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(invoice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvoiceExists(invoice.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(invoice)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id")] Attendee attendee) { if (id != attendee.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(attendee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AttendeeExists(attendee.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(attendee)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ID,Date,Amount")] Payment payment) { if (id != payment.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(payment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentExists(payment.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(payment)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ID")] Booking booking) { if (id != booking.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(booking); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingExists(booking.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(booking)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ID,Name,Description,StartDate,EndDate")] Event @event) { if (id != @event.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(@event); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventExists(@event.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(@event)); }