예제 #1
0
        public ActionResult Create(Araba araba)
        {
            if (ModelState.IsValid)
            {
                db.Araba.Add(araba);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.firmaId = new SelectList(db.Firmalar, "firmaId", "firmaAdi", araba.firmaId);
            return PartialView(araba);
        }
예제 #2
0
 public ActionResult Edit(Araba araba)
 {
     if (ModelState.IsValid)
     {
         db.Entry(araba).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.firmaId = new SelectList(db.Firmalar, "firmaId", "firmaAdi", araba.firmaId);
     return PartialView(araba);
 }