예제 #1
0
        public ActionResult List()
        {
            var repository = new VolunteerRepository();
            var volunteers = repository.GetAllVolunteers().ToList();

            return View(volunteers);
        }
 public ActionResult Details(string Volunteerid)
 {
     if (string.IsNullOrEmpty(Volunteerid))
     {
         return (View("Review"));
     }
     int VolID = Convert.ToInt32(Volunteerid);
     Models.VolunteerRepository repo = new VolunteerRepository();
     return View("Details", repo.GetVolunteer(VolID));
 }
예제 #3
0
        public ActionResult SignUp(Volunteer volunteer, FormCollection form)
        {
            var jobRoles = SelectedJobRoles(form);
            var technologies = SelectedTechnologies(form);

            Validate(volunteer, jobRoles, technologies);

            if (ModelState.IsValid)
            {
                var volunteerRepository = new VolunteerRepository();

                volunteerRepository.Register(volunteer, jobRoles, technologies);
                volunteerRepository.Save();
                return View("Confirm");
            }

            return View(new SignUpViewModel(volunteer));
        }
 public ActionResult Review()
 {
     Models.VolunteerRepository repo = new VolunteerRepository();
     return View(repo.GetAllVolunteers());
 }