Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            ekran ek = new ekran(telefon);

            ek.Show();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            telefon = int.Parse(textTel2.Text);
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\BartD\Desktop\wersja finalna 2015\zip\newb.mdf;Integrated Security=True;Connect Timeout=30;");

            con.Open();
            SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From Login where tel='" + textTel2.Text + "' and pin ='" + textBox1.Text + "'", con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                ekran ss = new ekran(telefon);
                ss.Show();

                using (SqlConnection sqlConn = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\bankomat\bankomat\zip\dataB.mdf;Integrated Security=True;Connect Timeout=30;"))
                {
                    sqlConn.Open();

                    string sqlQuery = ("SELECT stan_konta FROM LOGIN where tel='" + textTel2.Text + "'");


                    using (SqlCommand cmd = new SqlCommand(sqlQuery, sqlConn))
                    {
                        using (SqlDataReader reader = cmd.ExecuteReader())
                        {
                            if (reader.Read())
                            {
                                d = reader.GetInt32(reader.GetOrdinal("stan_konta"));
                            }
                            else
                            {
                                MessageBox.Show("nie ma takiej wartosci");
                            }
                        }
                    }

                    sqlConn.Close();
                }
            }
            else
            {
                MessageBox.Show("Proszę sprawdzic numer konta i pin:)");
            }
        }
Esempio n. 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            ekran ekr = new ekran(telefon);

            ekr.Show();
        }