public void EditWorkCategory(string name, int id) { WORKS_CATEGORY slctd_wk = db.WORKS_CATEGORY.Find(id); slctd_wk.NAME = name; db.SaveChanges(); }
public ActionResult DeleteConfirmed(int id) { WORKS_CATEGORY wORKS_CATEGORY = db.WORKS_CATEGORY.Find(id); db.WORKS_CATEGORY.Remove(wORKS_CATEGORY); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OBJECTID,NAME")] WORKS_CATEGORY wORKS_CATEGORY) { if (ModelState.IsValid) { db.Entry(wORKS_CATEGORY).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wORKS_CATEGORY)); }
public void AddWorkCategory(string name) { WORKS_CATEGORY new_wk = new WORKS_CATEGORY { NAME = name }; db.WORKS_CATEGORY.Add(new_wk); db.SaveChanges(); }
public ActionResult Create([Bind(Include = "OBJECTID,NAME")] WORKS_CATEGORY wORKS_CATEGORY) { if (ModelState.IsValid) { db.WORKS_CATEGORY.Add(wORKS_CATEGORY); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wORKS_CATEGORY)); }
// GET: AgroPark/WORKS_CATEGORY/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WORKS_CATEGORY wORKS_CATEGORY = db.WORKS_CATEGORY.Find(id); if (wORKS_CATEGORY == null) { return(HttpNotFound()); } return(View(wORKS_CATEGORY)); }