public ActionResult Managament(WeaponsModels weaponsModels) { var db = new ApplicationDbContext(); var summary_delete = from wp in db.WeaponsModels where wp.Id == weaponsModels.Id select wp; db.WeaponsModels.RemoveRange(summary_delete); db.SaveChanges(); return(RedirectToAction("ActionSuccess")); }
public ActionResult ModifyForm(WeaponsModels weaponsModels) { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("NotLoggedIn")); } var user = User.Identity.GetUserName(); var db = new ApplicationDbContext(); var weaponData = (from weapons in db.WeaponsModels where weapons.Id == weaponsModels.Id select weapons).First(); weaponData.Rarity = weaponsModels.Rarity; weaponData.Name = weaponsModels.Name; weaponData.Description = weaponsModels.Description; weaponData.MinDamage = weaponsModels.MinDamage; weaponData.MaxDamage = weaponsModels.MaxDamage; weaponData.ImageUrl = weaponsModels.ImageUrl; db.SaveChanges(); return(RedirectToAction("ActionSuccess")); }
public ActionResult Modify(WeaponsModels weaponsModels) { long idToPass = weaponsModels.Id; return(RedirectToAction("ModifyForm", "Home", new { whatever = idToPass })); }