public IActionResult Delete(int eaventId) { Eavent deletedEavent = repository.DeleteEavent(eaventId); if (deletedEavent != null) { TempData["message"] = $"Usunięto {deletedEavent.Name}."; } return(RedirectToAction("Index")); }
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)); } }