Pricing - Customizar Aba de Serviço
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@31007 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
93b9d4ab2d
commit
0d4e23d02b
|
@ -4,15 +4,9 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.gui.controladores.pricing;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
||||
import com.rjconsultores.ventaboletos.entidad.PricingDia;
|
||||
import com.rjconsultores.ventaboletos.service.PricingDiaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
@ -26,6 +20,14 @@ import org.zkoss.zk.ui.util.Clients;
|
|||
import org.zkoss.zul.Checkbox;
|
||||
import org.zkoss.zul.Timebox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
||||
import com.rjconsultores.ventaboletos.entidad.PricingDia;
|
||||
import com.rjconsultores.ventaboletos.service.PricingDiaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rafius
|
||||
|
@ -34,240 +36,266 @@ import org.zkoss.zul.Timebox;
|
|||
@Scope("prototype")
|
||||
public class EditarPricingDiaController extends MyGenericForwardComposer {
|
||||
|
||||
@Autowired
|
||||
private PricingDiaService pricingDiaService;
|
||||
private PricingDia pricingDia;
|
||||
private MyListbox pricingDiaList;
|
||||
private static Logger log = Logger.getLogger(EditarPricingDiaController.class);
|
||||
private Checkbox rdLun;
|
||||
private Checkbox rdMar;
|
||||
private Checkbox rdMie;
|
||||
private Checkbox rdJue;
|
||||
private Checkbox rdVie;
|
||||
private Checkbox rdSab;
|
||||
private Checkbox rdDom;
|
||||
private Timebox horarioinicio;
|
||||
private Timebox horariofin;
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static Logger log = Logger.getLogger(EditarPricingDiaController.class);
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
@Autowired
|
||||
private PricingDiaService pricingDiaService;
|
||||
private PricingDia pricingDia;
|
||||
private MyListbox pricingDiaList;
|
||||
|
||||
pricingDia = (PricingDia) Executions.getCurrent().getArg().get("pricingDia");
|
||||
pricingDiaList = (MyListbox) Executions.getCurrent().getArg().get("pricingDiaList");
|
||||
private Checkbox rdLun;
|
||||
private Checkbox rdMar;
|
||||
private Checkbox rdMie;
|
||||
private Checkbox rdJue;
|
||||
private Checkbox rdVie;
|
||||
private Checkbox rdSab;
|
||||
private Checkbox rdDom;
|
||||
private Timebox horarioinicio;
|
||||
private Timebox horariofin;
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
private Checkbox ckFecViaje;
|
||||
private Checkbox ckFecVenta;
|
||||
|
||||
if (pricingDia.getPricingdiaId() != null) {
|
||||
if (pricingDia.getIndlunes() == Boolean.TRUE) {
|
||||
rdLun.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndmartes() == Boolean.TRUE) {
|
||||
rdMar.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndmiercoles() == Boolean.TRUE) {
|
||||
rdMie.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndjueves() == Boolean.TRUE) {
|
||||
rdJue.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndviernes() == Boolean.TRUE) {
|
||||
rdVie.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndsabado() == Boolean.TRUE) {
|
||||
rdSab.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getInddomingo() == Boolean.TRUE) {
|
||||
rdDom.setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
|
||||
public boolean noTraslapa() {
|
||||
List<PricingDia> lsVT1 = pricingDiaService.buscarTraslapa(pricingDia);
|
||||
pricingDia = (PricingDia) Executions.getCurrent().getArg().get("pricingDia");
|
||||
pricingDiaList = (MyListbox) Executions.getCurrent().getArg().get("pricingDiaList");
|
||||
|
||||
// Nao Traslapen
|
||||
Boolean podeSalvar = false;
|
||||
Boolean[] podeTodos = new Boolean[lsVT1.isEmpty() ? 1 : lsVT1.size()];
|
||||
boolean podeMesmo = true;
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
// Se a lista for nula / Salva
|
||||
if (lsVT1.isEmpty()) {
|
||||
podeMesmo = true;
|
||||
podeTodos[0] = true;
|
||||
// Se a lista não for nula e for algo novo... não pode salvar
|
||||
} else {
|
||||
int i = 0;
|
||||
for (PricingDia p : lsVT1) {
|
||||
if (p.getPricingdiaId().equals(pricingDia.getPricingdiaId())) {
|
||||
podeTodos[i] = true;
|
||||
continue;
|
||||
}
|
||||
podeSalvar = true;
|
||||
if (pricingDia.getIndlunes()) {
|
||||
if (p.getIndlunes() == pricingDia.getIndlunes()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndmartes()) {
|
||||
if (p.getIndmartes() == pricingDia.getIndmartes()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndmiercoles()) {
|
||||
if (p.getIndmiercoles() == pricingDia.getIndmiercoles()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndjueves()) {
|
||||
if (p.getIndjueves() == pricingDia.getIndjueves()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndviernes()) {
|
||||
if (p.getIndviernes() == pricingDia.getIndviernes()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndsabado()) {
|
||||
if (p.getIndsabado() == pricingDia.getIndsabado()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getInddomingo()) {
|
||||
if (p.getInddomingo() == pricingDia.getInddomingo()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
podeTodos[i] = podeSalvar;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getPricingdiaId() != null) {
|
||||
if (pricingDia.getIndlunes() == Boolean.TRUE) {
|
||||
rdLun.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndmartes() == Boolean.TRUE) {
|
||||
rdMar.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndmiercoles() == Boolean.TRUE) {
|
||||
rdMie.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndjueves() == Boolean.TRUE) {
|
||||
rdJue.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndviernes() == Boolean.TRUE) {
|
||||
rdVie.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndsabado() == Boolean.TRUE) {
|
||||
rdSab.setChecked(true);
|
||||
}
|
||||
|
||||
for (int i = 0; i < podeTodos.length; i++) {
|
||||
if (podeTodos[i] != null) {
|
||||
if (!podeTodos[i]) {
|
||||
podeMesmo = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return podeMesmo;
|
||||
}
|
||||
if (pricingDia.getInddomingo() == Boolean.TRUE) {
|
||||
rdDom.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndfecventa() == Boolean.TRUE) {
|
||||
ckFecVenta.setChecked(true);
|
||||
}
|
||||
if (pricingDia.getIndfecviaje() == Boolean.TRUE) {
|
||||
ckFecViaje.setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnAdicionarDia(Event ev) throws Exception {
|
||||
public boolean noTraslapa() {
|
||||
List<PricingDia> lsVT1 = pricingDiaService.buscarTraslapa(pricingDia);
|
||||
|
||||
horarioinicio.getValue();
|
||||
horariofin.getValue();
|
||||
// Nao Traslapen
|
||||
Boolean podeSalvar = false;
|
||||
Boolean[] podeTodos = new Boolean[lsVT1.isEmpty() ? 1 : lsVT1.size()];
|
||||
boolean podeMesmo = true;
|
||||
|
||||
horarioinicio.setValue(DateUtil.getFecInicio(horarioinicio.getValue()).getTime());
|
||||
horariofin.setValue(DateUtil.getFecInicio(horariofin.getValue()).getTime());
|
||||
// Se a lista for nula / Salva
|
||||
if (lsVT1.isEmpty()) {
|
||||
podeMesmo = true;
|
||||
podeTodos[0] = true;
|
||||
// Se a lista não for nula e for algo novo... não pode salvar
|
||||
} else {
|
||||
int i = 0;
|
||||
for (PricingDia p : lsVT1) {
|
||||
if (p.getPricingdiaId().equals(pricingDia.getPricingdiaId())) {
|
||||
podeTodos[i] = true;
|
||||
continue;
|
||||
}
|
||||
podeSalvar = true;
|
||||
if (pricingDia.getIndlunes()) {
|
||||
if (p.getIndlunes() == pricingDia.getIndlunes()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndmartes()) {
|
||||
if (p.getIndmartes() == pricingDia.getIndmartes()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndmiercoles()) {
|
||||
if (p.getIndmiercoles() == pricingDia.getIndmiercoles()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndjueves()) {
|
||||
if (p.getIndjueves() == pricingDia.getIndjueves()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndviernes()) {
|
||||
if (p.getIndviernes() == pricingDia.getIndviernes()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndsabado()) {
|
||||
if (p.getIndsabado() == pricingDia.getIndsabado()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getInddomingo()) {
|
||||
if (p.getInddomingo() == pricingDia.getInddomingo()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndfecventa()) {
|
||||
if (p.getIndfecventa() == pricingDia.getIndfecventa()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
if (pricingDia.getIndfecviaje()) {
|
||||
if (p.getIndfecviaje() == pricingDia.getIndfecviaje()) {
|
||||
podeSalvar = false;
|
||||
}
|
||||
}
|
||||
podeTodos[i] = podeSalvar;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (horarioinicio.getValue().after(horariofin.getValue())) {
|
||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.datas"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
for (int i = 0; i < podeTodos.length; i++) {
|
||||
if (podeTodos[i] != null) {
|
||||
if (!podeTodos[i]) {
|
||||
podeMesmo = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return podeMesmo;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
public void onClick$btnAdicionarDia(Event ev) throws Exception {
|
||||
|
||||
if (!rdLun.isChecked() && !rdMar.isChecked() && !rdMie.isChecked() && !rdJue.isChecked() && !rdVie.isChecked() && !rdSab.isChecked() && !rdDom.isChecked()) {
|
||||
Clients.alert(Labels.getLabel("EditarPricingDiaController.MSG.obligatorioDia"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.EXCLAMATION);
|
||||
horarioinicio.getValue();
|
||||
horariofin.getValue();
|
||||
|
||||
return;
|
||||
}
|
||||
try {
|
||||
pricingDia.setIndlunes(rdLun.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndmartes(rdMar.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndmiercoles(rdMie.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndjueves(rdJue.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndviernes(rdVie.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndsabado(rdSab.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setInddomingo(rdDom.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
horarioinicio.setValue(DateUtil.getFecInicio(horarioinicio.getValue()).getTime());
|
||||
horariofin.setValue(DateUtil.getFecInicio(horariofin.getValue()).getTime());
|
||||
|
||||
pricingDia.setHorarioinicio(DateUtil.getFecInicio(horarioinicio.getValue()).getTime());
|
||||
pricingDia.setHorariofin(DateUtil.getFecInicio(horariofin.getValue()).getTime());
|
||||
if (horarioinicio.getValue().after(horariofin.getValue())) {
|
||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.datas"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
|
||||
if (noTraslapa()) {
|
||||
if (pricingDia.getPricingdiaId() != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
pricingDiaService.actualizacion(pricingDia);
|
||||
pricingDiaList.updateItem(pricingDia);
|
||||
} else {
|
||||
pricingDiaService.suscribir(pricingDia);
|
||||
pricingDiaList.addItem(pricingDia);
|
||||
}
|
||||
closeWindow();
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.traslapa"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK,
|
||||
Messagebox.EXCLAMATION);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.ERROR);
|
||||
}
|
||||
if (!rdLun.isChecked() && !rdMar.isChecked() && !rdMie.isChecked() && !rdJue.isChecked() && !rdVie.isChecked() && !rdSab.isChecked() && !rdDom.isChecked()) {
|
||||
Clients.alert(Labels.getLabel("EditarPricingDiaController.MSG.obligatorioDia"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.EXCLAMATION);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
pricingDia.setIndlunes(rdLun.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndmartes(rdMar.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndmiercoles(rdMie.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndjueves(rdJue.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndviernes(rdVie.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndsabado(rdSab.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setInddomingo(rdDom.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
|
||||
public void onClick$btnRemoverDia(Event ev) {
|
||||
try {
|
||||
PricingDia pDia = (PricingDia) pricingDiaList.getSelected();
|
||||
if (pDia != null) {
|
||||
int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaDia"), Labels.getLabel("editarPricingController.windowDia.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
pricingDia.setIndfecventa(ckFecVenta.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
pricingDia.setIndfecviaje(ckFecViaje.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
pricingDia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
pricingDia.setFecmodif(Calendar.getInstance().getTime());
|
||||
pricingDia.setActivo(Pricing.INATIVO);
|
||||
pricingDia.setHorarioinicio(DateUtil.getFecInicio(horarioinicio.getValue()).getTime());
|
||||
pricingDia.setHorariofin(DateUtil.getFecInicio(horariofin.getValue()).getTime());
|
||||
|
||||
pricingDiaList.removeItem(pricingDia);
|
||||
pricingDiaService.borrar(pricingDia);
|
||||
closeWindow();
|
||||
}
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK,
|
||||
Messagebox.EXCLAMATION);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
}
|
||||
if (noTraslapa()) {
|
||||
if (pricingDia.getPricingdiaId() != null) {
|
||||
|
||||
}
|
||||
pricingDiaService.actualizacion(pricingDia);
|
||||
pricingDiaList.updateItem(pricingDia);
|
||||
} else {
|
||||
pricingDiaService.suscribir(pricingDia);
|
||||
pricingDiaList.addItem(pricingDia);
|
||||
}
|
||||
closeWindow();
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.traslapa"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK,
|
||||
Messagebox.EXCLAMATION);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.ERROR);
|
||||
}
|
||||
|
||||
public PricingDia getPricingDia() {
|
||||
return pricingDia;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPricingDia(PricingDia pricingDia) {
|
||||
this.pricingDia = pricingDia;
|
||||
}
|
||||
public void onClick$btnRemoverDia(Event ev) {
|
||||
try {
|
||||
PricingDia pDia = (PricingDia) pricingDiaList.getSelected();
|
||||
if (pDia != null) {
|
||||
int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaDia"), Labels.getLabel("editarPricingController.windowDia.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
public MyListbox getPricingDiaList() {
|
||||
return pricingDiaList;
|
||||
}
|
||||
if (resp == Messagebox.YES) {
|
||||
pricingDia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
pricingDia.setFecmodif(Calendar.getInstance().getTime());
|
||||
pricingDia.setActivo(Pricing.INATIVO);
|
||||
|
||||
public void setPricingDiaList(MyListbox pricingDiaList) {
|
||||
this.pricingDiaList = pricingDiaList;
|
||||
}
|
||||
pricingDiaList.removeItem(pricingDia);
|
||||
pricingDiaService.borrar(pricingDia);
|
||||
closeWindow();
|
||||
}
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK,
|
||||
Messagebox.EXCLAMATION);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
}
|
||||
|
||||
public PricingDiaService getPricingDiaService() {
|
||||
return pricingDiaService;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPricingDiaService(PricingDiaService pricingDiaService) {
|
||||
this.pricingDiaService = pricingDiaService;
|
||||
}
|
||||
public PricingDia getPricingDia() {
|
||||
return pricingDia;
|
||||
}
|
||||
|
||||
public Timebox getHorariofin() {
|
||||
return horariofin;
|
||||
}
|
||||
public void setPricingDia(PricingDia pricingDia) {
|
||||
this.pricingDia = pricingDia;
|
||||
}
|
||||
|
||||
public void setHorariofin(Timebox horariofin) {
|
||||
this.horariofin = horariofin;
|
||||
}
|
||||
public MyListbox getPricingDiaList() {
|
||||
return pricingDiaList;
|
||||
}
|
||||
|
||||
public Timebox getHorarioinicio() {
|
||||
return horarioinicio;
|
||||
}
|
||||
public void setPricingDiaList(MyListbox pricingDiaList) {
|
||||
this.pricingDiaList = pricingDiaList;
|
||||
}
|
||||
|
||||
public void setHorarioinicio(Timebox horarioinicio) {
|
||||
this.horarioinicio = horarioinicio;
|
||||
}
|
||||
public PricingDiaService getPricingDiaService() {
|
||||
return pricingDiaService;
|
||||
}
|
||||
|
||||
public void setPricingDiaService(PricingDiaService pricingDiaService) {
|
||||
this.pricingDiaService = pricingDiaService;
|
||||
}
|
||||
|
||||
public Timebox getHorariofin() {
|
||||
return horariofin;
|
||||
}
|
||||
|
||||
public void setHorariofin(Timebox horariofin) {
|
||||
this.horariofin = horariofin;
|
||||
}
|
||||
|
||||
public Timebox getHorarioinicio() {
|
||||
return horarioinicio;
|
||||
}
|
||||
|
||||
public void setHorarioinicio(Timebox horarioinicio) {
|
||||
this.horarioinicio = horarioinicio;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,111 +12,131 @@ import org.zkoss.zul.Listitem;
|
|||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Rafius
|
||||
*/
|
||||
public class RenderPricingDia implements ListitemRenderer {
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
PricingDia pc = (PricingDia) o;
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
PricingDia pc = (PricingDia) o;
|
||||
|
||||
Listcell lc = new Listcell();
|
||||
Listcell lc = new Listcell();
|
||||
|
||||
SimpleDateFormat sf = new SimpleDateFormat("HH:mm");
|
||||
if (pc.getPricingdiaId() != null) {
|
||||
lc = new Listcell(sf.format(pc.getHorarioinicio()));
|
||||
} else {
|
||||
lc = new Listcell("-");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
SimpleDateFormat sf = new SimpleDateFormat("HH:mm");
|
||||
if (pc.getPricingdiaId() != null) {
|
||||
lc = new Listcell(sf.format(pc.getHorarioinicio()));
|
||||
} else {
|
||||
lc = new Listcell("-");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
if (pc.getPricingdiaId() != null) {
|
||||
lc = new Listcell(sf.format(pc.getHorariofin()));
|
||||
} else {
|
||||
lc = new Listcell("-");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
if (pc.getPricingdiaId() != null) {
|
||||
lc = new Listcell(sf.format(pc.getHorariofin()));
|
||||
} else {
|
||||
lc = new Listcell("-");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
//Lunes
|
||||
Checkbox ckbLun = new Checkbox();
|
||||
if (pc.getIndlunes() == Boolean.TRUE) {
|
||||
ckbLun.setChecked(true);
|
||||
} else {
|
||||
ckbLun.setChecked(false);
|
||||
}
|
||||
ckbLun.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbLun.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
// Lunes
|
||||
Checkbox ckbLun = new Checkbox();
|
||||
if (pc.getIndlunes() == Boolean.TRUE) {
|
||||
ckbLun.setChecked(true);
|
||||
} else {
|
||||
ckbLun.setChecked(false);
|
||||
}
|
||||
ckbLun.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbLun.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbMar = new Checkbox();
|
||||
if (pc.getIndmartes() == Boolean.TRUE) {
|
||||
ckbMar.setChecked(true);
|
||||
} else {
|
||||
ckbMar.setChecked(false);
|
||||
}
|
||||
ckbMar.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbMar.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbMar = new Checkbox();
|
||||
if (pc.getIndmartes() == Boolean.TRUE) {
|
||||
ckbMar.setChecked(true);
|
||||
} else {
|
||||
ckbMar.setChecked(false);
|
||||
}
|
||||
ckbMar.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbMar.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
Checkbox ckbMie = new Checkbox();
|
||||
if (pc.getIndmiercoles() == Boolean.TRUE) {
|
||||
ckbMie.setChecked(true);
|
||||
} else {
|
||||
ckbMie.setChecked(false);
|
||||
}
|
||||
ckbMie.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbMie.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbJue = new Checkbox();
|
||||
if (pc.getIndjueves() == Boolean.TRUE) {
|
||||
ckbJue.setChecked(true);
|
||||
} else {
|
||||
ckbJue.setChecked(false);
|
||||
}
|
||||
ckbJue.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbJue.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbMie = new Checkbox();
|
||||
if (pc.getIndmiercoles() == Boolean.TRUE) {
|
||||
ckbMie.setChecked(true);
|
||||
} else {
|
||||
ckbMie.setChecked(false);
|
||||
}
|
||||
ckbMie.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbMie.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
Checkbox ckbVie = new Checkbox();
|
||||
if (pc.getIndviernes() == Boolean.TRUE) {
|
||||
ckbVie.setChecked(true);
|
||||
} else {
|
||||
ckbVie.setChecked(false);
|
||||
}
|
||||
ckbVie.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbVie.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbJue = new Checkbox();
|
||||
if (pc.getIndjueves() == Boolean.TRUE) {
|
||||
ckbJue.setChecked(true);
|
||||
} else {
|
||||
ckbJue.setChecked(false);
|
||||
}
|
||||
ckbJue.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbJue.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
Checkbox ckbSab = new Checkbox();
|
||||
if (pc.getIndsabado() == Boolean.TRUE) {
|
||||
ckbSab.setChecked(true);
|
||||
} else {
|
||||
ckbSab.setChecked(false);
|
||||
}
|
||||
ckbSab.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbSab.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbVie = new Checkbox();
|
||||
if (pc.getIndviernes() == Boolean.TRUE) {
|
||||
ckbVie.setChecked(true);
|
||||
} else {
|
||||
ckbVie.setChecked(false);
|
||||
}
|
||||
ckbVie.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbVie.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
Checkbox ckbDom = new Checkbox();
|
||||
if (pc.getInddomingo() == Boolean.TRUE) {
|
||||
ckbDom.setChecked(true);
|
||||
} else {
|
||||
ckbDom.setChecked(false);
|
||||
}
|
||||
ckbDom.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbDom.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbSab = new Checkbox();
|
||||
if (pc.getIndsabado() == Boolean.TRUE) {
|
||||
ckbSab.setChecked(true);
|
||||
} else {
|
||||
ckbSab.setChecked(false);
|
||||
}
|
||||
ckbSab.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbSab.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
Checkbox ckbFecventa = new Checkbox();
|
||||
if (pc.getIndfecventa() == Boolean.TRUE) {
|
||||
ckbFecventa.setChecked(true);
|
||||
} else {
|
||||
ckbFecventa.setChecked(false);
|
||||
}
|
||||
ckbFecventa.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbFecventa.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
Checkbox ckbDom = new Checkbox();
|
||||
if (pc.getInddomingo() == Boolean.TRUE) {
|
||||
ckbDom.setChecked(true);
|
||||
} else {
|
||||
ckbDom.setChecked(false);
|
||||
}
|
||||
ckbDom.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbDom.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
Checkbox ckbFecviaje = new Checkbox();
|
||||
if (pc.getIndfecviaje() == Boolean.TRUE) {
|
||||
ckbFecviaje.setChecked(true);
|
||||
} else {
|
||||
ckbFecviaje.setChecked(false);
|
||||
}
|
||||
ckbFecviaje.setDisabled(true);
|
||||
lc = new Listcell();
|
||||
ckbFecviaje.setParent(lc);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", pc);
|
||||
}
|
||||
lstm.setAttribute("data", pc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2139,8 +2139,9 @@ editarPricingController.lbJueM.value = Qui
|
|||
editarPricingController.lbVieM.value = Sex
|
||||
editarPricingController.lbSabM.value = Sáb
|
||||
editarPricingController.lbDomM.value = Dom
|
||||
editarPricingController.rdFechaViagem.value = Data da Viagem
|
||||
editarPricingController.rdFechaCompra.value = Data da Compra
|
||||
editarPricingController.lbDatas.value = Datas
|
||||
editarPricingController.ckFecViagem.value = Data da Viagem
|
||||
editarPricingController.ckFecCompra.value = Data da Compra
|
||||
editarPricingController.hIni.value = Horário Inicial
|
||||
editarPricingController.hFim.value = Horário Final
|
||||
editarPricingController.corridaId.value = Nº Serviço
|
||||
|
|
|
@ -552,33 +552,39 @@
|
|||
image="/gui/img/create_doc.gif" sort="auto(horariofin)"
|
||||
label="${c:l('editarPricingController.hFim.value')}" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbLunM.value')}"
|
||||
sort="auto(indlunes)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbMarM.value')}"
|
||||
sort="auto(indmartes)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbMieM.value')}"
|
||||
sort="auto(indmiercoles)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbJueM.value')}"
|
||||
sort="auto(indjueves)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbVieM.value')}"
|
||||
sort="auto(indviernes)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbSabM.value')}"
|
||||
sort="auto(indsabado)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
image="/gui/img/create_doc.gif" width="8%"
|
||||
label="${c:l('editarPricingController.lbDomM.value')}"
|
||||
sort="auto(inddomingo)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif" label="Data Viagem"
|
||||
sort="auto(indfecviaje)" />
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif" label="Data Venda"
|
||||
sort="auto(indfecventa)" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
|
|
|
@ -5,54 +5,94 @@
|
|||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winEditarPricingDia" border="normal"
|
||||
apply="${editarPricingDiaController}"
|
||||
width="400px" height="457x" contentStyle="overflow:auto"
|
||||
title="${c:l('editarPricingController.windowDia.title')}">
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<!--button id="btnRemoverDia" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingDiaController.btnApagar.tooltiptext')}"/-->
|
||||
<button id="btnAdicionarDia" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingDiaController.btnSalvar.tooltiptext')}"/>
|
||||
<button height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winEditarPricingDia.detach()"
|
||||
tooltiptext="${c:l('editarPricingDiaController.btnFechar.tooltiptext')}"/>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
<window id="winEditarPricingDia" border="normal"
|
||||
apply="${editarPricingDiaController}" width="400px" height="457x"
|
||||
contentStyle="overflow:auto"
|
||||
title="${c:l('editarPricingController.windowDia.title')}">
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<!--button id="btnRemoverDia" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingDiaController.btnApagar.tooltiptext')}"/-->
|
||||
<button id="btnAdicionarDia" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingDiaController.btnSalvar.tooltiptext')}" />
|
||||
<button height="20" image="/gui/img/exit.png"
|
||||
width="35px" onClick="winEditarPricingDia.detach()"
|
||||
tooltiptext="${c:l('editarPricingDiaController.btnFechar.tooltiptext')}" />
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="40%" />
|
||||
<column width="60%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('editarPricingController.hIni.value')}"/>
|
||||
<timebox id="horarioinicio" format="HH:mm" mold="rounded" constraint="no empty"
|
||||
value="@{winEditarPricingDia$composer.pricingDia.horarioinicio}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarPricingController.hFim.value')}"/>
|
||||
<timebox id="horariofin" format="HH:mm" mold="rounded" constraint="no empty"
|
||||
value="@{winEditarPricingDia$composer.pricingDia.horariofin}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarPricingController.lbDias.value')}"/>
|
||||
<hbox>
|
||||
<checkbox id="rdLun" label="${c:l('editarPricingController.lbLunM.value')}" checked="false"/>
|
||||
<checkbox id="rdMar" label="${c:l('editarPricingController.lbMarM.value')}" checked="false"/>
|
||||
<checkbox id="rdMie" label="${c:l('editarPricingController.lbMieM.value')}" checked="false"/>
|
||||
<checkbox id="rdJue" label="${c:l('editarPricingController.lbJueM.value')}" checked="false"/>
|
||||
<checkbox id="rdVie" label="${c:l('editarPricingController.lbVieM.value')}" checked="false"/>
|
||||
<checkbox id="rdSab" label="${c:l('editarPricingController.lbSabM.value')}" checked="false"/>
|
||||
<checkbox id="rdDom" label="${c:l('editarPricingController.lbDomM.value')}" checked="false"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</window>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="40%" />
|
||||
<column width="60%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPricingController.lbDatas.value')}" />
|
||||
<hbox>
|
||||
<checkbox id="ckFecViaje"
|
||||
label="${c:l('editarPricingController.ckFecViagem.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="ckFecVenta"
|
||||
label="${c:l('editarPricingController.ckFecCompra.value')}"
|
||||
checked="false" />
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="40%" />
|
||||
<column width="60%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPricingController.hIni.value')}" />
|
||||
<timebox id="horarioinicio" format="HH:mm"
|
||||
mold="rounded" constraint="no empty"
|
||||
value="@{winEditarPricingDia$composer.pricingDia.horarioinicio}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPricingController.hFim.value')}" />
|
||||
<timebox id="horariofin" format="HH:mm"
|
||||
mold="rounded" constraint="no empty"
|
||||
value="@{winEditarPricingDia$composer.pricingDia.horariofin}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPricingController.lbDias.value')}" />
|
||||
<hbox>
|
||||
<checkbox id="rdLun"
|
||||
label="${c:l('editarPricingController.lbLunM.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="rdMar"
|
||||
label="${c:l('editarPricingController.lbMarM.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="rdMie"
|
||||
label="${c:l('editarPricingController.lbMieM.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="rdJue"
|
||||
label="${c:l('editarPricingController.lbJueM.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="rdVie"
|
||||
label="${c:l('editarPricingController.lbVieM.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="rdSab"
|
||||
label="${c:l('editarPricingController.lbSabM.value')}"
|
||||
checked="false" />
|
||||
<checkbox id="rdDom"
|
||||
label="${c:l('editarPricingController.lbDomM.value')}"
|
||||
checked="false" />
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue