Copiar e Colar Pricing
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@30729 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
740f2177d6
commit
83267fd0ef
|
@ -0,0 +1,90 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.pricing;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zhtml.Messagebox;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
||||
import com.rjconsultores.ventaboletos.service.PricingService;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
|
||||
@Controller("copiarPricingController")
|
||||
@Scope("prototype")
|
||||
public class CopiarPricingController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
private PricingService pricingService;
|
||||
|
||||
private Textbox nombrePricing;
|
||||
private Pricing pricing;
|
||||
private MyListbox pricingList;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
pricing = (Pricing) Executions.getCurrent().getArg().get("pricing");
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
}
|
||||
|
||||
public void onClick$btnSalvarCopia(Event ev) throws InterruptedException {
|
||||
if (!nombrePricing.getText().equals("") && nombrePricing.getText() != null) {
|
||||
|
||||
List<Pricing> lsPricing =
|
||||
pricingService.buscarPorNombre(nombrePricing.getText());
|
||||
|
||||
if (lsPricing.isEmpty()) {
|
||||
|
||||
Boolean resp = pricingService.clonarPricing(pricing.getPricingId(), nombrePricing.getText());
|
||||
|
||||
if (resp) {
|
||||
|
||||
closeWindow();
|
||||
Messagebox.show(
|
||||
Labels.getLabel("copiarPricingController.MSG.suscribirOK"),
|
||||
Labels.getLabel("copiarPricingController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("copiarPricingController.MSG.ERRO"),
|
||||
Labels.getLabel("copiarPricingController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("copiarPricingController.MSG.Registro.Existe"),
|
||||
Labels.getLabel("copiarPricingController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("copiarPricingController.MSG.sem.nome"),
|
||||
Labels.getLabel("copiarPricingController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClose$winCopiarPricing(Event ev) {
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
public MyListbox getPricingList() {
|
||||
return pricingList;
|
||||
}
|
||||
|
||||
public void setPricingList(MyListbox pricingList) {
|
||||
this.pricingList = pricingList;
|
||||
}
|
||||
}
|
|
@ -1243,6 +1243,17 @@ public class EditarPricingController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void onClick$btnCopiar(Event ev) throws InterruptedException {
|
||||
|
||||
Map args = new HashMap();
|
||||
args.put("pricing", pricing);
|
||||
|
||||
openWindow("/gui/pricing/copiarPricing.zul",
|
||||
Labels.getLabel("copiarPricingController.window.title"), args, MODAL);
|
||||
|
||||
}
|
||||
|
||||
// O tratamento para deletar o Pricing (made by Monteiro) quando sair sem
|
||||
// salvar foi mudado para o evento onClose da janela.
|
||||
public void onClick$btnFechar(Event ev) {
|
||||
|
|
|
@ -5,15 +5,14 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
||||
import com.rjconsultores.ventaboletos.entidad.PricingVigencia;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
||||
import com.rjconsultores.ventaboletos.entidad.PricingVigencia;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rafius
|
||||
|
|
|
@ -1945,6 +1945,7 @@ editarPricingController.lhCorridaId.labelLH = Serviço
|
|||
editarPricingController.MSG.inativarPergunta = Deseja realmente inativar esse pricing?
|
||||
editarPricingController.MSG.inativarOK = Pricing desativado com sucesso.
|
||||
editarPricingController.window.title = Pricing
|
||||
copiarPricingController.window.title = Copiar Pricing
|
||||
editarPricingController.windowEspecifico.title = Pricing Específico
|
||||
editarPricingController.windowVigencia.title = Filtros
|
||||
editarPricingController.windowTramo.title = Trecho
|
||||
|
@ -1973,6 +1974,7 @@ editarPricingController.MSG.ativarOK = Pricing ativado com sucesso.
|
|||
editarPricingController.btnInativar.tooltiptext = Inativar
|
||||
editarPricingController.btnSalvar.tooltiptext = Salvar
|
||||
editarPricingController.btnFechar.tooltiptext = Fechar
|
||||
editarPricingController.btnCopiar.tooltiptext = Gerar pricing idêntico a este
|
||||
editarPricingController.tarifia.label = Tarifa
|
||||
editarPricingController.tarifiaredondoabierto.label = Tarifa volta em aberto
|
||||
editarPricingController.tabGen.label = Geral
|
||||
|
@ -2036,6 +2038,10 @@ editarPricingController.btnNovoOcupacion.tooltiptext = Incluir
|
|||
editarPricingController.btnNovoVigencia.tooltiptext = Incluir
|
||||
editarPricingController.btnApagarVigencia.tooltiptext = Eliminar
|
||||
editarPricingController.MSG.suscribirOK = Configuração de pricing Registrada com Sucesso.
|
||||
copiarPricingController.MSG.suscribirOK = Copia de pricing realizada com Sucesso.
|
||||
copiarPricingController.MSG.Registro.Existe = Já existe um pricing com este nome, por favor altere o nome do pricing.
|
||||
copiarPricingController.MSG.sem.nome = É necessario ter o nome do pricing, para efetuar a copia.
|
||||
copiarPricingController.MSG.ERRO = ERRO ao copiar pricing.
|
||||
editarPricingController.MSG.borrarPergunta = Deseja Eliminar configuração de pricing?
|
||||
editarPricingController.MSG.borrarOK = Configuração de pricing Excluida com Sucesso.
|
||||
editarPricingController.MSG.fechaViaje = Data Início de Viagem Posterior a Data Final.
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winCopiarPricing"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
<window id="winCopiarPricing" border="normal" width="460px"
|
||||
apply="${copiarPricingController}" closable="true"
|
||||
contentStyle="overflow:auto"
|
||||
title="${c:l('copiarPricingController.window.title')}">
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
|
||||
<label value="Novo Nome: " />
|
||||
<textbox id="nombrePricing" constraint="no empty"
|
||||
maxlength="20" width="100%"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnSalvarCopia" image="/gui/img/save.png"
|
||||
label="Salvar" />
|
||||
</toolbar>
|
||||
|
||||
</window>
|
||||
</zk>
|
|
@ -19,6 +19,11 @@
|
|||
tooltiptext="${c:l('editarPricingController.btnSalvar.tooltiptext')}" />
|
||||
|
||||
<separator orient="vertical" />
|
||||
|
||||
<button id="btnCopiar" height="20"
|
||||
image="/gui/img/copiar.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnCopiar.tooltiptext')}" />
|
||||
|
||||
<separator orient="vertical" />
|
||||
|
||||
<button id="btnInativar" height="20"
|
||||
|
|
Loading…
Reference in New Issue