Пример #1
0
        public IActionResult Edit_policja(string id)
        {
            var      pojazd = _pojazdService.Get(id);
            PojazdVM model  = new PojazdVM(pojazd);

            return(View(model));
        }
Пример #2
0
 public IActionResult Add(PojazdVM vm)
 {
     if (ModelState.IsValid)
     {
         _pojazdService.Create(vm.ToPojazd());
         return(RedirectToAction("Index"));
     }
     return(View(vm));
 }
Пример #3
0
 public IActionResult Edit_policja(PojazdVM vm)
 {
     if (ModelState.IsValid)
     {
         _pojazdService.Update(vm.Id, vm.ToPojazd());
         return(RedirectToAction("Index_policja"));
     }
     return(RedirectToAction("Edit_policja", vm));
 }
Пример #4
0
        public IActionResult Add()
        {
            PojazdVM model = new PojazdVM();

            return(View(model));
        }