public IHttpActionResult PutEvidenceStored(int id, EvidenceStored evidenceStored) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != evidenceStored.EvidenceStoredId) { return(BadRequest()); } db.Entry(evidenceStored).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EvidenceStoredExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { EvidenceStored evidenceStored = db.EvidenceStored.Find(id); db.EvidenceStored.Remove(evidenceStored); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,value")] EvidenceStored evidenceStored) { if (ModelState.IsValid) { db.Entry(evidenceStored).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(evidenceStored)); }
public ActionResult Create([Bind(Include = "id,value")] EvidenceStored evidenceStored) { if (ModelState.IsValid) { db.EvidenceStored.Add(evidenceStored); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(evidenceStored)); }
public IHttpActionResult GetEvidenceStored(int id) { EvidenceStored evidenceStored = db.EvidenceStoreds.Find(id); if (evidenceStored == null) { return(NotFound()); } return(Ok(evidenceStored)); }
public IHttpActionResult PostEvidenceStored(EvidenceStored evidenceStored) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.EvidenceStoreds.Add(evidenceStored); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = evidenceStored.EvidenceStoredId }, evidenceStored)); }
// GET: EvidenceStoreds/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EvidenceStored evidenceStored = db.EvidenceStored.Find(id); if (evidenceStored == null) { return(HttpNotFound()); } return(View(evidenceStored)); }
public IHttpActionResult DeleteEvidenceStored(int id) { EvidenceStored evidenceStored = db.EvidenceStoreds.Find(id); if (evidenceStored == null) { return(NotFound()); } db.EvidenceStoreds.Remove(evidenceStored); db.SaveChanges(); return(Ok(evidenceStored)); }