Beispiel #1
0
        private void checkCardValidity()
        {
            Console.WriteLine(appLang);
            DatabaseInterface dat = DatabaseInterface.getInstance();

            if (dat.isCardBlocked(card_id.ToString()))
            {
                dPhase   = DysplayPhase.cardBlocked;
                errPanel = new ErrPanel(appLang);
                this.panel2.Controls.Clear();
                this.panel2.Controls.Add(errPanel);
            }
            else
            {
                dPhase   = DysplayPhase.enterPin;
                enterPin = new EnterPin(appLang);
                panel2.Controls.Clear();
                panel2.Controls.Add(enterPin);
            }
        }
Beispiel #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();
            }
        }