public IHttpActionResult Putinfo(string id, info info) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != info.User_Name) { return(BadRequest()); } db.Entry(info).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!infoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPersonal(int id, Personal personal) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != personal.Emp_No) { return(BadRequest()); } db.Entry(personal).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PersonalExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }