Example #1
0
        public AlmsgivingEntity GetAlms(int id)
        {
            var alm    = _almsgivingRepository.GetAlmsgivingById(id);
            var bearer = _bearerRepository.GetBearerById((int)alm.BearerId);
            var photo  = Convert.ToBase64String(File.ReadAllBytes(alm.Photo));
            var asd    = _mapper.AlmsToAlmEntity(alm, bearer, photo);

            return(asd);
        }
Example #2
0
        public BearerProfile GetBearerProfile(int bearerId)
        {
            var bearer      = _bearerRepository.GetBearerById(bearerId);
            var almsgivings = _almsgivingRepository.GetAllBearersAlmsgivings(bearerId);
            var alms        = _mapper.AlmsToAlmsEntities(almsgivings);

            return(new BearerProfile()
            {
                Nickname = bearer.Nickname,
                Phone = bearer.Phone,
                Almsgivings = alms
            });
        }