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

            return View(programa);
        }
Пример #2
0
 public ActionResult Edit(Programa programa)
 {
     if (ModelState.IsValid)
     {
         db.Entry(programa).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(programa);
 }