예제 #1
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            i = 0;
            cn.Open();
            MySqlCommand cmd = cn.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from Login where Usuario ='" + txtusuario.Text + "' and Contraseña ='" + txtpassword.Text + "'";
            cmd.ExecuteNonQuery();
            DataTable        dt = new DataTable();
            MySqlDataAdapter da = new MySqlDataAdapter(cmd);

            da.Fill(dt);
            i = Convert.ToInt32(dt.Rows.Count.ToString());
            if (txtpassword.Text != "" && txtusuario.Text != "")
            {
                if (i == 0)
                {
                    MessageBox.Show("Ha ingresado un usuario o contraseña invalido");
                    txtpassword.Clear();
                    txtusuario.Clear();
                    txtusuario.Focus();
                }
                else
                {
                    MessageBox.Show("Bienvenido");
                    Menu_Principal forma = new Menu_Principal();
                    forma.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Rellene ambos campos.");
                txtpassword.Clear();
                txtusuario.Clear();
                txtusuario.Focus();
            }
            cn.Close();
        }
예제 #2
0
        private void Buscar_Alumno_FormClosed(object sender, FormClosedEventArgs e)
        {
            Menu_Principal menu = new Menu_Principal();

            menu.Show();
        }
예제 #3
0
        private void Registro_del_alumno_FormClosed(object sender, FormClosedEventArgs e)
        {
            Menu_Principal forma = new Menu_Principal();

            forma.Show();
        }
예제 #4
0
        private void camposformativos_FormClosed(object sender, FormClosedEventArgs e)
        {
            Menu_Principal forma = new Menu_Principal();

            forma.Show();
        }
예제 #5
0
        private void ConsultaAlumnado_FormClosed(object sender, FormClosedEventArgs e)
        {
            Menu_Principal forma = new Menu_Principal();

            forma.Show();
        }