public async Task <IActionResult> Edit(int id, [Bind("IdMasuk,NoPolisi,TanggalMasuk")] FormMasuk formMasuk) { if (id != formMasuk.IdMasuk) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(formMasuk); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormMasukExists(formMasuk.IdMasuk)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(formMasuk)); }
public async Task <IActionResult> Create([Bind("IdMasuk,NoPolisi,TanggalMasuk")] FormMasuk formMasuk) { if (ModelState.IsValid) { _context.Add(formMasuk); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(formMasuk)); }