public async Task <IActionResult> Edit(int id, [Bind("ID,datum,prijavak,PopisSuvlsnikaId")] Prijavci prijavci) { if (id != prijavci.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prijavci); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrijavciExists(prijavci.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(prijavci)); }
public async Task <IActionResult> Create([Bind("ID,datum,prijavak,PopisSuvlsnikaId")] Prijavci prijavci) { if (ModelState.IsValid) { _context.Add(prijavci); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(prijavci)); }