Exemplo n.º 1
0
        public void pushTransaction(double balance)
        {
            if (!ready)
            {
                ready = true;
                return;
            }
            if (!can_push)
            {
                return;
            }
            can_push = false;

            DatabaseInterface di = DatabaseInterface.getInstance();
            int status           = di.pcik_up_cash(accID, balance);

            parent.showTransactionMsg(status);
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            long val                 = (long)numericUpDown1.Value;
            DatabaseInterface di     = DatabaseInterface.getInstance();
            string            result = di.getAccountId(val);

            if (result.Equals(""))
            {
                label2.Text      = "this card is not exist";
                label2.ForeColor = Color.Red;
                return;
            }
            else
            {
                patent.setuserData(result, val);
                funRunCucesful = true;
                this.Dispose();
            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
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();
            }
        }
Exemplo n.º 5
0
        //if menu >> ACCOUNT status
        private void button17_Click(object sender, EventArgs e)
        {
            if (dPhase == DysplayPhase.menuAfterLogin)
            {
                DatabaseInterface di     = DatabaseInterface.getInstance();
                string            status = di.getAccountStatus(account_id);

                panel2.Controls.Clear();
                menuAlogin.Dispose();

                acc_status_panel = new Account_status(status, appLang);
                panel2.Controls.Add(acc_status_panel);

                dPhase = DysplayPhase.acc_status_shown;
            }
            if (dPhase == DysplayPhase.makeTransaction)
            {
                double bal = 30d;
                pickUpCash.pushTransaction(bal);
            }
        }
Exemplo n.º 6
0
 public void pushPhase()
 {
     Console.WriteLine("phush call" + input + " " + input.Length);
     if (status == 1 && input.Length == 4)
     {
         status           = 2;
         old_pin          = input;
         input            = "";
         textBox1.Text    = "";
         label2.Text      = "";
         label2.ForeColor = Color.Red;
         label1.Text      = data[12];
     }
     if (status == 2 && input.Length == 4)
     {
         status        = 3;
         new_pin1      = input;
         input         = "";
         textBox1.Text = "";
         label1.Text   = data[13];
     }
     if (status == 3 && input.Length == 4)
     {
         status        = 4;
         new_pin2      = input;
         input         = "";
         textBox1.Text = "";
         label1.Text   = data[14];
     }
     if (status == 4)
     {
         if (!String.Equals(new_pin1, new_pin2))
         {
             label2.Text   = data[15];
             input         = "";
             textBox1.Text = "";
             old_pin       = "";
             new_pin1      = "";
             new_pin2      = "";
             status        = 1;
             label1.Text   = data[11];
             return;
         }
         DatabaseInterface di = DatabaseInterface.getInstance();
         int db_response      = di.change_pin(card_id, old_pin, new_pin1);
         if (db_response == -1)
         {
             label2.Text = "err";
             return;
         }
         if (db_response == 1)
         {
             label1.Text   = data[11];
             label2.Text   = data[16];
             input         = "";
             textBox1.Text = "";
             old_pin       = "";
             new_pin1      = "";
             new_pin2      = "";
             status        = 1;
             return;
         }
         if (db_response == 0)
         {
             label2.Text      = data[17];
             label2.ForeColor = Color.Green;
         }
     }
 }