Example #1
0
        public void AddCreditCard(ICreditCard creditCard)
        {
            if (creditCard.ExpMonth <= 0 || creditCard.ExpMonth > 12)
            {
                throw new ArgumentOutOfRangeException(nameof(creditCard.ExpMonth));
            }

            Data.CreditCard card = MapToDataCreditCard(creditCard);
            card.ModifiedDate = DateTime.UtcNow;
            _context.AddCreditCard(card);
        }
Example #2
0
 public void UpdateCreditCard(int id, ICreditCard creditCard)
 {
     Data.CreditCard card = MoveToData(creditCard);
     card.ModifiedDate = DateTime.UtcNow;
     DataContext.UpdateItem(id, card);
 }
Example #3
0
 public void AddCreditCard(ICreditCard creditCard)
 {
     Data.CreditCard card = MoveToData(creditCard);
     card.ModifiedDate = DateTime.UtcNow;
     DataContext.AddItem(card);
 }
Example #4
0
 public void UpdateCreditCard(string cardNumber, ICreditCard creditCard)
 {
     Data.CreditCard card = MapToDataCreditCard(creditCard);
     card.ModifiedDate = DateTime.UtcNow;
     _context.UpdateCreditCard(cardNumber, card);
 }