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); 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{ public void onClick$btnSalvarAntecipa()throws InterruptedException{
dateAntecipData.getValue(); 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.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();
@ -92,18 +105,40 @@ public class EditarEstacionController extends MyGenericForwardComposer {
estacion.setFecmodif(Calendar.getInstance().getTime()); estacion.setFecmodif(Calendar.getInstance().getTime());
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{
try { if((!(txtNumEmpresa.getValue()== null))&& (!(txtNumFilial.getValue()== null))&&(!(txtNumPdv.getValue()== null))){
estacionService.suscribirActualizar(estacion); salvar = true;
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"), 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>
<grid fixedLayout="true"> <tabs width="200px">
<columns> <tab label="${c:l('editarEstacionController.window.title')}" />
<column width="30%" /> <tab label="${c:l('editarEstacionController.tab.label.sitef')}" />
<column width="70%" /> </tabs>
</columns> <tabpanels>
<rows> <tabpanel>
<row> <grid fixedLayout="true">
<label <columns>
value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" /> <column width="30%" />
<textbox id="txtDescEstacion" width="90%" rows="3" <column width="70%" />
constraint="no empty" maxlength="60" </columns>
value="@{winEditarEstacion$composer.estacion.descestacion}" <rows>
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" /> <row>
</row> <label
<row> value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" />
<label <textbox id="txtDescEstacion" width="90%" rows="3"
value="${c:l('busquedaEstacionController.lhDescMac.label')}" /> constraint="no empty" maxlength="60"
<textbox id="txtDescMac" width="90%" value="@{winEditarEstacion$composer.estacion.descestacion}"
constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
maxlength="17" </row>
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" /> <row>
</row> <label
<row> value="${c:l('busquedaEstacionController.lhDescMac.label')}" />
<label <textbox id="txtDescMac" width="90%"
value="${c:l('busquedaEstacionController.lhNumCaja.label')}" /> constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}"
<longbox id="txtNumCaja" width="90%" maxlength="17"
constraint="no empty" maxlength="10" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
value="@{winEditarEstacion$composer.estacion.numcaja}" /> </row>
</row> <row>
<row> <label
<label value="${c:l('busquedaEstacionController.lhNumCaja.label')}" />
value="${c:l('busquedaEstacionController.nomeImpressora.label')}" /> <longbox id="txtNumCaja" width="90%"
<textbox id="txtNomImpressoara" width="90%" constraint="no empty" maxlength="10"
maxlength="20" value="@{winEditarEstacion$composer.estacion.numcaja}" />
value="@{winEditarEstacion$composer.estacion.nomeImpressora}" /> </row>
</row> <row>
<row> <label
<label value="${c:l('busquedaEstacionController.nomeImpressora.label')}" />
value="${c:l('busquedaEstacionController.nomeArquivoLayout.label')}" /> <textbox id="txtNomImpressoara" width="90%"
<textbox id="txtNomeArquivoLayout" width="90%" maxlength="20"
maxlength="20" value="@{winEditarEstacion$composer.estacion.nomeImpressora}" />
value="@{winEditarEstacion$composer.estacion.nomeArquivoLayout}" /> </row>
</row> <row>
<row> <label
<label value="${c:l('busquedaEstacionController.nomeArquivoLayout.label')}" />
value="${c:l('busquedaEstacionController.nomeImpressoraRelatorio.label')}" /> <textbox id="txtNomeArquivoLayout" width="90%"
<textbox id="txtNomImpressoaraRelatorio" width="90%" maxlength="20"
maxlength="20" value="@{winEditarEstacion$composer.estacion.nomeArquivoLayout}" />
value="@{winEditarEstacion$composer.estacion.nomeImpressoraRelatorio}" /> </row>
</row> <row>
<row> <label
<label value="${c:l('busquedaEstacionController.nomeImpressoraRelatorio.label')}" />
value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}" /> <textbox id="txtNomImpressoaraRelatorio" width="90%"
<combobox id="cmbPuntoVenta" constraint="no empty" maxlength="20"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta" value="@{winEditarEstacion$composer.estacion.nomeImpressoraRelatorio}" />
initialValue="@{winEditarEstacion$composer.estacion.puntoVenta}" </row>
selectedItem="@{winEditarEstacion$composer.estacion.puntoVenta}" <row>
mold="rounded" buttonVisible="true" width="90%" /> <label
</row> value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}" />
<row> <combobox id="cmbPuntoVenta" constraint="no empty"
<label use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
value="${c:l('editarEstacionController.conexion')}" /> initialValue="@{winEditarEstacion$composer.estacion.puntoVenta}"
<combobox id="cmbConexion" width="90%" selectedItem="@{winEditarEstacion$composer.estacion.puntoVenta}"
mold="rounded" buttonVisible="true" mold="rounded" buttonVisible="true" width="90%" />
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" </row>
selectedItem="@{winEditarEstacion$composer.estacion.conexionBancaria}"> <row>
<!-- comboitem value="B" label="${c:l('editarEstacionController.IndTipo.1')}" /--> <label
<comboitem value="M" value="${c:l('editarEstacionController.conexion')}" />
label="${c:l('editarEstacionController.IndTipo.2')}" /> <combobox id="cmbConexion" width="90%"
<!-- comboitem value="S" label="${c:l('editarEstacionController.IndTipo.3')}" /--> mold="rounded" buttonVisible="true"
<comboitem value="E" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
label="${c:l('editarEstacionController.IndTipo.4')}" /> selectedItem="@{winEditarEstacion$composer.estacion.conexionBancaria}">
</combobox> <!-- comboitem value="B" label="${c:l('editarEstacionController.IndTipo.1')}" /-->
</row> <comboitem value="M"
label="${c:l('editarEstacionController.IndTipo.2')}" />
</rows> <!-- comboitem value="S" label="${c:l('editarEstacionController.IndTipo.3')}" /-->
</grid> <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> </window>
</zk> </zk>