Exemplo n.º 1
0
    public static string consultarIdServerRespuestaSqLiteById(string id)
    {
        string query  = "SELECT idServer FROM respuesta WHERE id = '" + id + "';";
        var    result = conexionDB.selectGeneral(query);

        if (result != "0")
        {
            respuestaData data = JsonUtility.FromJson <respuestaData>(result);
            return(data.idServer);
        }
        else
        {
            return("0");
        }
    }
Exemplo n.º 2
0
    /*public static respuestaData getRespuestaByDescripcionSqLite(string descripcion) {
     *  string query = "SELECT * FROM respuesta WHERE descripcion = '" + descripcion + "';";
     *  var result = conexionDB.selectGeneral(query);
     *  if (result != "0") {
     *      respuestaData respuesta = JsonUtility.FromJson<respuestaData>(result);
     *      return respuesta;
     *  } else {
     *      return null;
     *  }
     * }
     *
     * public static respuestaData getRespuestaByDescripcionAndPreguntaSquLite(string descripcion, string idPregunta) {
     *  string query = "SELECT * FROM respuesta WHERE descripcion = '" + descripcion + "' AND idPregunta = '" + idPregunta + "';";
     *  var result = conexionDB.selectGeneral(query);
     *  if (result != "0") {
     *      respuestaData respuesta = JsonUtility.FromJson<respuestaData>(result);
     *      return respuesta;
     *  } else {
     *      return null;
     *  }
     * }*/

    public static respuestaData getRespuestaByIdServerAndPreguntaSquLite(string idServer, string idPregunta)
    {
        string query  = "SELECT * FROM respuesta WHERE idServer = '" + idServer + "' AND idPregunta = '" + idPregunta + "';";
        var    result = conexionDB.selectGeneral(query);

        if (result != "0")
        {
            respuestaData respuesta = JsonUtility.FromJson <respuestaData>(result);
            return(respuesta);
        }
        else
        {
            return(null);
        }
    }