public async Task <IHttpActionResult> PutClient(int id, Client client) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != client.Id) { return(BadRequest()); } db.Entry(client).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IActionResult> PutAirport([FromRoute] int id, [FromBody] Airport airport) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != airport.Id) { return(BadRequest()); } _context.Entry(airport).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AirportExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,LName,FName,EmployedDate")] Staff staff) { if (ModelState.IsValid) { db.Entry(staff).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(staff)); }
public ActionResult Edit([Bind(Include = "Id,Code,DestPlace,FlightDate")] Flight flight) { if (ModelState.IsValid) { db.Entry(flight).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(flight)); }
public ActionResult Edit([Bind(Include = "Id,LName,FName,EnrolmentDate")] Client client) { if (ModelState.IsValid) { db.Entry(client).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(client)); }
public ActionResult Edit([Bind(Include = "Id,Name,Origin")] Airline airline) { if (ModelState.IsValid) { db.Entry(airline).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(airline)); }
public async Task <IActionResult> resetPassword(int id, User user) { var editPassword = await _context.Users.SingleOrDefaultAsync(r => r.ID == user.ID); if (editPassword != null) { if (ModelState.IsValid) { string password = Crypto.HashPassword(user.Password); editPassword.Password = password; _context.Entry(editPassword).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); } } return(View()); }
public void Change(Airlines airlineNew) { context.Entry(airlineNew).State = EntityState.Modified; }
public void Change(Pilot pilotNew) { context.Entry(pilotNew).State = EntityState.Modified; }
public void change(Country c) { context.Entry(c).State = EntityState.Modified; }
public void Change(Flight flightNew) { context.Entry(flightNew).State = EntityState.Modified; }