Example #1
0
 /// <summary>
 /// The AddCard method receives the cardName and cardNumber;
 /// instantiates a new CreditCard, and adds it into the list.
 /// </summary>
 /// <param name="cardName">The card holder</param>
 /// <param name="cardNumber">The card number</param>
 public void AddCard(string cardName, string cardNumber)
 {
     DataCreditCard.Add(new CreditCard(this.customerID, cardName, cardNumber));
 }
Example #2
0
 /// <summary>
 /// The FetchCard method is a static method, which is used to interact with the data layer.
 /// It will return the card instance based on the received ID.
 /// </summary>
 /// <param name="id">The Card primary key.</param>
 /// <returns>The CreditCard instance</returns>
 public static CreditCard FetchCard(int id)
 {
     return(DataCreditCard.Fetch(id));
 }
Example #3
0
 /// <summary>
 /// The RemoveCard method is a static method, which is used to interact with the data layer.
 /// It will remove a card relating to the received ID.
 /// </summary>
 /// <param name="id">The Card primary key.</param>
 /// <returns>A boolean indicating success.</returns>
 public static Boolean RemoveCard(int id)
 {
     return(DataCreditCard.Remove(id));
 }
Example #4
0
 /// <summary>
 /// The UpdateCard method is a static method, which is used to interact with the data layer.
 /// It will update the record relating to the card object received.
 /// </summary>
 /// <param name="card">The credit card object</param>
 public static void UpdateCard(CreditCard card)
 {
     DataCreditCard.Update(card);
 }