Ejemplo n.º 1
0
        public ActionResult Create(Character character)
        {
            try
            {
                // TODO: Add insert logic here

                db.Characters.Add(character);
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Ejemplo n.º 2
0
        public ActionResult CharacterSeed()
        {
            Character character = new Character();

            character.PlayerName = "Nicholas";
            character.CharacterName = "Samuel";
            character.Age = 32;
            character.Sex = "Male";
            character.Race = "Cyborg";
            character.Eyes = "Green";
            character.Hair = "Brown";
            character.Height = 6;
            character.Weight = 199;
            character.Description = "Crazy Healer Dude";
            character.Strength = 4;
            character.Perception = 7;
            character.Endurance = 7;
            character.Charisma = 3;
            character.Intelligence = 8;
            character.Agility = 7;
            character.Luck = 4;
            character.Experience = 1087;
            character.CurrentActionPoints = 0;
            character.CurrentHitPoints = 0;

            character.Traits = new List<Trait>();
            character.Skills = new List<Skill>();
            character.Perks = new List<Perk>();
            character.Gear = new List<Equipment>();

            db.Characters.Add(character);
            db.SaveChanges();

            return RedirectToAction("Index");
        }