Esempio n. 1
0
        public ActionResult Create(Agent agent)
        {
            if (ModelState.IsValid)
            {
                db.Agent.Add(agent);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(agent);
        }
Esempio n. 2
0
 public ActionResult Edit(Agent agent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(agent).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(agent);
 }