Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 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());
 }