Beispiel #1
0
 public IActionResult Edit(Volunteer volunteer)
 {
     if (ModelState.IsValid)
     {
         repository.SaveVolunteer(volunteer);
         TempData["message"] = $"{volunteer.LastName}, {volunteer.FirstName} has been saved";
         return(RedirectToAction("Index"));
     }
     else
     {                 // there is something wrong with the data values
         return(View(volunteer));
     }
 }
Beispiel #2
0
 public IActionResult SaveVolunteer(Volunteer volunteer)
 {
     _volunteerRepository.SaveVolunteer(volunteer);
     return(RedirectToAction("VolunteerList"));
 }