示例#1
0
 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());
 }