public IHttpActionResult PutPatientEntity(int id, PatientEntity patientEntity) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != patientEntity.PatientID) { return(BadRequest()); } try { db.Change(patientEntity); } catch (DbUpdateConcurrencyException) { return(NotFound()); } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "PatientID,Name,LastName,Document,History,IpsID")] PatientEntity patientEntity) { if (ModelState.IsValid) { db.Change(patientEntity); return(RedirectToAction("Index")); } ViewBag.IpsID = new SelectList(of.ToList(), "IpsID", "Name", patientEntity.IpsID); return(View(patientEntity)); }