carla 2012-11-01 16:55:02 +00:00
parent 0a8d6b1668
commit 46eb6a9c54
5 changed files with 167 additions and 148 deletions

View File

@ -875,64 +875,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
} }
// public PtovtaTitular preencherTitular(){
//
// txtTitularNome.getValue();
// txtTitularCpf.getValue();
// txtTitularRg.getValue();
// txtTitularEmissor.getValue();
//
// PtovtaTitular titular = new PtovtaTitular();
// titular.setNome(txtTitularNome.getValue());
// titular.setCpf(txtTitularCpf.getValue());
// titular.setRg(txtTitularRg.getValue());
// titular.setOrgaoemissor(txtTitularEmissor.getValue());
// if (img.getContent() != null) {
// titular.setImagem(img.getContent().getByteData());
// }
//
//
// titular.setActivo(Boolean.TRUE);
// titular.setFecmodif(Calendar.getInstance().getTime());
// titular.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
//
// return titular;
//
// }
//
//
// public PtovtaAgenciaBancaria preencherAgenciaBancaria() {
// cmbBanco.getValue();
// cmbPessoa.getValue();
// txtNumAg.getValue();
//
// txtConta.getValue();
// txtDigito.getValue();
// txtBilhetes.getValue();
// txtCarga.getValue();
//
//
// PtovtaAgenciaBancaria agencia = new PtovtaAgenciaBancaria();
// if (cmbBanco.getSelectedItem() != null){
// agencia.setBancoId((PtovtaBanco) cmbBanco.getSelectedItem().getValue());
// }
//
// if (cmbPessoa.getSelectedItem() != null){
// agencia.setPessoa((String) cmbPessoa.getSelectedItem().getValue());
// }
// if (cmbTipoConta.getSelectedItem() != null){
// agencia.setTipo((String) cmbTipoConta.getSelectedItem().getValue());
// }
//
// agencia.setActivo(Boolean.TRUE);
// agencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
// agencia.setFecmodif(Calendar.getInstance().getTime());
//
// return agencia;
//
//
// }
public void onClick$btnSalvarAntecipa()throws InterruptedException{ public void onClick$btnSalvarAntecipa()throws InterruptedException{
dateAntecipData.getValue(); dateAntecipData.getValue();
txtAntecipRetem.getValue(); txtAntecipRetem.getValue();

View File

@ -17,9 +17,11 @@ import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Button; import org.zkoss.zul.Button;
import org.zkoss.zul.Intbox;
import org.zkoss.zul.Textbox; import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Estacion; import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.EstacionSitef;
import com.rjconsultores.ventaboletos.exception.BusinessException; import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.EstacionService; import com.rjconsultores.ventaboletos.service.EstacionService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -44,6 +46,9 @@ public class EditarEstacionController extends MyGenericForwardComposer {
private Textbox txtDescMac; private Textbox txtDescMac;
private Estacion estacion; private Estacion estacion;
private MyComboboxPuntoVenta cmbPuntoVenta; private MyComboboxPuntoVenta cmbPuntoVenta;
private Intbox txtNumEmpresa;
private Intbox txtNumFilial;
private Intbox txtNumPdv;
private static Logger log = Logger.getLogger(EditarEstacionController.class); private static Logger log = Logger.getLogger(EditarEstacionController.class);
public Estacion getEstacion() { public Estacion getEstacion() {
@ -77,14 +82,22 @@ public class EditarEstacionController extends MyGenericForwardComposer {
txtDescMac.setText(descMac.toUpperCase()); txtDescMac.setText(descMac.toUpperCase());
} }
if(estacion.getEstacionSitefId() == null){
estacion.setEstacionSitefId(new EstacionSitef());
}
} }
txtDescEstacion.focus(); txtDescEstacion.focus();
} }
public void onClick$btnSalvar(Event ev) throws InterruptedException { public void onClick$btnSalvar(Event ev) throws InterruptedException {
Boolean salvar = false;
cmbPuntoVenta.getValue(true); cmbPuntoVenta.getValue(true);
txtNumEmpresa.getValue();
txtNumFilial.getValue();
txtNumPdv.getValue();
String descMac = txtDescMac.getText(); String descMac = txtDescMac.getText();
@ -93,6 +106,23 @@ public class EditarEstacionController extends MyGenericForwardComposer {
estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
estacion.setDescmac(estacionService.getDecimalMAC(descMac).toString()); estacion.setDescmac(estacionService.getDecimalMAC(descMac).toString());
if((txtNumEmpresa.getValue() == null)&& (txtNumFilial.getValue()== null)&&(txtNumPdv.getValue()== null)){
salvar = true;
estacion.setEstacionSitefId(null);
}else{
if((!(txtNumEmpresa.getValue()== null))&& (!(txtNumFilial.getValue()== null))&&(!(txtNumPdv.getValue()== null))){
salvar = true;
estacion.getEstacionSitefId().setActivo(Boolean.TRUE);
estacion.getEstacionSitefId().setFecmodif(Calendar.getInstance().getTime());
estacion.getEstacionSitefId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
}else{
salvar = false;
}
}
if(salvar){
try { try {
estacionService.suscribirActualizar(estacion); estacionService.suscribirActualizar(estacion);
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"), Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"),
@ -106,6 +136,11 @@ public class EditarEstacionController extends MyGenericForwardComposer {
Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"), Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION); Messagebox.OK, Messagebox.EXCLAMATION);
} }
}else{
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.sitef"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} }
public void onClick$btnApagar(Event ev) { public void onClick$btnApagar(Event ev) {

View File

@ -93,6 +93,7 @@
<value>com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia <value>com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia
</value> </value>
<value>com.rjconsultores.ventaboletos.entidad.Estacion</value> <value>com.rjconsultores.ventaboletos.entidad.Estacion</value>
<value>com.rjconsultores.ventaboletos.entidad.EstacionSitef</value>
<value>com.rjconsultores.ventaboletos.entidad.Estado</value> <value>com.rjconsultores.ventaboletos.entidad.Estado</value>
<value>com.rjconsultores.ventaboletos.entidad.EsquemaAsiento</value> <value>com.rjconsultores.ventaboletos.entidad.EsquemaAsiento</value>
<value>com.rjconsultores.ventaboletos.entidad.EsquemaCorrida</value> <value>com.rjconsultores.ventaboletos.entidad.EsquemaCorrida</value>

View File

@ -2576,6 +2576,13 @@ editarEstacionController.MSG.suscribirOK = Estação Registrada com Sucesso.
editarEstacionController.MSG.borrarPergunta = Eliminar Estação? editarEstacionController.MSG.borrarPergunta = Eliminar Estação?
editarEstacionController.MSG.borrarOK = Estação Excluida com Sucesso. editarEstacionController.MSG.borrarOK = Estação Excluida com Sucesso.
#Editar Estacion Sitef
editarEstacionController.tab.label.sitef = SiTef
editarEstacionController.MSG.sitef = Todos os campos da aba SiTef devem ser preenchidos
editarEstacionController.lbNumEmpresa.value = Código da Empresa
editarEstacionController.lbNumFilial.value = Código da Filial
editarEstacionController.lbNumPdv.value = Númedo PDV
# Pesquisa Exceção Ida e Volta # Pesquisa Exceção Ida e Volta
busquedaExceptionRedondoController.window.title = Exceção Viagem Ida e Volta busquedaExceptionRedondoController.window.title = Exceção Viagem Ida e Volta
busquedaExceptionRedondoController.btnRefresh.tooltiptext = Atualizar busquedaExceptionRedondoController.btnRefresh.tooltiptext = Atualizar

View File

@ -23,7 +23,13 @@
tooltiptext="${c:l('editarEstacionController.btnFechar.tooltiptext')}" /> tooltiptext="${c:l('editarEstacionController.btnFechar.tooltiptext')}" />
</hbox> </hbox>
</toolbar> </toolbar>
<tabbox>
<tabs width="200px">
<tab label="${c:l('editarEstacionController.window.title')}" />
<tab label="${c:l('editarEstacionController.tab.label.sitef')}" />
</tabs>
<tabpanels>
<tabpanel>
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="30%" /> <column width="30%" />
@ -101,5 +107,33 @@
</rows> </rows>
</grid> </grid>
</tabpanel>
<tabpanel>
<grid fixedLayout="true">
<columns>
<column width="30%" />
<column width="70%" />
</columns>
<rows>
<row>
<label value="${c:l('editarEstacionController.lbNumEmpresa.value')}" />
<intbox id="txtNumEmpresa" width="90%" maxlength="4"
value="@{winEditarEstacion$composer.estacion.estacionSitefId.numempresa}"/>
</row>
<row>
<label value="${c:l('editarEstacionController.lbNumFilial.value')}" />
<intbox id="txtNumFilial" width="90%" maxlength="4"
value="@{winEditarEstacion$composer.estacion.estacionSitefId.numfilial}"/>
</row>
<row>
<label value="${c:l('editarEstacionController.lbNumPdv.value')}" />
<intbox id="txtNumPdv" width="90%" maxlength="3"
value="@{winEditarEstacion$composer.estacion.estacionSitefId.numpdv}"/>
</row>
</rows>
</grid>
</tabpanel>
</tabpanels>
</tabbox>
</window> </window>
</zk> </zk>