コード例 #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));
        }