예제 #1
0
        public IActionResult Delete(int eaventId)
        {
            Eavent deletedEavent = repository.DeleteEavent(eaventId);

            if (deletedEavent != null)
            {
                TempData["message"] = $"Usunięto {deletedEavent.Name}.";
            }
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public IActionResult Edit(Eavent eavent)
 {
     if (ModelState.IsValid)
     {
         repository.SaveEavent(eavent);
         TempData["message"] = $"Zapisano {eavent.Name}.";
         return(RedirectToAction("Index"));
     }
     else
     {
         // Błąd w wartościach danych.
         return(View(eavent));
     }
 }