public IHttpActionResult PutClient(int id, Client client) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != client.ClientId) { return(BadRequest()); } db.Entry(client).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutTourEventView(string id, TourEventView tourEventView) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tourEventView.EventMonth) { return(BadRequest()); } db.Entry(tourEventView).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TourEventViewExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutBooking(int id, Booking booking) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != booking.BookingId) { return(BadRequest()); } db.Entry(booking).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BookingExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName,StripeCustomerId,StripeCardId,CreditCardLastFour,CreditCardCompany,CreditCardExpires")] AspNetUser aspNetUser) { if (ModelState.IsValid) { db.Entry(aspNetUser).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aspNetUser)); }