public async Task <IActionResult> Edit(int id, [Bind("KomentarID,VrijemeObjave,Tekst")] Komentar komentar) { if (id != komentar.KomentarID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(komentar); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KomentarExists(komentar.KomentarID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(komentar)); }
public async Task <IActionResult> Edit(int id, [Bind("ZahtjevZaUdomljavanjeID,Grad,Adresa,ImaPsa")] ZahtjevZaUdomljavanje zahtjevZaUdomljavanje) { if (id != zahtjevZaUdomljavanje.ZahtjevZaUdomljavanjeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(zahtjevZaUdomljavanje); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZahtjevZaUdomljavanjeExists(zahtjevZaUdomljavanje.ZahtjevZaUdomljavanjeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(zahtjevZaUdomljavanje)); }
public async Task <IActionResult> Edit(int id, [Bind("PodsjetnikID,Tekst,Termin")] Podsjetnik podsjetnik) { if (id != podsjetnik.PodsjetnikID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(podsjetnik); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PodsjetnikExists(podsjetnik.PodsjetnikID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(podsjetnik)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Ime,Prezime,Email,Username,Password")] Korisnik korisnik) { if (id != korisnik.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(korisnik); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KorisnikExists(korisnik.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(korisnik)); }
public async Task <IActionResult> Edit(int id, [Bind("PostID,Tekst,BrojKomentara,BrojReakcija")] Post post) { if (id != post.PostID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(post); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostExists(post.PostID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(post)); }
public async Task <IActionResult> Edit(int id, [Bind("DokumentID,Datoteka")] Dokument dokument) { if (id != dokument.DokumentID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dokument); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DokumentExists(dokument.DokumentID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dokument)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Ime,Spol,Rasa,Tezina,ZdravstveniProblem,KastriranSterilisan,Slika")] Pas pas) { if (id != pas.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PasExists(pas.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pas)); }
public async Task <IActionResult> Edit(int id, [Bind("ProfilID")] Profil profil) { if (id != profil.ProfilID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(profil); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfilExists(profil.ProfilID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(profil)); }
public async Task <IActionResult> Edit(int id, [Bind("ForumID,BrojAktivnihKorisnika")] Forum forum) { if (id != forum.ForumID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(forum); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ForumExists(forum.ForumID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(forum)); }