public static void Main(string[] args) { var context = new ATMEntities(); var account = context.CardAccounts.FirstOrDefault(); var pin = account.CardPIN; var cardNumber = account.CardNumber; var requestedAmount = 1000; WithdrawMoney(account, pin, cardNumber, requestedAmount); context.SaveChanges(); }
public static void LogTransaction(string cardNumber, decimal amount) { var context = new ATMEntities(); context.TransactionHistories.Add(new TransactionHistory() { CardNumber = cardNumber, TransactionDate = DateTime.Now, Amount = amount }); context.SaveChanges(); }