Ejemplo n.º 1
0
        public IEnumerable <VolunteerDTO> GetVolunteerListAdvancedSearch(
            string name
            , int?gender
            , System.DateTime?birthDateFrom
            , System.DateTime?birthDateTo
            , string occupation
            , string employer
            , string phone
            , string email
            , string identityCardNumber
            , int?countryId
            , string friendOrFamilyContact
            , int?photo
            , int?addressId
            , bool?hasCar
            , bool?hasDriverLicense
            , bool?hasBike
            , string vehicleMake
            , string vehicleModel
            , bool?active
            )
        {
            try
            {
                log.Debug("GetVolunteerListAdvancedSearch");

                IEnumerable <R_Volunteer> results = Repository.GetVolunteerListAdvancedSearch(
                    name
                    , gender
                    , birthDateFrom
                    , birthDateTo
                    , occupation
                    , employer
                    , phone
                    , email
                    , identityCardNumber
                    , countryId
                    , friendOrFamilyContact
                    , photo
                    , addressId
                    , hasCar
                    , hasDriverLicense
                    , hasBike
                    , vehicleMake
                    , vehicleModel
                    , active
                    );

                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;
            }
        }