Exemplo n.º 1
0
        private void btnConectar_Click(object sender, EventArgs e)
        {
            Conexion.obtenerConexion();
            MessageBox.Show("Gracias por su visita");
            Form formTipo = new Tipo();

            formTipo.Show();
        }
Exemplo n.º 2
0
        private void btnContinuaaa_Click(object sender, EventArgs e)
        {
            Persona a = new Persona();

            string Buscar(int id)
            {
                Persona         listaBusacar = new Persona();
                MySqlCommand    comando      = new MySqlCommand(String.Format("select * from persone where id='{0}'", id), Conexion.obtenerConexion());
                MySqlDataReader reader       = comando.ExecuteReader();

                while (reader.Read())
                {
                    a.Id     = reader.GetInt32(0);
                    a.Nombre = reader.GetString(1);
                }
                return(a.Nombre = reader.GetString(1));
            }

            if (String.IsNullOrWhiteSpace(txtID.Text))
            {
                MessageBox.Show("Ingrerse un nombre para poder realizar la busqueda");
            }
            else
            {
                MessageBox.Show($"Bienvenido {Buscar(int.Parse(txtID.Text))}");
            }
            Form formCategorias = new Categorias();

            formCategorias.Show();
        }
Exemplo n.º 3
0
        private void btnMaleta_Click(object sender, EventArgs e)

        {
            miAccesorio3.idProducto = 19;

            int ActualizarStock(int id)
            {
                int          retorna = 0;
                MySqlCommand comando = new MySqlCommand(String.Format($"update productos set stock={miAccesorio3.Stock} where idProducto={miAccesorio3.idProducto}"), Conexion.obtenerConexion());

                retorna = comando.ExecuteNonQuery();
                return(retorna);
            }

            int retorno = ActualizarStock(miAccesorio3.idProducto);
        }