Ejemplo n.º 1
0
        public ActionResult DeletePlaneFromRepository(string PlaneName, string Name, string Nickname)
        {
            repository.DeletePlane(PlaneName);

            List <string> output = new List <string>();

            foreach (var samolot in repository.Samoloty)
            {
                output.Add(samolot.Nazwa);
            }
            SelectList Lista = new SelectList(output);

            PlaneListViewModel viewModel = new PlaneListViewModel()
            {
                Name           = Name,
                NickName       = Nickname,
                ListaSamolotów = Lista
            };

            TempData["deleteplanemessage"] = "Usunięto samolot o nazwie: " + PlaneName.Replace("_", " ") + " !";

            return(View("DeletePlane", viewModel));
        }
Ejemplo n.º 2
0
 public IActionResult PlaneDeleteConfirmed(int PlaneId)
 {
     planeRepository.DeletePlane(PlaneId);
     TempData["message"] = $"{PlaneId} Numaralı Kullanıcı Silindi.";
     return(RedirectToAction("PlaneList"));
 }