public ActionResult DeleteConfirmed(int id) { PointsFrame pointsFrame = db.PointsFrames.Find(id); db.PointsFrames.Remove(pointsFrame); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id")] PointsFrame pointsFrame) { if (ModelState.IsValid) { db.PointsFrames.Add(pointsFrame); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pointsFrame)); }
public ActionResult Edit([Bind(Include = "Id")] PointsFrame pointsFrame) { if (ModelState.IsValid) { db.Entry(pointsFrame).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pointsFrame)); }
// POST: odata/PointsFrames public IHttpActionResult Post(PointsFrame pointsFrame) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PointsFrames.Add(pointsFrame); db.SaveChanges(); return(Created(pointsFrame)); }
// DELETE: odata/PointsFrames(5) public IHttpActionResult Delete([FromODataUri] int key) { PointsFrame pointsFrame = db.PointsFrames.Find(key); if (pointsFrame == null) { return(NotFound()); } db.PointsFrames.Remove(pointsFrame); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
// GET: PointsFrames/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PointsFrame pointsFrame = db.PointsFrames.Find(id); if (pointsFrame == null) { return(HttpNotFound()); } return(View(pointsFrame)); }
public IHttpActionResult Patch([FromODataUri] int key, Delta <PointsFrame> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } PointsFrame pointsFrame = db.PointsFrames.Find(key); if (pointsFrame == null) { return(NotFound()); } patch.Patch(pointsFrame); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PointsFrameExists(key)) { return(NotFound()); } else { throw; } } return(Updated(pointsFrame)); }