public IActionResult Edit_policja(string id) { var pojazd = _pojazdService.Get(id); PojazdVM model = new PojazdVM(pojazd); return(View(model)); }
public IActionResult Add(PojazdVM vm) { if (ModelState.IsValid) { _pojazdService.Create(vm.ToPojazd()); return(RedirectToAction("Index")); } return(View(vm)); }
public IActionResult Edit_policja(PojazdVM vm) { if (ModelState.IsValid) { _pojazdService.Update(vm.Id, vm.ToPojazd()); return(RedirectToAction("Index_policja")); } return(RedirectToAction("Edit_policja", vm)); }
public IActionResult Add() { PojazdVM model = new PojazdVM(); return(View(model)); }