Exemplo n.º 1
0
 public ActionResult Edit(Transport transport)
 {
     if (ModelState.IsValid)
     {
         db.Entry(transport).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(transport);
 }
Exemplo n.º 2
0
        public ActionResult Create(Transport transport)
        {
            if (ModelState.IsValid)
            {
                db.Transports.Add(transport);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(transport);
        }