public IActionResult ManageWeapon(string id) { model = new WeaponModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword")); ViewBag.Weapon = model.GetWeapon(id); ViewBag.Dangers = model.GetDangers(); ViewBag.Planets = model.GetPlanets(); return(View()); }
public IActionResult Index() { if (HttpContext.Session.GetString("dbusername") == null || HttpContext.Session.GetString("dbusername") == "guest") { return(RedirectToAction("Index", "Home")); } model = new WeaponModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword")); ViewBag.Weapons = model.GetWeapons(); ViewBag.Dangers = model.GetDangers(); ViewBag.Planets = model.GetPlanets(); ViewBag.Ships = model.GetShips(); ViewBag.Aliens = model.GetAliens(); return(View()); }