Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            kompigui frm = new kompigui();

            frm.Show();
            this.Hide();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            loginscreen a   = new loginscreen();
            kompigui    fr2 = new kompigui();

            this.Visible = true;
            a.Show();
            Close();
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            progressBar1.Visible = true;
            button3.Visible      = false;
            string user = textBox1.Text;
            string pass = textBox2.Text;


            mysqlbaglan.Open();
            if (mysqlbaglan.State != ConnectionState.Closed)
            {
                char   paid = 'p';
                string str  = MD5(textBox2.Text);
                textBox2.Text = str;
                string       sql    = "SELECT * FROM `users` WHERE `username` = '" + textBox1.Text + "' AND `password` = '" + textBox2.Text + "' ";
                string       sqlpay = "SELECT * FROM `users` WHERE `username` = '" + textBox1.Text + "' AND `pay` = '" + paid + "' ";
                MySqlCommand pay    = new MySqlCommand(sqlpay, mysqlbaglan);

                MySqlCommand    cmd = new MySqlCommand(sql, mysqlbaglan);
                MySqlDataReader rdr = cmd.ExecuteReader();


                if (rdr.Read())
                {
                    mysqlbaglan.Close();
                    mysqlbaglan.Open();

                    MySqlDataReader rdrpay = pay.ExecuteReader();
                    if (rdrpay.Read())
                    {
                        kompigui frm = new kompigui();
                        frm.Show();
                        this.Hide();
                        mysqlbaglan.Close();
                    }
                    else
                    {
                        MessageBox.Show("You didn't pay for it. Please buy first.");
                    }
                }


                else
                {
                    MessageBox.Show("Invalid username/password.");
                }
                rdr.Close();
            }
            else
            {
                MessageBox.Show("No connection !");
            }
            mysqlbaglan.Close();
        }