Пример #1
0
        public bool UpdatePartido(Partido p)
        {
            MySqlConnection Conexion = new MySqlConnection();
            MySqlCommand    Query    = new MySqlCommand();
            MySqlDataReader consulta;

            AbrirConexionSql(Conexion);
            //
            Query.CommandText = "UPDATE PARTIDOS SET GOL_LOCAL=" + p.getGolLocal() + ", GOL_VISITANTE=" + p.getGolVisitante() + " WHERE FECHA='" + p.getFecha() + "' AND LOCAL=" + p.getLocal() + " AND VISITANTE=" + p.getVisitante() + ";";
            Query.Connection  = Conexion;
            consulta          = Query.ExecuteReader();

            Conexion.Close();
            return(true);
        }
Пример #2
0
        public bool NuevoPartido(Partido partido)
        {
            MySqlConnection Conexion = new MySqlConnection();
            MySqlCommand    Query    = new MySqlCommand();
            MySqlDataReader consulta;

            AbrirConexionSql(Conexion);
            //Insertar aqui...

            Query.CommandText = "INSERT INTO PARTIDOS (FECHA,HORARIO,LOCAL,VISITANTE,GOL_LOCAL, GOL_VISITANTE,LIGA) VALUES " + "('" + partido.getFecha() + "','" + partido.getHorario() + "','" + partido.getLocal() + "','" + partido.getVisitante() + "','" + partido.getGolLocal() + "','" + partido.getGolVisitante() + "','" + partido.getLiga() + "');";

            Query.Connection = Conexion;
            consulta         = Query.ExecuteReader();

            Conexion.Close();
            return(true);
        }