Examples of Tienda


Examples of org.sfaci.holadb4o.base.Tienda

    cargarFilas(tiendas);
  }
 
  public void listar(final String filtro, int campo) {
   
    Tienda tienda = null;
    List<Tienda> tiendas = null;
   
    switch (campo) {
    case Constantes.C_TODOS:
      tiendas = Util.db.query(new Predicate<Tienda>() {
        @Override
        public boolean match(Tienda tienda) {
         
          if (tienda.getNombre().contains(filtro))
            return true;
          if (tienda.getDescripcion().contains(filtro))
            return true;
          if (String.valueOf(tienda.getNumeroLocal()).contains(filtro))
            return true;
         
          return false;
        }
      });
      break;
    case Constantes.C_NOMBRE:
      tienda = new Tienda();
      tienda.setNombre(filtro);
      tiendas = Util.db.queryByExample(tienda);
      break;
    case Constantes.C_DESCRIPCION:
      tienda = new Tienda();
      tienda.setDescripcion(filtro);
      tiendas = Util.db.queryByExample(tienda);
      break;
    case Constantes.C_NUMERO_LOCAL:
      tienda = new Tienda();
      tienda.setNumeroLocal(Integer.parseInt(filtro));
      tiendas = Util.db.queryByExample(tienda);
      break;
    case Constantes.C_FECHA_APERTURA:
      try {
        tienda = new Tienda();
        tienda.setFechaApertura(new SimpleDateFormat().parse(filtro));
        tiendas = Util.db.queryByExample(tienda);
      } catch (ParseException pe) {
        pe.printStackTrace();
      }
      break;
View Full Code Here

Examples of org.sfaci.holadb4o.base.Tienda

    filaSeleccionada = getSelectedRow();
    if (filaSeleccionada == -1)
      return null;
   
    String nombre = (String) getValueAt(filaSeleccionada, 0);
    Tienda tienda = new Tienda();
    tienda.setNombre(nombre);
    // Se asume que no existen dos tiendas con el mismo nombre.
    // As� se puede contar con que la consulta s�lo devuelve un resultado
    ObjectSet<Tienda> resultado = Util.db.queryByExample(tienda);
    tienda = resultado.next();
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.