Exemplo n.º 1
0
        // 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));
        }
Exemplo n.º 2
0
 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)));
 }
Exemplo n.º 3
0
        // 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));
            }
        }