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,17 +106,39 @@ 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());
try {
estacionService.suscribirActualizar(estacion); if((txtNumEmpresa.getValue() == null)&& (txtNumFilial.getValue()== null)&&(txtNumPdv.getValue()== null)){
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"), 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 {
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"), 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); Messagebox.OK, Messagebox.EXCLAMATION);
} }
} }

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,83 +23,117 @@
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">
<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>
<grid fixedLayout="true"> </rows>
<columns> </grid>
<column width="30%" /> </tabpanel>
<column width="70%" /> <tabpanel>
</columns> <grid fixedLayout="true">
<rows> <columns>
<row> <column width="30%" />
<label <column width="70%" />
value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" /> </columns>
<textbox id="txtDescEstacion" width="90%" rows="3" <rows>
constraint="no empty" maxlength="60" <row>
value="@{winEditarEstacion$composer.estacion.descestacion}" <label value="${c:l('editarEstacionController.lbNumEmpresa.value')}" />
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" /> <intbox id="txtNumEmpresa" width="90%" maxlength="4"
</row> value="@{winEditarEstacion$composer.estacion.estacionSitefId.numempresa}"/>
<row> </row>
<label <row>
value="${c:l('busquedaEstacionController.lhDescMac.label')}" /> <label value="${c:l('editarEstacionController.lbNumFilial.value')}" />
<textbox id="txtDescMac" width="90%" <intbox id="txtNumFilial" width="90%" maxlength="4"
constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}" value="@{winEditarEstacion$composer.estacion.estacionSitefId.numfilial}"/>
maxlength="17" </row>
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" /> <row>
</row> <label value="${c:l('editarEstacionController.lbNumPdv.value')}" />
<row> <intbox id="txtNumPdv" width="90%" maxlength="3"
<label value="@{winEditarEstacion$composer.estacion.estacionSitefId.numpdv}"/>
value="${c:l('busquedaEstacionController.lhNumCaja.label')}" /> </row>
<longbox id="txtNumCaja" width="90%" </rows>
constraint="no empty" maxlength="10" </grid>
value="@{winEditarEstacion$composer.estacion.numcaja}" /> </tabpanel>
</row> </tabpanels>
<row> </tabbox>
<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>
</window> </window>
</zk> </zk>