예제 #1
0
        public VirtualCardDTO GetVirtualCardByCardNumber(string username, string cardnumber)
        {
            var account = accountService.GetAccountForUser(username);

            if (account == null)
            {
                return(null);
            }
            var vc = virtualCardRepository.GetByAccountIdAndCardNumber(account.Id, cardnumber);

            if (vc == null)
            {
                return(null);
            }
            return(VirtualCardConverter.ToDTO(vc));
        }
예제 #2
0
        private static ICollection <VirtualCardDTO> toVirtualCardsDTO(ICollection <VirtualCard> entities)
        {
            ICollection <VirtualCardDTO> cards = new List <VirtualCardDTO>();

            if (entities == null)
            {
                return(cards);
            }

            foreach (VirtualCard en in entities)
            {
                cards.Add(VirtualCardConverter.ToDTO(en));
            }

            return(cards);
        }
예제 #3
0
 public IHttpActionResult GetAllVirtualCards(string username, string cardname)
 {
     return(Json(VirtualCardConverter.ToDTO(_service.GetVirtualCard(username, cardname))));
 }