Created
September 23, 2010 16:36
-
-
Save alonso-contreras/593936 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List getPromocionSeleccionada() { | |
List promociones = new ArrayList(); | |
List promoList = getPromociones(); | |
Iterator iter = promoList.iterator(); | |
while (iter.hasNext()) { | |
Integer promo = (Integer) iter.next(); | |
String promocion = (String) promocionesDisponibles.get(promo); | |
promociones.add(promocion); | |
} | |
return promociones; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ****************** | |
// *** Promociones *** | |
// | |
Integer promo1 = new Integer(1); | |
Integer promo2 = new Integer(2); | |
List promoIntList = new ArrayList(); | |
promoIntList.add(promo1); | |
promoIntList.add(promo2); | |
Promocion p1 = new Promocion(); | |
p1.setDescripcion("25% DE DESCUENTO"); | |
p1.setIdPromocion(new Integer(1)); | |
p1.setTipo(Tipo.MENSUALIDADES); | |
Promocion p2 = new Promocion(); | |
p2.setDescripcion("30% DE DESCUENTO"); | |
p2.setIdPromocion(new Integer(2)); | |
p2.setTipo(Tipo.MENSUALIDADES); | |
Map promocionesMap = new HashMap(); | |
promocionesMap.put(promo1, p1); | |
promocionesMap.put(promo2, p2); | |
// Articulo 3 | |
Integer a3ID = new Integer(3); | |
Articulo a3 = new Articulo(a3ID, "Samsung", "Cámara Digital 10.2 MP Plata", | |
"/img/item02.jpg", Articulo.Tipo.TIENDA, new BigDecimal(1999.0), | |
new BigDecimal(2500.0), new BigDecimal(1999.0 * 2), | |
new BigDecimal(2500.0 * 2), new Integer(2), new Date()); | |
a3.setPromociones(promoIntList); | |
a3.setPromocionesDisponibles(promocionesMap); | |
// Articulo 4 | |
Integer a4ID = new Integer(4); | |
Articulo a4 = new Articulo(a4ID, "Leonardo", "Portavela con Base", | |
"/img/item01.jpg", Articulo.Tipo.TIENDA, new BigDecimal(569.00), | |
new BigDecimal(569.00 * 3), new Integer(3), new Date()); | |
a4.setPromociones(promoIntList); | |
a4.setPromocionesDisponibles(promocionesMap); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<c:if test="${articulo.promocionSeleccionada != null}"> | |
<c:forEach items="${articulo.promocionSeleccionada" var="promocion"> | |
<c:out value="${promocion}"></c:out> | |
</c:forEach> | |
</c:if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment