public void UpdateCharacterStats(Business.Model.Character character)
        {
            Character currentEntity = _context.Characters.Find(character.Id);

            var newEntity = new Character
            {
                Id            = character.Id,
                CharacterName = character.CharacterName,
                Exp           = character.Exp,
                Health        = character.Health,
                Attack        = character.Attack,
                Defense       = character.Defense,
                Mana          = character.Mana
            };

            _context.Entry(currentEntity).CurrentValues.SetValues(newEntity);
        }
 public ActionResult Edit([Bind(Include = "MissionID,MissionName,MissionPresident,MissionAddress,MissionLanguage,MissionClimate,DominantReligion,FlagSource")] Missions missions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(missions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(missions));
 }
 public ActionResult Edit([Bind(Include = "UserID,UserEmail,UserPassword,UserFirstName,UserLastName")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(users));
 }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "MissionQuestionID,MissionID,UserID,Question,Answer")] MissionQuestions missionQuestions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(missionQuestions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(missionQuestions));
 }
 public ActionResult Edit([Bind(Include = "missionquestionID,question,answer,missionID")] MissionQuestions missionQuestions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(missionQuestions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.missionID = new SelectList(db.Missions, "missionID", "missionName", missionQuestions.missionID);
     return(View(missionQuestions));
 }