示例#1
0
 public IActionResult ManageAlien(string id)
 {
     model         = new AlienModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword"));
     ViewBag.Alien = model.GetRegdAlien(id);
     if (ViewBag.Alien.Rows.Count > 0)
     {
         ViewBag.Type = "regd";
     }
     else
     {
         ViewBag.Alien = model.GetUnregdAlien(id);
         if (ViewBag.Alien.Rows.Count > 0)
         {
             ViewBag.Type = "unregd";
         }
         else
         {
             ViewBag.Type = null;
         }
     }
     ViewBag.DangerDegrees = model.GetDangerDegrees();
     ViewBag.Races         = model.GetRaces();
     ViewBag.Planets       = model.GetPlanets();
     ViewBag.Race          = model.GetRace(ViewBag.Alien.Rows[0]["race"].ToString());
     return(View());
 }