示例#1
0
        public ActionResult CreateWeapon(Weapon weapon)
        {
            if (!ModelState.IsValid)
            {
                return(View("Create"));
            }

            weaponRepository = new WeaponRepository();
            weaponRepository.Create(weapon);
            return(RedirectToAction("Weapons"));
        }
示例#2
0
        public ActionResult Create(WeaponViewModel ReturnedWeapon)
        {
            Weapon CreatedWeapon = new Weapon()
            {
                ID       = ReturnedWeapon.ID,
                Name     = ReturnedWeapon.Name,
                Damage   = ReturnedWeapon.Damage,
                Magazine = ReturnedWeapon.Magazine,
                Critical = ReturnedWeapon.Critical,
                Status   = ReturnedWeapon.Status
            };

            weapon.Create(CreatedWeapon);
            return(RedirectToAction("Weapons"));
        }