Example #1
0
 public IActionResult Create(VerbindingDetailViewModel vm)
 {
     if (ModelState.IsValid)
     {
         VerbindingViewModelConverter verbindingViewModelConverter = new VerbindingViewModelConverter();
         Verbinding p  = verbindingViewModelConverter.ViewModelToVerbinding(vm);
         decimal    id = repo.CreateVerbinding(p);
         return(RedirectToAction("Details", new { id }));
     }
     return(View());
 }
Example #2
0
 public IActionResult Edit(VerbindingDetailViewModel vm)
 {
     try
     {
         Verbinding verbinding = converter.ViewModelToVerbinding(vm);
         repo.UpdateVerbinding(verbinding);
         return(RedirectToAction("Details", new { verbinding.Id }));
     }
     catch
     {
         return(View());
     }
 }