Esempio n. 1
0
        public void EditAchievement(AchievementViewModel achievement)
        {
            var query = db.Achievement.Where(x => x.id == achievement.id).First();

            query.name = achievement.name;
            db.SaveChanges();
        }
Esempio n. 2
0
 public ActionResult EditAchievement(AchievementViewModel achievement)
 {
     if (ModelState.IsValid)
     {
         achievementModel.EditAchievement(achievement);
     }
     return RedirectToAction("Index", "Achievement");
 }
Esempio n. 3
0
 public ActionResult CreateAchievement(AchievementViewModel achievement)
 {
     if (ModelState.IsValid)
     {
         achievementModel.AddAchievement(achievement);
         return RedirectToAction("Index", "Achievement");
     }
     return View(achievement);
 }
Esempio n. 4
0
        public void AddAchievement(AchievementViewModel achievement)
        {
            Achievement newAchievement = new Achievement()
            {
                name = achievement.name
            };

            db.Achievement.Add(newAchievement);
            db.SaveChanges();
        }