Exemple #1
0
  public void actualizar_registros() {
    mVisitas = new Visitas_model(db);
    Cursor c = mVisitas.getNuevos();

    if (c.getCount() > 0) {
      while (c.moveToNext()) {
        JsonSetTask task =
            new JsonSetTask(
                c.getString(2),
                c.getString(3),
                c.getString(4),
                c.getString(5),
                c.getString(6),
                c.getString(7));
        String url2 = config.getIp(db) + "/actualizaciones/setVisita/";
        task.execute(new String[] {url2});
      }
    } else {
      Toast.makeText(mContext, config.msjNoRegistros("visitas"), Toast.LENGTH_SHORT).show();
    }

    JsonReadTask taskVisitas = new JsonReadTask();
    String url = config.getIp(db) + "/actualizaciones/getVisitas/";
    taskVisitas.execute(new String[] {url});
  }
  public void actualizar_visitas(View view) {
    JsonReadTask taskclientes = new JsonReadTask();
    String url = "http://10.0.2.2/durox/index.php/actualizaciones/getVisitas/";
    taskclientes.execute(new String[] {url});

    mVisitas = new Visitas_model(db);

    Cursor c = mVisitas.getNuevos();

    if (c.getCount() > 0) {
      while (c.moveToNext()) {

        JsonSetTask task =
            new JsonSetTask(
                c.getString(2),
                c.getString(3),
                c.getString(4),
                c.getString(5),
                c.getString(6),
                c.getString(7));

        String url2 = "http://10.0.2.2/durox/index.php/actualizaciones/setVisita/";
        task.execute(new String[] {url2});
      }
    } else {
      Toast.makeText(this, "No hay visitas cargadas", Toast.LENGTH_SHORT).show();
    }
  }