public async Task <IActionResult> Edit(int id, [Bind("Id,Marka,Model,Rejestracja,Vin,KlientId")] Samochod samochod) { if (id != samochod.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(samochod); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SamochodExists(samochod.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["KlientId"] = new SelectList(_context.Klients, "Id", "Id", samochod.KlientId); return(View(samochod)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,OpisUsterki,Aktywne,IdSamochodu,IdMechanika")] Zlecenie zlecenie) { if (id != zlecenie.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(zlecenie); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZlecenieExists(zlecenie.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(zlecenie)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Imie,Nazwisko")] Mechanik mechanik) { if (id != mechanik.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mechanik); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MechanikExists(mechanik.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mechanik)); }