Пример #1
0
        public ActionResult Create(ODAKAPASITE odakapasite)
        {
            if (ModelState.IsValid)
            {
                db.ODAKAPASITE.Add(odakapasite);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.ODATIPID = new SelectList(db.ODATIPI, "ID", "ADI", odakapasite.ODATIPID);
            return View(odakapasite);
        }
Пример #2
0
 public ActionResult Edit(ODAKAPASITE odakapasite)
 {
     if (ModelState.IsValid)
     {
         db.Entry(odakapasite).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ODATIPID = new SelectList(db.ODATIPI, "ID", "ADI", odakapasite.ODATIPID);
     return View(odakapasite);
 }