public ActionResult DeleteConfirmed(int id) { WORK wORK = db.WORKS.Find(id); db.WORKS.Remove(wORK); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OBJECTID,NAME,WORK_CAT_ID")] WORK wORK) { if (ModelState.IsValid) { db.Entry(wORK).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.WORK_CAT_ID = new SelectList(db.WORKS_CATEGORY, "OBJECTID", "NAME", wORK.WORK_CAT_ID); return(View(wORK)); }
// POST: odata/WORK public IHttpActionResult Post(WORK WORK) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.WORK.Add(WORK); db.SaveChanges(); return(Created(WORK)); }
// GET: AgroPark/WORKs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WORK wORK = db.WORKS.Find(id); if (wORK == null) { return(HttpNotFound()); } return(View(wORK)); }
// DELETE: odata/WORK(5) public IHttpActionResult Delete([FromODataUri] string key) { WORK WORK = db.WORK.Find(key); if (WORK == null) { return(NotFound()); } db.WORK.Remove(WORK); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
// GET: AgroPark/WORKs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WORK wORK = db.WORKS.Find(id); if (wORK == null) { return(HttpNotFound()); } ViewBag.WORK_CAT_ID = new SelectList(db.WORKS_CATEGORY, "OBJECTID", "NAME", wORK.WORK_CAT_ID); return(View(wORK)); }
public IHttpActionResult Patch([FromODataUri] string key, Delta <WORK> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } WORK WORK = db.WORK.Find(key); if (WORK == null) { return(NotFound()); } patch.Patch(WORK); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!WORKExists(key)) { return(NotFound()); } else { throw; } } return(Updated(WORK)); }
public void setWork(int _index, WORK _work) { work[_index] = _work; }