git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@25437 d1611594-4594-4d17-8e1d-87c2c4800839
parent
76d3d750d9
commit
8f879c6254
|
@ -233,19 +233,34 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$poltronaOcupada(){
|
public void onClick$poltronaOcupada(){
|
||||||
cmbDestino.setConstraint("no empty");
|
|
||||||
cmbDestino.setDisabled(false);
|
cmbDestino.setDisabled(false);
|
||||||
txtMotivo.setDisabled(false);
|
txtMotivo.setDisabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hayAsientosValidos(){
|
||||||
|
String asientos[] = txtAsiento.getValue().split(",");
|
||||||
|
|
||||||
|
if (asientos.length == 0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
boolean asientoValido = false;
|
||||||
|
|
||||||
|
for(int i = 0 ; i<=asientos.length;i++){
|
||||||
|
try{
|
||||||
|
Integer.parseInt(asientos[i]);
|
||||||
|
asientoValido = true;
|
||||||
|
}catch(Throwable e){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return asientoValido;
|
||||||
|
}
|
||||||
|
|
||||||
public void enviarPeticionAsientos(String tipoPeticion) throws InterruptedException{
|
public void enviarPeticionAsientos(String tipoPeticion) throws InterruptedException{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
cmbOrigen.getValue();
|
|
||||||
cmbDestino.getValue();
|
|
||||||
boolean salvo = true;
|
boolean salvo = true;
|
||||||
|
|
||||||
txtAsiento.setText((txtAsiento.getValue().endsWith(",")) ? txtAsiento.getValue() : txtAsiento.getValue().concat(","));
|
txtAsiento.setText((txtAsiento.getValue().endsWith(",")) ? txtAsiento.getValue() : txtAsiento.getValue().concat(","));
|
||||||
|
|
||||||
List<String> todosAsientos = new ArrayList<String>();
|
List<String> todosAsientos = new ArrayList<String>();
|
||||||
|
@ -298,26 +313,11 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
||||||
es.setFecmodif(Calendar.getInstance().getTime());
|
es.setFecmodif(Calendar.getInstance().getTime());
|
||||||
es.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
es.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
es.setNumasiento(asiento);
|
es.setNumasiento(asiento);
|
||||||
|
|
||||||
if(tipoPeticion.equals("ceder")){
|
if(tipoPeticion.equals("ceder")){
|
||||||
es.setIndvendible(Boolean.TRUE);
|
es.setIndvendible(Boolean.TRUE);
|
||||||
es.setParada((Parada) cmbOrigen.getSelectedItem().getValue());
|
es.setParada((Parada) cmbOrigen.getSelectedItem().getValue());
|
||||||
}else if (tipoPeticion.equals("bloqueo")){
|
}else if (tipoPeticion.equals("bloqueo")){
|
||||||
if(txtMotivo.getText().trim().equals("")){
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.motivo"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
|
||||||
txtMotivo.setFocus(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(cmbOrigen.getSelectedIndex()>=cmbDestino.getSelectedIndex()){
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.tramo"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
|
||||||
|
|
||||||
cmbOrigen.setFocus(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
es.setIndvendible(Boolean.FALSE);
|
es.setIndvendible(Boolean.FALSE);
|
||||||
es.setParada((Parada) cmbOrigen.getSelectedItem().getValue());
|
es.setParada((Parada) cmbOrigen.getSelectedItem().getValue());
|
||||||
es.setDestino((Parada)cmbDestino.getSelectedItem().getValue());
|
es.setDestino((Parada)cmbDestino.getSelectedItem().getValue());
|
||||||
|
@ -332,7 +332,7 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
||||||
lsAsientos.add(es);
|
lsAsientos.add(es);
|
||||||
} else {
|
} else {
|
||||||
salvo = false;
|
salvo = false;
|
||||||
Messagebox.show("Asiento " + asiento + " existe en el Registro.",
|
Messagebox.show("A poltrona " + asiento + " já está configurada.",
|
||||||
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
salvo = false;
|
salvo = false;
|
||||||
Messagebox.show("Asiento " + asiento + " no vendible.",
|
Messagebox.show("A poltrona " + asiento + " não está disponível para venda.",
|
||||||
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
@ -356,9 +356,6 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
||||||
colorirAsientos(null);
|
colorirAsientos(null);
|
||||||
txtAsiento.setValue("");
|
txtAsiento.setValue("");
|
||||||
txtMotivo.setText("");
|
txtMotivo.setText("");
|
||||||
|
|
||||||
//closeWindow();
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error("Erro asiento:" + ex);
|
log.error("Erro asiento:" + ex);
|
||||||
txtAsiento.setValue("");
|
txtAsiento.setValue("");
|
||||||
|
@ -372,12 +369,55 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
|
||||||
public void onClick$btnCeder(Event ev) throws InterruptedException {
|
public void onClick$btnCeder(Event ev) throws InterruptedException {
|
||||||
|
if (!hayAsientosValidos()){
|
||||||
|
txtAsiento.setValue("");
|
||||||
|
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.invalido"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmbOrigen.getSelectedItem() == null){
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.origenObligatoria"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
cmbOrigen.setFocus(true);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(poltronaOcupada.isSelected()){
|
if(poltronaOcupada.isSelected()){
|
||||||
|
if (cmbDestino.getSelectedItem() == null){
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.destinoObligatoria"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
cmbDestino.setFocus(true);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(txtMotivo.getText().trim().equals("")){
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.motivo"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
txtMotivo.setFocus(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cmbOrigen.getSelectedIndex()>=cmbDestino.getSelectedIndex()){
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.tramo"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
cmbOrigen.setFocus(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
enviarPeticionAsientos("bloqueo");
|
enviarPeticionAsientos("bloqueo");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(poltronaExclusiva.isSelected()){
|
if(poltronaExclusiva.isSelected()){
|
||||||
enviarPeticionAsientos("ceder");
|
enviarPeticionAsientos("ceder");
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# <controler>. <id>. <propiedade> = XXX
|
# <controler>. <id>. <propiedade> = XXX
|
||||||
|
|
||||||
#Versao do VentaBoleto:
|
#Versao do VentaBoleto:
|
||||||
versao = ADM_20130328_1RC134
|
versao = ADM_20130329_1RC135
|
||||||
|
|
||||||
# MSG Defaut:
|
# MSG Defaut:
|
||||||
MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100
|
MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100
|
||||||
|
@ -1340,6 +1340,8 @@ editarConfiguracionCorridaAsientoController.MSG.help = (Ej: 1,2,3,4 o 1-4)
|
||||||
editarConfiguracionCorridaAsientoController.MSG.invalido = Poltrona inválida
|
editarConfiguracionCorridaAsientoController.MSG.invalido = Poltrona inválida
|
||||||
editarConfiguracionCorridaAsientoController.MSG.motivo = Necessário informar o motivo
|
editarConfiguracionCorridaAsientoController.MSG.motivo = Necessário informar o motivo
|
||||||
editarConfiguracionCorridaAsientoController.MSG.tramo = Não é permitido bloqueo neste trecho
|
editarConfiguracionCorridaAsientoController.MSG.tramo = Não é permitido bloqueo neste trecho
|
||||||
|
editarConfiguracionCorridaAsientoController.MSG.origenObligatoria = Informe a Origem
|
||||||
|
editarConfiguracionCorridaAsientoController.MSG.destinoObligatoria = Informe a Destino
|
||||||
|
|
||||||
# Buesqueda de Tarifas Mínimas
|
# Buesqueda de Tarifas Mínimas
|
||||||
busquedaTarifasMinimasController.window.title = Tarifas Mínimas
|
busquedaTarifasMinimasController.window.title = Tarifas Mínimas
|
||||||
|
|
|
@ -210,7 +210,7 @@
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<label value="${c:l('editarConfiguracionCorridaAsientoController.lbOrigem.value')}"/>
|
<label value="${c:l('editarConfiguracionCorridaAsientoController.lbOrigem.value')}"/>
|
||||||
<combobox id="cmbOrigen" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" constraint="no empty"
|
<combobox id="cmbOrigen" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
mold="rounded" buttonVisible="true" width="300px"
|
mold="rounded" buttonVisible="true" width="300px"
|
||||||
model="@{winEditarCorridaAsiento$composer.lsOrigen}"/>
|
model="@{winEditarCorridaAsiento$composer.lsOrigen}"/>
|
||||||
</row>
|
</row>
|
||||||
|
|
Loading…
Reference in New Issue