Ejemplo n.º 1
0
 private void seleccion() {
   if (opciones[menu.getSelectedIndex()].equals(MetodosGlobales.opciones[1])) { // Atracciones
     Estilos.pushScreen(new Atracciones());
   } else if (opciones[menu.getSelectedIndex()].equals(MetodosGlobales.opciones[2])) { // Nuevas
     Estilos.pushScreen(new MenuContactos());
   } else if (opciones[menu.getSelectedIndex()].equals(MetodosGlobales.opciones[3])) { // Buscar
     Estilos.pushScreen(new Establecidas(MetodosGlobales.establecidasTitulo()));
   } else if (opciones[menu.getSelectedIndex()].equals(
       MetodosGlobales.opciones[5])) { // Facturacion
     Estilos.pushScreen(new FacturaResumen());
   } else if (opciones[menu.getSelectedIndex()].equals(
       MetodosGlobales.opciones[6])) { // Indicadores
     Estilos.pushScreen(new IndicadorDetalle());
   }
 }
Ejemplo n.º 2
0
  private void llenaJerarquia() {
    Item item;
    FacturacionDB facturaciones = new FacturacionDB();
    jerarquia = new Vector();
    int i, n, m, c;
    String[] campanas = facturaciones.mostrarCampanas(facturaciones.getObjetos());

    m = campanas.length;
    double totales[][] = facturaciones.arrayTotalesxFilaAgrup(null); // se llena con objetos
    String[] sCategorias = MetodosGlobales.lsCatFacturacion();
    n = sCategorias.length;
    for (c = 0; c < m; c++) {
      item = new Item(true, campanas[c], "", false, c);
      for (i = 0; i < n; i++) {
        if (i == 7)
          item.getItems()
              .addElement(
                  new Item(
                      false,
                      sCategorias[i],
                      Cadenas.getMoneda().concat(String.valueOf(Sistema.round(totales[i][c]))),
                      false,
                      c));
        else
          item.getItems()
              .addElement(
                  new Item(
                      false,
                      sCategorias[i],
                      String.valueOf(Sistema.round(totales[i][c])),
                      false,
                      c));
      }
      jerarquia.addElement(item);
    }
    llenaLista();
  }
Ejemplo n.º 3
0
  public MenuOpciones() {
    VerticalFieldManager vField = new VerticalFieldManager();
    UsuarioDB usuarios = new UsuarioDB();
    usuario = usuarios.getUsuario();
    usuarios = null;
    //		meGlobales.setPerfil(perfil);

    HorizontalFieldManager hField =
        new HorizontalFieldManager() {
          protected void sublayout(int width, int height) {
            super.sublayout(super.getScreen().getWidth(), height);
            super.setExtent(super.getScreen().getWidth(), getField(1).getHeight());
            Field field;

            field = getField(0);
            layoutChild(field, width / 2, height);
            // setPositionChild(field, (width / 4) - ( field.getPreferredWidth() / 2), 0);
            setPositionChild(field, 5, 0);

            field = getField(1);
            layoutChild(field, width, height);
            setPositionChild(field, (width / 2) + (width / 4) - (field.getPreferredWidth() / 2), 0);
          }
        };

    vField.add(new LabelField("", LabelField.FIELD_LEFT));
    vField.add(
        new mkpyLabelField(
            usuario.getNombre(),
            LabelField.ELLIPSIS | LabelField.FIELD_LEFT,
            Color.BLACK,
            Color.WHITE,
            true));
    vField.add(new LabelField(usuario.getZonaRegionPais(), LabelField.FIELD_LEFT));
    vField.add(new LabelField(usuario.getCampanaFormato(), LabelField.FIELD_LEFT));

    hField.add(vField);
    hField.add(
        new BitmapField(
            Bitmap.getBitmapResource("img/logo.png"),
            BitmapField.FIELD_LEFT | BitmapField.FIELD_VCENTER));

    opciones = MetodosGlobales.menuOpcionesxPerfil();
    menu = new ListField(opciones.length, ListField.FIELD_HCENTER);
    menu.setCallback(this);

    add(
        new BitmapField(
            Bitmap.getBitmapResource("img/titulos/menuprincipal.png"), BitmapField.FIELD_HCENTER));
    add(hField);
    add(menu);
    addMenuItem(mnSincronizar);
    addMenuItem(mnAcerca);
    addMenuItem(mnCerrarSesion);

    Sistema.addEstadistica(Cadenas.MENUPRINCIPAL);

    if (usuario != null) {
      // MBL : Timer de sincronización
      long tiempo = usuario.getTiempoDatosConsultora() * 60 * 60000; // mbl: En horas
      // long tiempo = 3*60*1000;
      timer = new Timer();
      timer.schedule(new Sicronizacion(), tiempo, tiempo);
    }
  }