示例#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);
        }
示例#2
0
 public void UpdateCreditCard(int id, ICreditCard creditCard)
 {
     Data.CreditCard card = MoveToData(creditCard);
     card.ModifiedDate = DateTime.UtcNow;
     DataContext.UpdateItem(id, card);
 }
示例#3
0
 public void AddCreditCard(ICreditCard creditCard)
 {
     Data.CreditCard card = MoveToData(creditCard);
     card.ModifiedDate = DateTime.UtcNow;
     DataContext.AddItem(card);
 }
示例#4
0
 public void UpdateCreditCard(string cardNumber, ICreditCard creditCard)
 {
     Data.CreditCard card = MapToDataCreditCard(creditCard);
     card.ModifiedDate = DateTime.UtcNow;
     _context.UpdateCreditCard(cardNumber, card);
 }