//TODO: constructor con cinco parametros numero de cuenta de usuario, pantalla, base de datos //teclado y lugar de deposito, con un constructor base public Deposit(int userAccountNumber, Screen atmScreen, BankDatabase atmBankDatabase, Keypad atmKeypad, DepositSlot atmDepositSlot) : base(userAccountNumber, atmScreen, atmBankDatabase) { //TODO: inicializamos el teclado y lugar de deposito }
public Deposit(int currentAccountNumber, Screen screen, BankDatabase bankDatabase, Keypad keypad, DepositSlot depositSlot) { this.currentAccountNumber = currentAccountNumber; this.screen = screen; this.bankDatabase = bankDatabase; this.keypad = keypad; this.depositSlot = depositSlot; }
public TestClass() { _depositSlot = new DepositSlot(); _menu = new Menu(); _bankDatabase = new BankDatabase(); _iScreen = new Screen(); _keypad = new Keypad(); _cashDispenser = new CashDispenser(); }
/// <summary> /// no-argument ATM constructor initializes instance variables /// </summary> public ATM() { _authenticateService = new AuthenticateService(); _transactionFactory = new TransactionFactory(); _cashDispenser = new CashDispenser(); _depositSlot = new DepositSlot(); _keypad = new Keypad(); _screen = new Screen(); }
// five-parameter constructor initializes class's instance variables public Deposit(int userAccountNumber, Screen atmScreen, BankDatabase atmBankDatabase, Keypad atmKeypad, DepositSlot atmDepositSlot) : base(userAccountNumber, atmScreen, atmBankDatabase) { // initialize references to keypad and deposit slot keypad = atmKeypad; depositSlot = atmDepositSlot; }
private bool userAuthenticated; // true if user is authenticated #endregion Fields #region Constructors // parameterless constructor initializes instance variables public ATM() { userAuthenticated = false; // user is not authenticated to start currentAccountNumber = 0; // no current account number to start screen = new Screen(); // create screen keypad = new Keypad(); // create keypad cashDispenser = new CashDispenser(); // create cash dispenser depositSlot = new DepositSlot(); // create deposit slot bankDatabase = new BankDatabase(); // create account info database }
// parameterless constructor initializes instance variables public ATM() { userAuthenticated = false; // user is not authenticated to start currentAccountNumber = 0; // no current account number to start screen = new Screen(); // create screen keypad = new Keypad(); // create keypad cashDispenser = new CashDispenser(); // create cash dispenser depositSlot = new DepositSlot(); // create deposit slot bankDatabase = new BankDatabase(); // create account info database }
static void Main(string[] args) { cashDispenser = new CashDispenser(); bankDatabase = new BankDatabase(); depositSlot = new DepositSlot(); keypad = new Keypad(); screen = new Screen(); menu = new Menu(); atm = new ATM(cashDispenser, bankDatabase, depositSlot, keypad, screen, menu); atm.Run(); }
public Deposit(BankDatabase atmBankDatabase, Keypad atmKeypad, DepositSlot atmDepositSlot) : base(atmBankDatabase) { _keypad = atmKeypad; _depositSlot = atmDepositSlot; }
public Transaction CreateTransaction(MenuOption type, Keypad keypad, CashDispenser cashDispenser, DepositSlot depositSlot) { Transaction temp = null; switch (type) { case MenuOption.BalanceInquiry: temp = new BalanceInquiry(BankDatabase); break; case MenuOption.Withdrawal: temp = new Withdrawal(BankDatabase, keypad, cashDispenser); break; case MenuOption.Deposit: temp = new Deposit(BankDatabase, keypad, depositSlot); break; } return(temp); }
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { adap.FillBy1(dt, Request.QueryString[0]); foreach (DataRow row in dt.Rows) { if (row["acc_type"].ToString() == "Checkings") { lblChecking.Text = " $" + row["acc_balance"].ToString(); checking=Convert.ToDecimal(row["acc_balance"]); } if (row["acc_type"].ToString() == "Savings") lblSavings.Text = "$"+ row["acc_balance"].ToString(); saving=Convert.ToDecimal(row["acc_balance"]); } lblTransfer.Text = "Savings"; ViewState["C"] = checking; ViewState["S"] = saving; } cashDispenser = new CashDispenser(); // create cash dispenser depositSlot = new DepositSlot(); // create deposit slot bankDatabase = new BankDatabase(); }