public ActionResult DeleteConfirmed(int id) { PersonInCharge personincharge = db.PersonInCharge.Find(id); db.PersonInCharge.Remove(personincharge); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /PersonalInChearge/Delete/5 public ActionResult Delete(int id = 0) { PersonInCharge personincharge = db.PersonInCharge.Find(id); if (personincharge == null) { return(HttpNotFound()); } return(View(personincharge)); }
public ActionResult Edit(PersonInCharge personincharge) { if (ModelState.IsValid) { db.Entry(personincharge).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(personincharge)); }
public ActionResult Create(PersonInCharge personincharge) { if (ModelState.IsValid) { db.PersonInCharge.Add(personincharge); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(personincharge)); }