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

View File

@ -873,65 +873,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
throw UiException.Aide.wrap(ex);
}
}
// 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{
dateAntecipData.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.util.Clients;
import org.zkoss.zul.Button;
import org.zkoss.zul.Intbox;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.EstacionSitef;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.EstacionService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -44,6 +46,9 @@ public class EditarEstacionController extends MyGenericForwardComposer {
private Textbox txtDescMac;
private Estacion estacion;
private MyComboboxPuntoVenta cmbPuntoVenta;
private Intbox txtNumEmpresa;
private Intbox txtNumFilial;
private Intbox txtNumPdv;
private static Logger log = Logger.getLogger(EditarEstacionController.class);
public Estacion getEstacion() {
@ -77,14 +82,22 @@ public class EditarEstacionController extends MyGenericForwardComposer {
txtDescMac.setText(descMac.toUpperCase());
}
if(estacion.getEstacionSitefId() == null){
estacion.setEstacionSitefId(new EstacionSitef());
}
}
txtDescEstacion.focus();
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
Boolean salvar = false;
cmbPuntoVenta.getValue(true);
txtNumEmpresa.getValue();
txtNumFilial.getValue();
txtNumPdv.getValue();
String descMac = txtDescMac.getText();
@ -92,18 +105,40 @@ public class EditarEstacionController extends MyGenericForwardComposer {
estacion.setFecmodif(Calendar.getInstance().getTime());
estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
estacion.setDescmac(estacionService.getDecimalMAC(descMac).toString());
if((txtNumEmpresa.getValue() == null)&& (txtNumFilial.getValue()== null)&&(txtNumPdv.getValue()== null)){
salvar = true;
estacion.setEstacionSitefId(null);
}else{
try {
estacionService.suscribirActualizar(estacion);
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"),
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 {
estacionService.suscribirActualizar(estacion);
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
estacionList.updateItem(estacion);
closeWindow();
} catch (BusinessException e) {
Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
}else{
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.sitef"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
estacionList.updateItem(estacion);
closeWindow();
} catch (BusinessException e) {
Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
}

View File

@ -93,6 +93,7 @@
<value>com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia
</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.EsquemaAsiento</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.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
busquedaExceptionRedondoController.window.title = Exceção Viagem Ida e Volta
busquedaExceptionRedondoController.btnRefresh.tooltiptext = Atualizar

View File

@ -23,83 +23,117 @@
tooltiptext="${c:l('editarEstacionController.btnFechar.tooltiptext')}" />
</hbox>
</toolbar>
<grid fixedLayout="true">
<columns>
<column width="30%" />
<column width="70%" />
</columns>
<rows>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" />
<textbox id="txtDescEstacion" width="90%" rows="3"
constraint="no empty" maxlength="60"
value="@{winEditarEstacion$composer.estacion.descestacion}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescMac.label')}" />
<textbox id="txtDescMac" width="90%"
constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}"
maxlength="17"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhNumCaja.label')}" />
<longbox id="txtNumCaja" width="90%"
constraint="no empty" maxlength="10"
value="@{winEditarEstacion$composer.estacion.numcaja}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.nomeImpressora.label')}" />
<textbox id="txtNomImpressoara" width="90%"
maxlength="20"
value="@{winEditarEstacion$composer.estacion.nomeImpressora}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.nomeArquivoLayout.label')}" />
<textbox id="txtNomeArquivoLayout" width="90%"
maxlength="20"
value="@{winEditarEstacion$composer.estacion.nomeArquivoLayout}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.nomeImpressoraRelatorio.label')}" />
<textbox id="txtNomImpressoaraRelatorio" width="90%"
maxlength="20"
value="@{winEditarEstacion$composer.estacion.nomeImpressoraRelatorio}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}" />
<combobox id="cmbPuntoVenta" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
initialValue="@{winEditarEstacion$composer.estacion.puntoVenta}"
selectedItem="@{winEditarEstacion$composer.estacion.puntoVenta}"
mold="rounded" buttonVisible="true" width="90%" />
</row>
<row>
<label
value="${c:l('editarEstacionController.conexion')}" />
<combobox id="cmbConexion" width="90%"
mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
selectedItem="@{winEditarEstacion$composer.estacion.conexionBancaria}">
<!-- comboitem value="B" label="${c:l('editarEstacionController.IndTipo.1')}" /-->
<comboitem value="M"
label="${c:l('editarEstacionController.IndTipo.2')}" />
<!-- comboitem value="S" label="${c:l('editarEstacionController.IndTipo.3')}" /-->
<comboitem value="E"
label="${c:l('editarEstacionController.IndTipo.4')}" />
</combobox>
</row>
</rows>
</grid>
<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">
<columns>
<column width="30%" />
<column width="70%" />
</columns>
<rows>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" />
<textbox id="txtDescEstacion" width="90%" rows="3"
constraint="no empty" maxlength="60"
value="@{winEditarEstacion$composer.estacion.descestacion}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescMac.label')}" />
<textbox id="txtDescMac" width="90%"
constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}"
maxlength="17"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhNumCaja.label')}" />
<longbox id="txtNumCaja" width="90%"
constraint="no empty" maxlength="10"
value="@{winEditarEstacion$composer.estacion.numcaja}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.nomeImpressora.label')}" />
<textbox id="txtNomImpressoara" width="90%"
maxlength="20"
value="@{winEditarEstacion$composer.estacion.nomeImpressora}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.nomeArquivoLayout.label')}" />
<textbox id="txtNomeArquivoLayout" width="90%"
maxlength="20"
value="@{winEditarEstacion$composer.estacion.nomeArquivoLayout}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.nomeImpressoraRelatorio.label')}" />
<textbox id="txtNomImpressoaraRelatorio" width="90%"
maxlength="20"
value="@{winEditarEstacion$composer.estacion.nomeImpressoraRelatorio}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}" />
<combobox id="cmbPuntoVenta" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
initialValue="@{winEditarEstacion$composer.estacion.puntoVenta}"
selectedItem="@{winEditarEstacion$composer.estacion.puntoVenta}"
mold="rounded" buttonVisible="true" width="90%" />
</row>
<row>
<label
value="${c:l('editarEstacionController.conexion')}" />
<combobox id="cmbConexion" width="90%"
mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
selectedItem="@{winEditarEstacion$composer.estacion.conexionBancaria}">
<!-- comboitem value="B" label="${c:l('editarEstacionController.IndTipo.1')}" /-->
<comboitem value="M"
label="${c:l('editarEstacionController.IndTipo.2')}" />
<!-- comboitem value="S" label="${c:l('editarEstacionController.IndTipo.3')}" /-->
<comboitem value="E"
label="${c:l('editarEstacionController.IndTipo.4')}" />
</combobox>
</row>
</rows>
</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>
</zk>