FIXES BUG #06952
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@51362 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a42c875540
commit
47f48889ff
|
@ -0,0 +1,102 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
import com.rjconsultores.ventaboletos.entidad.InstiFinanceira;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaContaBancariaService;
|
||||
import com.rjconsultores.ventaboletos.service.InstiFinanceiraService;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
|
||||
@Controller("editarContaBancariaEmpresaController")
|
||||
@Scope("prototype")
|
||||
public class EditarContaBancariaEmpresaController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static Logger log = Logger.getLogger(EditarContaBancariaEmpresaController.class);
|
||||
|
||||
@Autowired
|
||||
private InstiFinanceiraService instFinanceiraService;
|
||||
@Autowired
|
||||
private EmpresaContaBancariaService empresaContaBancariaService;
|
||||
|
||||
|
||||
|
||||
private EmpresaContaBancaria empresaContaBancaria;
|
||||
private MyListbox empresaContaBancariaList;
|
||||
private List<InstiFinanceira> lsBanco;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
empresaContaBancaria = (EmpresaContaBancaria) Executions.getCurrent().getArg().get("empresaContaBancaria");
|
||||
empresaContaBancariaList = (MyListbox) Executions.getCurrent().getArg().get("empresaContaBancariaList");
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
lsBanco = instFinanceiraService.obtenerTodos();
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||
|
||||
try {
|
||||
empresaContaBancariaService.suscribirActualizacion(empresaContaBancaria);
|
||||
empresaContaBancariaList.updateItem(empresaContaBancaria);
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarEmpresaController.contaBancaria.MSG.suscribirOK"),
|
||||
Labels.getLabel("editarEmpresaController.contaBancaria.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
||||
closeWindow();
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("editarEmpresaController: " + ex);
|
||||
|
||||
Messagebox.show(Labels.getLabel(ex.getMessage()),
|
||||
Labels.getLabel("editarEmpresaController.contaBancaria.window.title"), Messagebox.OK, Messagebox.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public InstiFinanceiraService getInstFinanceiraService() {
|
||||
return instFinanceiraService;
|
||||
}
|
||||
|
||||
public void setInstFinanceiraService(InstiFinanceiraService instFinanceiraService) {
|
||||
this.instFinanceiraService = instFinanceiraService;
|
||||
}
|
||||
|
||||
public EmpresaContaBancaria getEmpresaContaBancaria() {
|
||||
return empresaContaBancaria;
|
||||
}
|
||||
|
||||
public void setEmpresaContaBancaria(EmpresaContaBancaria empresaContaBancaria) {
|
||||
this.empresaContaBancaria = empresaContaBancaria;
|
||||
}
|
||||
|
||||
public MyListbox getEmpresaContaBancariaList() {
|
||||
return empresaContaBancariaList;
|
||||
}
|
||||
|
||||
public void setEmpresaContaBancariaList(MyListbox empresaContaBancariaList) {
|
||||
this.empresaContaBancariaList = empresaContaBancariaList;
|
||||
}
|
||||
|
||||
public List<InstiFinanceira> getLsBanco() {
|
||||
return lsBanco;
|
||||
}
|
||||
|
||||
public void setLsBanco(List<InstiFinanceira> lsBanco) {
|
||||
this.lsBanco = lsBanco;
|
||||
}
|
||||
}
|
|
@ -103,7 +103,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
|
||||
private List<InstiFinanceira> lsBanco;
|
||||
private Combobox cmbBanco;
|
||||
private Textbox txtNomeBanco;
|
||||
private MyListbox empresaContaBancariaList;
|
||||
private Textbox txtNumConta;
|
||||
private Textbox txtNumAgencia;
|
||||
|
@ -180,6 +179,14 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
|
||||
lsEmpresaContaBancaria = new ArrayList<EmpresaContaBancaria>();
|
||||
empresaContaBancariaList.setItemRenderer(new RenderEmpresaContaBancaria());
|
||||
empresaContaBancariaList.addEventListener("onDoubleClick", new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
EmpresaContaBancaria empCB = (EmpresaContaBancaria) empresaContaBancariaList.getSelected();
|
||||
editContaBancaria(empCB);
|
||||
}
|
||||
});
|
||||
|
||||
empresaImpostoList.setItemRenderer(new RenderEmpresaImposto());
|
||||
empresaImpostoList.addEventListener("onDoubleClick", new EventListener() {
|
||||
|
@ -250,6 +257,20 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void editContaBancaria(EmpresaContaBancaria empCB) {
|
||||
if (empCB == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map args = new HashMap();
|
||||
args.put("empresaContaBancaria", empCB);
|
||||
args.put("empresaContaBancariaList", empresaContaBancariaList);
|
||||
|
||||
openWindow("/gui/catalogos/editarContaBancariaEmpresa.zul",
|
||||
Labels.getLabel("editarEmpresaController.contaBancaria.window.title"), args, MODAL);
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||
txtNome.getValue();
|
||||
cmbIndTipo.getValue();
|
||||
|
@ -487,10 +508,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
|
||||
public void onSelect$cmbBanco() {
|
||||
InstiFinanceira banco = (InstiFinanceira) cmbBanco.getSelectedItem().getValue();
|
||||
txtNomeBanco.setValue(banco.getNome());
|
||||
}
|
||||
|
||||
public List<InstiFinanceira> getLsBanco() {
|
||||
return lsBanco;
|
||||
|
@ -508,14 +525,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
this.cmbBanco = cmbBanco;
|
||||
}
|
||||
|
||||
public Textbox getTxtNomeBanco() {
|
||||
return txtNomeBanco;
|
||||
}
|
||||
|
||||
public void setTxtNomeBanco(Textbox txtNomeBanco) {
|
||||
this.txtNomeBanco = txtNomeBanco;
|
||||
}
|
||||
|
||||
public MyListbox getEmpresaContaBancariaList() {
|
||||
return empresaContaBancariaList;
|
||||
}
|
||||
|
@ -676,7 +685,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
cmbBanco.setSelectedItem(null);
|
||||
txtNumAgencia.setValue(null);
|
||||
txtNumConta.setValue(null);
|
||||
txtNomeBanco.setValue(null);
|
||||
}
|
||||
|
||||
private boolean infoContaBancariaValida() throws InterruptedException {
|
||||
|
|
|
@ -805,6 +805,8 @@ editarEmpresaController.contaBancaria.instiFinanceira = Instituición Financiera
|
|||
editarEmpresaController.contaBancaria.conta = Número de la Cuenta
|
||||
editarEmpresaController.contaBancaria.agencia = Número de la Sucursal Bancária
|
||||
editarEmpresaController.contaBancaria.numIntegracion = Número de Integracion
|
||||
editarEmpresaController.contaBancaria.MSG.suscribirOK = Cuenta Bancária se registró exitosamente
|
||||
editarEmpresaController.contaBancaria.window.title = Cuenta Bancária
|
||||
editarEmpresaController.MSG.informeBanco = Informe el Banco
|
||||
editarEmpresaController.MSG.informeConta = Informe la Cuenta
|
||||
editarEmpresaController.MSG.informeAgencia = Informe la Sucursal Bancária
|
||||
|
|
|
@ -844,6 +844,8 @@ editarEmpresaController.contaBancaria.instiFinanceira = Instituição Financeira
|
|||
editarEmpresaController.contaBancaria.conta = Número da Conta
|
||||
editarEmpresaController.contaBancaria.agencia = Número da Agência
|
||||
editarEmpresaController.contaBancaria.numIntegracion = Número de Integração
|
||||
editarEmpresaController.contaBancaria.MSG.suscribirOK = Conta Bancária foi registrada com sucesso
|
||||
editarEmpresaController.contaBancaria.window.title = Conta Bancária
|
||||
editarEmpresaController.MSG.informeBanco = Informe o Banco
|
||||
editarEmpresaController.MSG.informeConta = Informe a Conta
|
||||
editarEmpresaController.MSG.informeAgencia = Informe a Agência
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winEditarContaBancariaEmpresa"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winEditarContaBancariaEmpresa" border="normal"
|
||||
apply="${editarContaBancariaEmpresaController}" width="500px"
|
||||
contentStyle="overflow:auto" xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
title="${c:l('editarEmpresaController.window.title')}">
|
||||
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<button id="btnSalvar" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarEmpresaController.btnSalvar.tooltiptext')}" />
|
||||
<button id="btnFechar" height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winEditarContaBancariaEmpresa.detach()"
|
||||
tooltiptext="${c:l('editarEmpresaController.btnFechar.tooltiptext')}" />
|
||||
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="80%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.contaBancaria.instiFinanceira')}" />
|
||||
|
||||
<combobox id="cmbBanco"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
width="98%" mold="rounded" buttonVisible="true"
|
||||
model="@{winEditarContaBancariaEmpresa$composer.lsBanco}"
|
||||
selectedItem="@{winEditarContaBancariaEmpresa$composer.empresaContaBancaria.instituicaoFinandeira}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.contaBancaria.conta')}"/>
|
||||
<textbox id="txtNumConta" maxlength="12" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||
value="@{winEditarContaBancariaEmpresa$composer.empresaContaBancaria.numConta}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.contaBancaria.agencia')}"/>
|
||||
<textbox id="txtNumAgencia" maxlength="12" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||
value="@{winEditarContaBancariaEmpresa$composer.empresaContaBancaria.numAgencia}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.contaBancaria.numIntegracion')}"/>
|
||||
<textbox id="txtNumIntegracion" maxlength="10" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||
value="@{winEditarContaBancariaEmpresa$composer.empresaContaBancaria.numIntegracion}" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</window>
|
||||
</zk>
|
|
@ -337,21 +337,10 @@
|
|||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.contaBancaria.instiFinanceira')}" />
|
||||
<hbox>
|
||||
<h:table border="none">
|
||||
<h:tr>
|
||||
<h:td>
|
||||
<combobox id="cmbBanco"
|
||||
<combobox id="cmbBanco"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
width="60%" mold="rounded" buttonVisible="true"
|
||||
width="98%" mold="rounded" buttonVisible="true"
|
||||
model="@{winEditarEmpresa$composer.lsBanco}" />
|
||||
</h:td>
|
||||
<h:td>
|
||||
<textbox id="txtNomeBanco" width="215px" disabled="true" />
|
||||
</h:td>
|
||||
</h:tr>
|
||||
</h:table>
|
||||
</hbox>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.contaBancaria.conta')}"/>
|
||||
|
|
Loading…
Reference in New Issue