// GET: Aktualnosci/Create public ViewResult Create() { var newPerson = new GronoPedagogiczne { Zdjecie = "**POMIJAMY**", Imie = "Tu wpisz imię", Nazwisko = "Tu wpisz nazwisko", Funkcje = "Tu wpisz funkcje" }; return(View("Edit", newPerson)); }
public ActionResult Edit(GronoPedagogiczne editedPerson) { if (ModelState.IsValid) { if (editedPerson == null) { return(RedirectToAction(nameof(Index))); } repository.SaveGrono(editedPerson); } else { return(View(editedPerson)); } return(RedirectToAction(nameof(Index))); }
// GET: Aktualnosci/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(NotFound()); } GronoPedagogiczne editedPerson = repository.GronoPedagogicznes .FirstOrDefault(g => g.ID == id); if (editedPerson == null) { return(NotFound()); } else { return(View(editedPerson)); } }