public async Task <IActionResult> Edit(int id, [Bind("ID,KorisnickoIme,Lozinka,ImeVlasnika,ImeMacke,Drzava,Pol,DobMacke,ZdravaMacka,Slika,Paket,Odabrana,OdabranaRanije,VjerovatnocaOdabira,Kompetentna")] Macka macka) { if (id != macka.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(macka); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MackaExists(macka.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(macka)); }
public async Task <IActionResult> Create([Bind("ID,KorisnickoIme,Lozinka,ImeVlasnika,ImeMacke,Drzava,Pol,DobMacke,ZdravaMacka,Slika,Paket,Odabrana,OdabranaRanije,VjerovatnocaOdabira,Kompetentna")] Macka macka) { if (ModelState.IsValid) { _context.Add(macka); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(macka)); }