public State(GUIforATM mainForm, string language) { this.mainForm = mainForm; left1BTN = (Button)mainForm.Controls["left1BTN"]; left2BTN = (Button)mainForm.Controls["left2BTN"]; left3BTN = (Button)mainForm.Controls["left3BTN"]; left4BTN = (Button)mainForm.Controls["left4BTN"]; right1BTN = (Button)mainForm.Controls["right1BTN"]; right2BTN = (Button)mainForm.Controls["right2BTN"]; right3BTN = (Button)mainForm.Controls["right3BTN"]; right4BTN = (Button)mainForm.Controls["right4BTN"]; bigDisplayLBL = (Label)mainForm.Controls["bigDisplayLBL"]; smallDisplayLBL = (Label)mainForm.Controls["smallDisplayLBL"]; theCardReader = mainForm.getCardReader(); theCashDispenser = mainForm.getCashDispenser(); this.language = language.ToUpper(); //default language theCard = mainForm.getCard(); theCashcard = mainForm.getCashcard(); }
public GUIforATM(Card c, Cashcard cC) { InitializeComponent(); theCard = c; theCashcard = cC; theCardReader = new CardReader(rightPicBox); theCardReader.withoutCard(); theCashDispenser = new CashDispenser(leftPicBox); theCashDispenser.withoutCash(); keysound = new SoundPlayer(Properties.Resources.keysound); keysound.Load(); currentState = new WaitForBankCardState(this, "ENGLISH"); }
private void okBTN_Click(object sender, EventArgs e) { Card theCard = new Card(pinTB.Text, NRICorFIN.Text); Account a; double bal; //Cashcard Cashcard theCashcard; if (!cashcardBal.Text.Equals("")) { theCashcard = new Cashcard(cashcardBal.Text); } else { theCashcard = new Cashcard("0"); } if (acct1NoTB.Text != "") { bal = Convert.ToDouble(acct1BalTB.Text); a = new Account(acct1NoTB.Text, bal); theCard.addAccount(a); } if (acct2NoTB.Text != "") { bal = Convert.ToDouble(acct2BalTB.Text); a = new Account(acct2NoTB.Text, bal); theCard.addAccount(a); } if (acct3NoTB.Text != "") { bal = Convert.ToDouble(acct3BalTB.Text); a = new Account(acct3NoTB.Text, bal); theCard.addAccount(a); } //this.Hide(); (new GUIforATM(theCard, theCashcard)).Show(); }