コード例 #1
0
 public ActionResult Edit(int id, WalkerFormViewModel vm)
 {
     try
     {
         _walkerRepo.UpdateWalker(vm.Walker);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View(vm));
     }
 }
コード例 #2
0
 public ActionResult Edit(int id, Walker walker)
 {
     try
     {
         _walkerRepo.UpdateWalker(walker);
         return(RedirectToAction(nameof(Index)));
     }
     catch (Exception ex)
     {
         return(View(walker));
     }
 }
コード例 #3
0
 public ActionResult Edit(int id, Walker walker)
 {
     try
     {
         // Create Edit Walker method to finish this
         _walkerRepo.UpdateWalker(walker);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View(walker));
     }
 }
コード例 #4
0
        public ActionResult Edit(int id, WalkerEditViewModel viewModel)
        {
            try
            {
                _walkerRepo.UpdateWalker(viewModel.Walker);
                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                viewModel.ErrorMessage = "There was an error editing the walker profile.";
                //viewModel.Neighborhood = _neighborhoodRepo.GetAll();

                return(View(viewModel));
            }
        }
コード例 #5
0
ファイル: WalkerController.cs プロジェクト: dLars99/doggo
        public ActionResult Edit(int id, Walker walker)
        {
            try
            {
                _walkerRepo.UpdateWalker(walker);

                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                WalkerFormModel vm = new WalkerFormModel()
                {
                    Walker        = walker,
                    Neighborhoods = _neighborhoodRepo.GetAll()
                };
                return(View(vm));
            }
        }