public override State handleRightPicBoxClick() { theCardReader.withoutCard(); State nextStep = new WaitForBankCardState(mainForm, language); return(nextStep); }
public override State handleRight4BTNClick() ///Terminate button { State nextStep = this; if (isCardRemoved == false && isCashcardInsert == false) // remove atm card { nextStep = new RemoveCardState(mainForm, language); } else if (isCardRemoved && isCashcardInsert == false) //remove atm card (card already removed) { nextStep = new WaitForBankCardState(mainForm, language); } else if (isCardRemoved && isCashcardInsert) //remove cashcard { nextStep = new RemoveCashCardState(mainForm, language, "CASHCARD"); } aTimer.Stop(); return(nextStep); }
public override State handleRightPicBoxClick() { State nextStep = this; if (isCardRemoved == false && counter != 0) { theCardReader.withoutCard(); isCardRemoved = true; } else if (isCardRemoved == false && counter == 0) { theCardReader.withoutCard(); nextStep = new WaitForBankCardState(mainForm, language); } else { if (isCashcardInsert == false && counter != 0) { theCardReader.insertCashCard(); isCashcardInsert = true; aTimer.Stop(); bigDisplayLBL.Text = "Cashcard inserted"; bigDisplayLBL.Refresh(); //do topup algorithm OR pass to confirmation state //Ask for confirmation before deducting nextStep = new CashCardTopUpConfirmation(mainForm, language, acctNo, topupAmt, isCardRemoved, isCashcardInsert); } else if (isCashcardInsert == false && counter == 0) { nextStep = new WaitForBankCardState(mainForm, language); } } return(nextStep); }
public override State handleRight1BTNClick() { pauseforMilliseconds(1000); State nextStep = this; if (isCashcardInsert) { //get account & cashcard account = theCard.getAcctUsingAcctNo(acctNo); //Do deduction for topup account.withdraw(topupAmt); theCashcard.topUpCashcard(topupAmt); if (language.Equals("MALAY")) { bigDisplayLBL.Text = "Baki Kad Tunai : $" + string.Format("{0:0.00}", theCashcard.getBalance()) + "\nTransaksi Berjaya"; bigDisplayLBL.Refresh(); } else if (language.Equals("CHINESE")) { bigDisplayLBL.Text = "现金卡余额: $" + string.Format("{0:0.00}", theCashcard.getBalance()) + "\n交易成功"; bigDisplayLBL.Refresh(); } else //ENGLISH { bigDisplayLBL.Text = "Cash card balance : $" + string.Format("{0:0.00}", theCashcard.getBalance()) + "\nTransaction Successful"; bigDisplayLBL.Refresh(); } pauseforMilliseconds(3000); nextStep = new RemoveCashCardState(mainForm, language, "CASHCARD"); } else { if (language.Equals("MALAY")) { bigDisplayLBL.Text = "KEROSAKKAN pada ATM\nAMARAN: Tiada Kad Tunai yang dimasukkan"; bigDisplayLBL.Refresh(); } else if (language.Equals("CHINESE")) { bigDisplayLBL.Text = "ATM错误\n错误: 没有插入卡"; bigDisplayLBL.Refresh(); } else //ENGLISH { bigDisplayLBL.Text = "ERROR with ATM\nERROR: No Cashcard inserted"; bigDisplayLBL.Refresh(); } pauseforMilliseconds(3000); if (isCardRemoved) // ATM card already removed { nextStep = new WaitForBankCardState(mainForm, language); } else // ATM card not yet removed { nextStep = new RemoveCashCardState(mainForm, language, "ATM"); } } return(nextStep); }