public ActionResult DeleteAlien(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }

            alienModel.DeleteAlien(id);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public IActionResult AlienAction(string alienkey, string name, string danger, string race, string planet, string type, string activity, string command, string newregdssn)
 {
     model = new AlienModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword"));
     if (activity == "Update")
     {
         model.UpdateAlien(alienkey, name, danger, race, planet, type);
     }
     else if (activity == "Delete")
     {
         string message = model.DeleteAlien(alienkey, command);
         if (message == "success")
         {
             return(RedirectToAction("Index"));
         }
     }
     else if (activity == "Register")
     {
         model.RegisterAlien(alienkey, newregdssn);
     }
     return(RedirectToAction("ManageAlien", new { @id = alienkey }));
 }