Beispiel #1
0
        private static CreditCardView create(CreditCard card)
        {
            var view = new CreditCardView
            {
                CardNumber       = card?.Data?.Number,
                CreditLimit      = card?.CreditLimit?.Amount ?? 0,
                DailyLimit       = card?.DailyLimit?.Amount ?? 0,
                CurrencyID       = card?.Data?.CurrencyID,
                BillingAddress   = card?.Data?.Address,
                CardName         = card?.Data?.Organization,
                NameOnCard       = card?.Data?.Name,
                VerificationCode = card?.Data?.Code,
                IssueNumber      = card?.Data?.Issue,
                ID         = card?.Data?.ID,
                ValidFrom  = card?.Data?.ValidFrom,
                ExpireDate = card?.Data?.ValidTo
            };

            return(view);
        }
Beispiel #2
0
        public static CreditCard Create(CreditCardView view)
        {
            var card = new CreditCardData {
                Number       = view?.CardNumber,
                CreditLimit  = view?.CreditLimit ?? 0,
                DailyLimit   = view?.DailyLimit ?? 0,
                CurrencyID   = view?.CurrencyID,
                Address      = view?.BillingAddress,
                Organization = view?.CardName,
                Name         = view?.NameOnCard,
                Code         = view?.VerificationCode,
                Issue        = view?.IssueNumber,
                ID           = view?.ID,
                ValidFrom    = view?.ValidFrom ?? DateTime.MinValue,
                ValidTo      = view?.ExpireDate ?? DateTime.MaxValue
            };

            card.Currency = new CurrencyData {
                ID = card.CurrencyID
            };
            return(new CreditCard(card));
        }