public ActionResult DeleteConfirmed(int id) { Person_Expertise person_Expertise = db.Person_Expertise.Find(id); db.Person_Expertise.Remove(person_Expertise); db.SaveChanges(); id = person_Expertise.Person_id; return(RedirectToAction("Index", new { id })); }
// GET: Person_Expertise/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Person_Expertise person_Expertise = db.Person_Expertise.Find(id); if (person_Expertise == null) { return(HttpNotFound()); } return(View(person_Expertise)); }
public ActionResult Create([Bind(Include = "Person_id,Expertise_id,Grade")] Person_Expertise person_Expertise) { int id = person_Expertise.Person_id; if (ModelState.IsValid) { db.Person_Expertise.Add(person_Expertise); db.SaveChanges(); return(RedirectToAction("Index", new { id })); } ViewBag.Expertise_id = new SelectList(db.Expertises, "Expertise_id", "Expertise", person_Expertise.Expertise_id); ViewBag.Person_id = new SelectList(db.Persons, "Person_id", "FirstName", person_Expertise.Person_id); return(View(person_Expertise)); }