예제 #1
0
        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();
        }
예제 #2
0
        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();
        }