public IActionResult ManageShip(string id) { model = new ShipModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword")); ViewBag.Ship = model.GetShip(id); 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 ShipModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword")); ViewBag.Ships = model.GetShips(); ViewBag.Planets = model.GetPlanets(); return(View()); }