Esempio n. 1
0
        // the interface is applied so as to reduce tight coupling between the method and bankAccounts
        // You can change it if you want, it's quite flexible.... i think.
        public static Account Login(IBankAccounts bankAccounts, string accountNumber, string password)
        {
            var checkExistence = bankAccounts.AccountExists(accountNumber);

            if (checkExistence)
            {
                var checkDetails = bankAccounts.AccountLoginMatch(accountNumber, password);
                if (checkDetails)
                {
                    var UserAccount = bankAccounts.returnAccount(accountNumber);
                    return(UserAccount);
                }
            }
            return(null);
        }