public ActionResult Edit([Bind(Include = "OccupationGroupId,OccupationGroupTitle")] EntityOccupationGroup entityOccupationGroup) { if (ModelState.IsValid) { db.Entry(entityOccupationGroup).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(entityOccupationGroup)); }
public ActionResult Create([Bind(Include = "OccupationGroupId,OccupationGroupTitle")] EntityOccupationGroup entityOccupationGroup) { if (ModelState.IsValid) { db.EntityOccupationGroups.Add(entityOccupationGroup); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(entityOccupationGroup)); }
// GET: EntityOccupationGroup/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EntityOccupationGroup entityOccupationGroup = db.EntityOccupationGroups.Find(id); if (entityOccupationGroup == null) { return(HttpNotFound()); } return(View(entityOccupationGroup)); }
public ActionResult DeleteConfirmed(int id) { EntityOccupationGroup entityOccupationGroup = db.EntityOccupationGroups.Find(id); try { db.EntityOccupationGroups.Remove(entityOccupationGroup); db.SaveChanges(); return(RedirectToAction("Index")); } catch (SqlException) { throw new Exception("error"); } }