public static Venta seleccionar(Cliente cliente) { SelectorDeFacturas selector = new SelectorDeFacturas(); selector.setSelectionMode(ListSelection.SINGLE_SELECTION); selector.setCliente(cliente); selector.open(); if (!selector.hasBeenCanceled()) { Venta v = selector.getSelected(); v = Services.getInstance().getFacturasManager().buscarVentaInicializada(v.getId()); return v; } return null; }
public static List<Venta> seleccionar() { SelectorDeFacturas selector = new SelectorDeFacturas(); selector.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION); selector.open(); if (!selector.hasBeenCanceled()) { List<Venta> ventas = new ArrayList<Venta>(); ventas.addAll(selector.getSelectedList()); selector.clean(); return ventas; } return new ArrayList<Venta>(0); }