public ActionResult DeleteConfirmed(int id) { Schoole schoole = db.Schooles.Find(id); db.Schooles.Remove(schoole); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] Schoole schoole) { if (ModelState.IsValid) { db.Entry(schoole).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(schoole)); }
public ActionResult Create([Bind(Include = "Id,Name")] Schoole schoole) { if (ModelState.IsValid) { db.Schooles.Add(schoole); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(schoole)); }
// GET: StudentArea/Schooles/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Schoole schoole = db.Schooles.Find(id); if (schoole == null) { return(HttpNotFound()); } return(View(schoole)); }