public ActionResult DeleteConfirmed(int id) { CandidateStudent candidateStudent = db.CandidateStudents.Find(id); db.CandidateStudents.Remove(candidateStudent); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,Major,Description,DateofBirth,PlaceofBirth,Address,PhoneNumber,YearsAttend")] CandidateStudent candidateStudent) { if (ModelState.IsValid) { db.Entry(candidateStudent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidateStudent)); }
// GET: CandidateStudents/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateStudent candidateStudent = db.CandidateStudents.Find(id); if (candidateStudent == null) { return(HttpNotFound()); } return(View(candidateStudent)); }