Ejemplo n.º 1
0
        //set english language
        //if account_status >> BACK
        //if change_pin >> CANCEL
        //id cash_operation >> CANCEL
        private void button20_Click(object sender, EventArgs e)
        {
            if (DysplayPhase.selectLang == dPhase)
            {
                appLang = AppLanguage.English;
                pp1.Dispose();
                checkCardValidity();
            }
            if (dPhase == DysplayPhase.acc_status_shown)
            {
                panel2.Controls.Clear();
                acc_status_panel.Dispose();

                menuAlogin = new MenuAfterLogin(appLang);
                panel2.Controls.Add(menuAlogin);
                dPhase = DysplayPhase.menuAfterLogin;
            }
            if (dPhase == DysplayPhase.change_pin)
            {
                ch_pin_panel.Dispose();
                panel2.Controls.Clear();

                menuAlogin = new MenuAfterLogin(appLang);
                panel2.Controls.Add(menuAlogin);

                dPhase    = DysplayPhase.menuAfterLogin;
                ch_pin_in = "";
            }
            if (dPhase == DysplayPhase.makeTransaction)
            {
                pickUpCash.Dispose();
                panel2.Controls.Clear();
                menuAlogin = new MenuAfterLogin(appLang);
                panel2.Controls.Add(menuAlogin);
                dPhase = DysplayPhase.menuAfterLogin;
                try
                {
                    trans_msg.Dispose();
                }
                catch { }
            }
        }
Ejemplo n.º 2
0
        //OK
        private void button12_Click(object sender, EventArgs e)
        {
            if (dPhase == DysplayPhase.enterPin && user_input.Length == 4)
            {
                DatabaseInterface di = DatabaseInterface.getInstance();
                bool isPinValid      = di.isPinValid(user_input, card_id.ToString());

                if (isPinValid)
                {
                    di.resetWrongTry(card_id.ToString());
                    di.resetWrongTry(card_id.ToString());
                    dPhase = DysplayPhase.menuAfterLogin;
                    panel2.Controls.Clear();
                    menuAlogin = new MenuAfterLogin(appLang);
                    panel2.Controls.Add(menuAlogin);
                }
                else
                {
                    bool isCardBlockt = di.isCardBlocked(card_id.ToString());
                    if (isCardBlockt)
                    {
                        dPhase   = DysplayPhase.cardBlocked;
                        errPanel = new ErrPanel(appLang);
                        this.panel2.Controls.Clear();
                        this.panel2.Controls.Add(errPanel);
                    }
                    else
                    {
                        di.setWrongTry(card_id.ToString());
                        enterPin.setErr();
                        user_input = "";
                        enterPin.setPin(user_input);
                    }
                }
            }
            if (dPhase == DysplayPhase.change_pin && ch_pin_in.Length == 4)
            {
                ch_pin_in = "";
                ch_pin_panel.pushPhase();
            }
        }