Beispiel #1
0
        public IEnumerable <VolunteerDTO> GetVolunteers()
        {
            try
            {
                log.Debug("GetVolunteers");

                // get
                IEnumerable <R_Volunteer> results = Repository.GetVolunteers();

                IEnumerable <VolunteerDTO> resultsDTO = results.Select(e => new VolunteerDTO(e));

                log.Debug("result: 'success', count: " + (resultsDTO != null ? resultsDTO.Count().ToString() : "null"));

                return(resultsDTO);
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }
        public ActionResult VolunteerIndex()
        {
            var pageParam = new PaginationParam
            {
                PageIndex   = 1,
                Limit       = 20,
                SortColoumn = "CreatedAt"
            };

            if (TempData.ContainsKey("Alert"))
            {
                ViewBag.Alert = TempData["Alert"].ToString();
            }
            if (TempData.ContainsKey("Error"))
            {
                ViewBag.Error = TempData["Error"].ToString();
            }
            var volunteers = volRepo.GetVolunteers();

            return(View(volunteers));
        }
Beispiel #3
0
        public List <ApplicationUser> GetVolunteersInRangeForBeneficiary(ApplicationUser beneficiary, int radiusInKm)
        {
            IQueryable <ApplicationUser> volunteers = _volunteerRepository.GetVolunteers();

            return(_volunteerMatchingService.GetVolunteersInRange(volunteers, beneficiary, radiusInKm).ToList());
        }