Пример #1
0
 public ActionResult Edit(Region region)
 {
     if (ModelState.IsValid)
     {
         db.Entry(region).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(region));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "MonsterId,Name,Atk,Def,Spd,Hp")] Monster monster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(monster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(monster));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "WeaponId,Name,Atk,Def,Spd")] Weapon weapon)
 {
     if (ModelState.IsValid)
     {
         db.Entry(weapon).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(weapon));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "RaceId,Name,AtkMod,DefMod,SpdMod")] Race race)
 {
     if (ModelState.IsValid)
     {
         db.Entry(race).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(race));
 }
Пример #5
0
 public ActionResult Edit(NPC NPC)
 {
     if (ModelState.IsValid)
     {
         db.Entry(NPC).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RegionId = new SelectList(db.Regions, "RegionID", "RegionName", NPC.RegionID);
     return(View(NPC));
 }
Пример #6
0
 public ActionResult Edit(Reward reward)
 {
     if (ModelState.IsValid)
     {
         db.Entry(reward).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RegionId = new SelectList(db.Regions, "RegionID", "RegionName", reward.RegionID);
     ViewBag.NPCId    = new SelectList(db.NPCs, "NPCID", "NPCName", reward.NPCID);
     return(View(reward));
 }
Пример #7
0
 public ActionResult Edit([Bind(Include = "PersonagemId,Name,Atk,Def,Spd,Hp,RaceID,ArmorID,WeaponID,EquipID")] Character character)
 {
     if (ModelState.IsValid)
     {
         db.Entry(character).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArmorID  = new SelectList(db.Armors, "ArmorId", "Name", character.ArmorID);
     ViewBag.EquipID  = new SelectList(db.Equips, "EquipId", "Name", character.EquipID);
     ViewBag.RaceID   = new SelectList(db.Races, "RaceId", "Name", character.RaceID);
     ViewBag.WeaponID = new SelectList(db.Weapons, "WeaponId", "Name", character.WeaponID);
     return(View(character));
 }
Пример #8
0
 public IActionResult Edit(Character character)
 {
     db.Entry(character).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public IActionResult Edit(Inventory inventory)
 {
     db.Entry(inventory).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }