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

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