public ActionResult DeleteConfirmed(int id) { Mahal mahal = db.Mahal.Find(id); db.Mahal.Remove(mahal); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MahalId,MahalAdi,ilId,BolgeId")] Mahal mahal) { if (ModelState.IsValid) { db.Entry(mahal).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BolgeId = new SelectList(db.Bolge, "BolgeId", "BolgeAdi", mahal.BolgeId); ViewBag.ilId = new SelectList(db.il, "ilId", "ilAdi", mahal.ilId); return(View(mahal)); }
// GET: Mahal/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mahal mahal = db.Mahal.Find(id); if (mahal == null) { return(HttpNotFound()); } return(View(mahal)); }
// GET: Mahal/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mahal mahal = db.Mahal.Find(id); if (mahal == null) { return(HttpNotFound()); } ViewBag.BolgeId = new SelectList(db.Bolge, "BolgeId", "BolgeAdi", mahal.BolgeId); ViewBag.ilId = new SelectList(db.il, "ilId", "ilAdi", mahal.ilId); return(View(mahal)); }