public ActionResult DeleteConfirmed(int id) { ContactExam contactExam = db.ContactExams.Find(id); db.ContactExams.Remove(contactExam); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,ContactName,ContactNumber,GroupName,Hiredate,Birthday")] ContactExam contactExam) { if (ModelState.IsValid) { db.Entry(contactExam).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contactExam)); }
public ActionResult Create([Bind(Include = "ID,ContactName,ContactNumber,GroupName,Hiredate,Birthday")] ContactExam contactExam) { if (ModelState.IsValid) { db.ContactExams.Add(contactExam); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contactExam)); }
// GET: ContactExams/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ContactExam contactExam = db.ContactExams.Find(id); if (contactExam == null) { return(HttpNotFound()); } return(View(contactExam)); }