Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public override State handleRight4BTNClick()
        {
            State nextStep = new RemoveCashCardState(mainForm, language, "CASHCARD");

            return(nextStep);
        }