Exemple #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            this.Hide();
            menu mn = new menu();

            mn.Show();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            menu mene = new menu();

            mene.Show();
            Hide();
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int             a      = 0;
            MySqlConnection objcon = new MySqlConnection("server=localhost;port=3306;User Id=root;database=db_login;password=root");

            objcon.Open();
            MySqlCommand objcmd = objcon.CreateCommand();

            objcmd.CommandType = CommandType.Text;
            objcmd.CommandText = "select * from tb_login where usuario='" + txt1.Text + "'and senha='" + password_txt.Text + "'";
            objcmd.ExecuteNonQuery();
            DataTable        dt = new DataTable();
            MySqlDataAdapter da = new MySqlDataAdapter(objcmd);

            da.Fill(dt);
            a = Convert.ToInt32(dt.Rows.Count.ToString());
            if (a == 0)
            {
                MessageBox.Show("Erro, usuario ou senha incorreto");
            }
            else
            {
                this.Hide();
                menu prin = new menu();
                prin.Show();
                objcon.Close();
            }
        }
Exemple #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            Close();
            menu me = new menu();

            me.Show();
        }
Exemple #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "1" && textBox2.Text == "1")

            {
                menu auth = new menu();
                auth.Show();
                this.Hide();
            }
            else
            {
                textBox1.Text = "";
                textBox2.Text = "";
                MessageBox.Show("Вы ввели неверный логин или пароль. Проверьте его и попробуйте ввести ещё раз.", "Ошибка авторизации");
            }
        }
Exemple #6
0
        private void Button1_Click(object sender, EventArgs e)
        {
            string pas1 = "";
            string pas2 = "";

            if (textBox1.Text == pas1 && textBox2.Text == pas2)
            {
                this.Hide();
                menu f1 = new menu();
                f1.ShowDialog();
            }
            else
            {
                MessageBox.Show("введен неправильный пароль или логин");
            }
            textBox1.Clear();
            textBox2.Clear();
        }