public ActionResult DeleteConfirmed(int id) { StudentAdress studentAdress = db.StudentAdresses.Find(id); db.StudentAdresses.Remove(studentAdress); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "StudentAdressID,StudentID,PK,Adress,County,City,Telephone")] StudentAdress studentAdress) { if (ModelState.IsValid) { db.Entry(studentAdress).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentID = new SelectList(db.Students, "StudentID", "FullName", studentAdress.StudentID); return(View(studentAdress)); }
// GET: StudentAdresses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentAdress studentAdress = db.StudentAdresses.Find(id); if (studentAdress == null) { return(HttpNotFound()); } return(View(studentAdress)); }
// GET: StudentAdresses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentAdress studentAdress = db.StudentAdresses.Find(id); if (studentAdress == null) { return(HttpNotFound()); } ViewBag.StudentID = new SelectList(db.Students, "StudentID", "FullName", studentAdress.StudentID); return(View(studentAdress)); }