Trazer a Categoria Normal como default no pricing

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@22419 d1611594-4594-4d17-8e1d-87c2c4800839
master
rafael 2012-11-05 18:51:55 +00:00
parent d63b36f838
commit 31ff27d07b
2 changed files with 33 additions and 11 deletions

View File

@ -4,6 +4,7 @@
*/
package com.rjconsultores.ventaboletos.web.gui.controladores.pricing;
import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Marca;
@ -27,11 +28,13 @@ import com.rjconsultores.ventaboletos.entidad.PricingVigencia;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.MarcaService;
import com.rjconsultores.ventaboletos.service.ParadaService;
import com.rjconsultores.ventaboletos.service.PricingAnticipacionService;
import com.rjconsultores.ventaboletos.service.PricingCategoriaService;
import com.rjconsultores.ventaboletos.service.PricingClaseService;
import com.rjconsultores.ventaboletos.service.PricingImporteService;
import com.rjconsultores.ventaboletos.service.PricingMarcaService;
@ -108,6 +111,8 @@ public class EditarPricingController extends MyGenericForwardComposer {
@Autowired
private PricingRutaService pricingRutaService;
@Autowired
private PricingCategoriaService pricingCategoriaService;
@Autowired
private PricingMercadoService pricingMercadoService;
@Autowired
private PricingImporteService pricingImporteService;
@ -128,6 +133,8 @@ public class EditarPricingController extends MyGenericForwardComposer {
@Autowired
private RutaService rutaService;
@Autowired
private CategoriaService categoriaService;
@Autowired
private ParadaService paradaService;
private Pricing pricing;
private MyListbox pricingList;
@ -269,14 +276,14 @@ public class EditarPricingController extends MyGenericForwardComposer {
//Categoria
pricingCategoriaList.setItemRenderer(new RenderPricingCategoria());
lsPricingCategoria = new ArrayList<PricingCategoria>();
pricingCategoriaList.addEventListener("onDoubleClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
PricingCategoria pCategoria = (PricingCategoria) pricingCategoriaList.getSelected();
verPricingCategoria(pCategoria);
}
});
// pricingCategoriaList.addEventListener("onDoubleClick", new EventListener() {
//
// @Override
// public void onEvent(Event event) throws Exception {
// PricingCategoria pCategoria = (PricingCategoria) pricingCategoriaList.getSelected();
// verPricingCategoria(pCategoria);
// }
// });
//Mercado
pricingMercadoList.setItemRenderer(new RenderPricingMercado());
@ -541,6 +548,21 @@ public class EditarPricingController extends MyGenericForwardComposer {
pricingRutaList.setData(lsPricingRuta);
pricingRutaService.suscribir(pr);
}
//Tipo Pasajero - Categoria
PricingCategoria pc = new PricingCategoria();
Categoria categoria = categoriaService.obtenerID(1);
pricingCategoriaList.setDisabled(Boolean.TRUE);
if (categoria != null) {
pc.setCategoria(categoria);
pc.setPricing(pricing);
pc.setActivo(Boolean.TRUE);
pc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
pc.setFecmodif(Calendar.getInstance().getTime());
lsPricingCategoria.add(pc);
pricingCategoriaList.setData(lsPricingCategoria);
pricingCategoriaService.suscribir(pc);
}
//Mercado
PricingMercado pme = new PricingMercado();
Parada p1 = paradaService.obtenerID(-1);

View File

@ -309,12 +309,12 @@
<hbox spacing="5px" style="padding:1px" align="right">
<label value="${c:l('editarPricingController.categoria.value')}:" />
<button id="btnNovoCategoria" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('editarPricingController.btnNovoCategoria.tooltiptext')}" />
tooltiptext="${c:l('editarPricingController.btnNovoCategoria.tooltiptext')}" disabled="true"/>
<button id="btnApagarCategoria" height="6"
image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('editarPricingController.btnApagarPricing.tooltiptext')}"/>
tooltiptext="${c:l('editarPricingController.btnApagarPricing.tooltiptext')}" disabled="true"/>
<button id="btnModificarCategoria"
label="${c:l('editarPricingController.btnModificar.value')}"/>
label="${c:l('editarPricingController.btnModificar.value')}" disabled="true"/>
</hbox>
</toolbar>
<listbox id="pricingCategoriaList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"