예제 #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (ok == true)
     {
         Chitanta f1 = new Chitanta();
         f1.Show();
         this.Hide();
     }
     else
     {
         verif_numerar(50);
         if (money == true)
         {
             retragere();
             con.Open();
             istoric(50);
             MySqlCommand cmd = con.CreateCommand();
             cmd.CommandType = CommandType.Text;
             cmd.CommandText = "update bancomat set Suma= Suma - 50 where PIN = '" + pin + "'";
             cmd.ExecuteNonQuery();
             con.Close();
             suma = "50";
         }
     }
 }
예제 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (ok == false)
            {
                bani = Int32.Parse(lbPin.Text.ToString());
                verif_numerar(bani);
                if (money == true)
                {
                    if (bani % 10 == 0)
                    {
                        if (bani <= 3000)
                        {
                            con.Open();
                            istoric(bani);
                            MySqlCommand cmd = con.CreateCommand();
                            cmd.CommandType = CommandType.Text;
                            cmd.CommandText = "update bancomat set Suma= Suma - '" + bani + "' where PIN = '" + pin + "'";
                            sumapars        = bani.ToString();
                            cmd.ExecuteNonQuery();
                            con.Close();
                            ok = true;
                            terminare();
                        }
                        else
                        {
                            lbPin.Text = "";
                            if (limba == "romana")
                            {
                                MessageBox.Show("Introduceți maxim 3000 de lei");
                            }
                            else
                            {
                                MessageBox.Show("Enter maxim 3000 RON");
                            }
                        }
                    }

                    else
                    {
                        lbPin.Text = "";
                        if (limba == "romana")
                        {
                            MessageBox.Show("Suma trebuie să fie multiplu de 10");
                        }
                        else
                        {
                            MessageBox.Show("Sum must be multiple of 10");
                        }
                    }
                }
            }
            else
            {
                checksum = "alta";
                Chitanta f1 = new Chitanta();
                f1.Show();
                this.Hide();
            }
        }
예제 #3
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (ok == false)
     {
         bani   = Int32.Parse(lbPin.Text.ToString());
         credit = bani.ToString();
         if (bani % 10 == 0)
         {
             if (bani <= 3000)
             {
                 con.Open();
                 istoric();
                 MySqlCommand cmd = con.CreateCommand();
                 cmd.CommandType = CommandType.Text;
                 cmd.CommandText = "update bancomat set imprumut=imprumut + '" + bani + "' where PIN = '" + pin + "'";
                 cmd.ExecuteNonQuery();
                 con.Close();
                 ok = true;
                 final();
             }
             else
             {
                 lbPin.Text = "";
                 if (limba == "romana")
                 {
                     MessageBox.Show("Introduceți maxim 3000 de lei");
                 }
                 else
                 {
                     MessageBox.Show("Enter maxim 3000 RON");
                 }
             }
         }
         else
         {
             lbPin.Text = "";
             if (limba == "romana")
             {
                 MessageBox.Show("Suma trebuie să fie multiplu de 10");
             }
             else
             {
                 MessageBox.Show("Sum must be multiple of 10");
             }
         }
     }
     else
     {
         ok1 = true;
         Chitanta f1 = new Chitanta();
         f1.Show();
         this.Hide();
         ok1 = false;
     }
 }