示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Mahal mahal = db.Mahal.Find(id);

            db.Mahal.Remove(mahal);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 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));
 }
示例#3
0
        // 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));
        }
示例#4
0
        // 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));
        }