コード例 #1
0
        public static void DeleteAccount(int accountNo)
        {
            var account = BankFactory.GetAccountDetails(accountNo);

            db.Accounts.Remove(account);
            db.SaveChanges();
        }
コード例 #2
0
        public static void EditAccount(Account updatedAccount)
        {
            var oldAccount = BankFactory.GetAccountDetails(updatedAccount.AccountNumber);

            oldAccount.EmailAddress = updatedAccount.EmailAddress;
            oldAccount.AccountType  = updatedAccount.AccountType;
            db.Update(oldAccount);
            db.SaveChanges();
        }