Exemple #1
0
        private void login_send_Click_1(object sender, EventArgs e)
        {
            Data    d = new Data();
            HashPSW h = new HashPSW();

            if (lbl_user.Text != "")
            {
                if (lbl_password.Text != "")
                {
                    int cp = Convert.ToInt32(d.cdb("SELECT COUNT(*) FROM Utenti WHERE ID_Utente = '" + lbl_user.Text + "' AND Password = '******'"));
                    if (cp == 1)
                    {
                        UUID = lbl_user.Text;
                        MessageBox.Show("Login avvenuto correttamente", "Informazioni", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Banca b = new Banca();
                        this.Hide();
                        b.Show();
                    }
                    else
                    {
                        MessageBox.Show("Password o Utente errato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Password Non inserita", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Codice Utente Non inserito", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void build_conto_Click(object sender, EventArgs e)
        {
            Data    d  = new Data();
            GenData gd = new GenData();
            int     cp = Convert.ToInt32(d.cdb("SELECT COUNT(*) FROM Conti WHERE Nome_Conto = '" + comboBox1.Text + "'"));

            d.databaseConnection.Close();
            if (cp == 0)
            {
                int spese = 0;
                if (comboBox1.Text == "Young")
                {
                    spese = 12;
                }
                else
                {
                    spese = 24;
                }
                d.db("INSERT INTO Conti(ID_Conto, ID_Utente, IBAN, Nome_Conto, Tipologia, Saldo, Spese) VALUES('" + gd.IDC() + "', '" + Login.UUID + "', '" + gd.IBAN() + "', '" + lbl_nc.Text + "', '" + comboBox1.Text + "', '0', '" + spese + "')");
                this.Close();
                Banca b = new Banca();
                b.Show();
            }
        }
Exemple #3
0
 public Login(Banca b)
 {
     banca = b;
 }