예제 #1
0
 public void openFAQ(View view) {
   if (bloqueo.getState("Preguntas")) {
     Funciones.makeResultAlert(mContext, bloqueo.getMsg("Preguntas"), false).show();
   } else {
     startActivity(new Intent(this, FAQActivity.class));
   }
 }
예제 #2
0
    protected void onPostExecute(String result) {
      if (result != null) {
        if (code == 0) {
          Intent topologica = new Intent(getApplicationContext(), VistaTopologica.class);
          topologica.putExtra("PHONE", phone.getText().toString());
          topologica.putExtra("RESULT", result);
          startActivityForResult(topologica, 0);
          Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
          vibrator.vibrate(50);
        } else {
          Funciones.makeResultAlert(mContext, result, false).show();
        }
      } else {
        Funciones.makeResultAlert(mContext, errorMessage, false).show();
      }

      if (this.dialog.isShowing()) {
        this.dialog.dismiss();
      }
    }
예제 #3
0
  public void show_plantas_externas(View view) {
    if (bloqueo.getState("PlantasExternas")) {
      Funciones.makeResultAlert(mContext, bloqueo.getMsg("PantasExternas"), false).show();
    } else {
      ConnectivityManager conMan =
          (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

      State senal3g = conMan.getNetworkInfo(0).getState();
      State wifi = conMan.getNetworkInfo(1).getState();

      if (senal3g == State.CONNECTED || wifi == State.CONNECTED) {
        Intent i = new Intent(this, Plantas_Externas.class);
        startActivityForResult(i, 0);

      } else {
        Funciones.makeResultAlert(
                mContext, "No existe conexión a internet para utilizar el Programa", false)
            .show();
      }
    }
  }
예제 #4
0
  public void buscar_cliente(View view) {
    if (bloqueo.getState("busquedaInicial")) {
      Funciones.makeResultAlert(mContext, bloqueo.getMsg("busquedaInicial"), false).show();
    } else {
      ConnectivityManager conMan =
          (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

      State senal3g = conMan.getNetworkInfo(0).getState();
      State wifi = conMan.getNetworkInfo(1).getState();
      if (senal3g == State.CONNECTED || wifi == State.CONNECTED) {
        if (phone.getText().length() == 0 || phone.getText() == null) {
          Funciones.makeResultAlert(mContext, "Ingrese un número de teléfono", false).show();
          return;
        }

        Consulta_Resources c = new Consulta_Resources();
        c.execute();
      } else {
        Funciones.makeResultAlert(
                mContext, "No existe conexión a internet para utilizar el Programa", false)
            .show();
      }
    }
  }