ajuste (fixes bug 5729 )

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@38707 d1611594-4594-4d17-8e1d-87c2c4800839
master
lucas.taia 2014-10-17 19:39:00 +00:00
parent 6cbcaaf942
commit fad0f9219b
2 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,8 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -8,12 +11,13 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels; import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Combobox; import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem; import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Intbox; import org.zkoss.zul.Intbox;
import org.zkoss.zul.Messagebox; import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.Estado;
import com.rjconsultores.ventaboletos.service.CorridaService; import com.rjconsultores.ventaboletos.service.CorridaService;
@ -32,7 +36,7 @@ public class AtualizarCorridaFecHusoFecVeranoController extends MyGenericForward
@Autowired @Autowired
private CorridaService corridaService; private CorridaService corridaService;
private Datebox datInicial; private Textbox datInicial;
private Combobox cmbEstado; private Combobox cmbEstado;
private List<Estado> lsEstados; private List<Estado> lsEstados;
private Intbox ibxCorridaId; private Intbox ibxCorridaId;
@ -52,12 +56,13 @@ public class AtualizarCorridaFecHusoFecVeranoController extends MyGenericForward
this.lsEstados = lsEstados; this.lsEstados = lsEstados;
} }
public void onClick$btnAtualizarCorridas(Event ev) throws InterruptedException { public void onClick$btnAtualizarCorridas(Event ev) throws InterruptedException, WrongValueException, ParseException {
Comboitem cbiEstado = cmbEstado.getSelectedItem(); Comboitem cbiEstado = cmbEstado.getSelectedItem();
if (cbiEstado != null) { if (cbiEstado != null) {
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Estado estado = (Estado) cbiEstado.getValue(); Estado estado = (Estado) cbiEstado.getValue();
Date dataAPartirDe = datInicial.getValue(); Date dataAPartirDe = df.parse(datInicial.getValue());
Integer corridaId = ibxCorridaId.getValue(); Integer corridaId = ibxCorridaId.getValue();
Boolean sucesso = false; Boolean sucesso = false;
if (corridaId == null) { if (corridaId == null) {

View File

@ -12,13 +12,13 @@
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="25%" /> <column width="30%" />
<column width="75%" /> <column width="75%" />
</columns> </columns>
<rows> <rows>
<row spans="2,1"> <row spans="2,2">
<label <label
value="${c:l('atualizarCorridaFecHusoFecVeranoController.window.text')}" /> value="${c:l('atualizarCorridaFecHusoFecVeranoController.window.text')}" />
@ -26,8 +26,8 @@
<row> <row>
<label <label
value="* ${c:l('atualizarCorridaFecHusoFecVeranoController.label.datInicial')}" /> value="* ${c:l('atualizarCorridaFecHusoFecVeranoController.label.datInicial')}" />
<datebox id="datInicial" width="70%" mold="rounded" <textbox id="datInicial" width="30%" mold="rounded"
format="dd/MM/yyyy" lenient="false" constraint="no empty" constraint="/^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/: Digite uma data válida (dd/mm/aaaa)"
maxlength="10" /> maxlength="10" />
</row> </row>
<row> <row>