Exemple #1
0
        public ActionResult Create(PlayerType playertype)
        {
            if (ModelState.IsValid)
            {
                _repository.AddItem(playertype);
                return RedirectToAction("Index");
            }

            return View(playertype);
        }
Exemple #2
0
        public ActionResult Create(PlayerType playertype)
        {
            if (ModelState.IsValid)
            {
                db.PlayerTypes.Add(playertype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(playertype);
        }
Exemple #3
0
 public ActionResult Edit(PlayerType playertype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(playertype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(playertype);
 }