Esempio n. 1
0
        public ActionResult Create(Game gm)
        {
            if (ModelState.IsValid)
            {
                gm.IntroduceDate = DateTime.Now;
                db.Games.Add(gm);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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