public async Task <IActionResult> Edit(int id, [Bind("IdApoteker,Username,Password")] Apoteker apoteker) { if (id != apoteker.IdApoteker) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(apoteker); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApotekerExists(apoteker.IdApoteker)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(apoteker)); }
public async Task <IActionResult> Create([Bind("IdApoteker,Username,Password")] Apoteker apoteker) { if (ModelState.IsValid) { _context.Add(apoteker); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(apoteker)); }