Exemplo n.º 1
0
        public ActionResult Create(Offence offence)
        {
            if (ModelState.IsValid)
            {
                Db.Offences.Add(offence);
                Db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(offence);
        }
Exemplo n.º 2
0
 public ActionResult Edit(Offence offence)
 {
     if (ModelState.IsValid)
     {
         Db.Entry(offence).State = EntityState.Modified;
         Db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(offence);
 }