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> Edit(int id, [Bind("IdKendaraan,JenisKendaraan1")] JenisKendaraan jenisKendaraan) { if (id != jenisKendaraan.IdKendaraan) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jenisKendaraan); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JenisKendaraanExists(jenisKendaraan.IdKendaraan)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(jenisKendaraan)); }
public async Task <IActionResult> Edit(int id, [Bind("IdTarif,TarifHarga")] Tarif tarif) { if (id != tarif.IdTarif) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tarif); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TarifExists(tarif.IdTarif)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tarif)); }
public async Task <IActionResult> Edit(int id, [Bind("IdKeluar,TanggalKeluar,IdMasuk,IdKendaraan,IdTarif")] FormKeluar formKeluar) { if (id != formKeluar.IdKeluar) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(formKeluar); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormKeluarExists(formKeluar.IdKeluar)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdKendaraan"] = new SelectList(_context.JenisKendaraan, "IdKendaraan", "IdKendaraan", formKeluar.IdKendaraan); ViewData["IdMasuk"] = new SelectList(_context.FormMasuk, "IdMasuk", "IdMasuk", formKeluar.IdMasuk); ViewData["IdTarif"] = new SelectList(_context.Tarif, "IdTarif", "IdTarif", formKeluar.IdTarif); return(View(formKeluar)); }