public ActionResult DeleteConfirmed(int id) { Liaisons liaisons = db.Liaisons.Find(id); db.Liaisons.Remove(liaisons); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Liaisons/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Liaisons liaisons = db.Liaisons.Find(id); if (liaisons == null) { return(HttpNotFound()); } return(View(liaisons)); }
public ActionResult Edit([Bind(Include = "LiaisonID,LiaisonName,EmailAddress,IsActive,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] Liaisons liaisons) { if (ModelState.IsValid) { db.Entry(liaisons).State = EntityState.Modified; liaisons.IsActive = true; liaisons.ModifiedBy = 1; liaisons.ModifiedOn = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(liaisons)); }