110 lines
3.7 KiB
Java
110 lines
3.7 KiB
Java
package it.acxent.pg.servlet;
|
|
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.CRAdapter;
|
|
import it.acxent.db.DBAdapter;
|
|
import it.acxent.pg.FotoCR;
|
|
import it.acxent.pg.Gara;
|
|
import javax.servlet.RequestDispatcher;
|
|
import javax.servlet.ServletRequest;
|
|
import javax.servlet.ServletResponse;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
public class GaraSvlt extends _PgPageSvlt {
|
|
private static final long serialVersionUID = -3730345807508646299L;
|
|
|
|
protected void caricaCombo(HttpServletRequest req, HttpServletResponse res) {}
|
|
|
|
protected void chiamaJsp(HttpServletRequest req, HttpServletResponse res) {
|
|
setJspPageRelative("fotoCR.jsp", req);
|
|
try {
|
|
caricaCombo(req, res);
|
|
RequestDispatcher rd = getServletContext().getRequestDispatcher(getJspPage(req));
|
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
|
} catch (Exception e) {
|
|
handleDebug(e);
|
|
}
|
|
}
|
|
|
|
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
|
search(req, res);
|
|
}
|
|
|
|
protected void print(HttpServletRequest req, HttpServletResponse res) {}
|
|
|
|
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
|
|
|
|
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
|
|
|
|
protected DBAdapter getBean(HttpServletRequest req) {
|
|
return new Gara(getApFull());
|
|
}
|
|
|
|
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
|
return null;
|
|
}
|
|
|
|
protected void search(HttpServletRequest req, HttpServletResponse res) {
|
|
ApplParmFull apFull = getApFull(req);
|
|
Gara bean = new Gara(apFull);
|
|
FotoCR CR = new FotoCR(apFull);
|
|
long flgTipoEvento = getRequestLongParameter(req, "flgTipoEvento");
|
|
String datarange = "";
|
|
if (flgTipoEvento == 0L) {
|
|
datarange = getRequestParameter(req, "datarangeFe");
|
|
} else {
|
|
datarange = getRequestParameter(req, "datarangeFer");
|
|
}
|
|
if (!datarange.isEmpty()) {
|
|
req.setAttribute("dataInizioGaraDa", datarange.substring(0, 10));
|
|
req.setAttribute("dataInizioGaraA", datarange.substring(13, 23));
|
|
}
|
|
fillObject(req, CR);
|
|
req.setAttribute("list", bean.findWebByCR(CR, 0, 0));
|
|
req.setAttribute("CR", CR);
|
|
setJspPage("/garaCR.jsp", req);
|
|
callJsp(req, res);
|
|
}
|
|
|
|
public void _searchIndex(HttpServletRequest req, HttpServletResponse res) {
|
|
Gara bean = new Gara(getApFull());
|
|
FotoCR CR = new FotoCR();
|
|
fillObject(req, CR);
|
|
long flgTipoEvento = getRequestLongParameter(req, "flgTipoEvento");
|
|
int pageNumber = 1;
|
|
int pageRow = (int)getRequestLongParameter(req, "pageRowFS");
|
|
if (pageRow == 0)
|
|
pageRow = 4;
|
|
String datarange = "";
|
|
if (flgTipoEvento == 0L) {
|
|
pageNumber = (int)CR.getPageNumberFS();
|
|
if (CR.getId_tipoGaraFS() > 0L) {
|
|
CR.setId_tipoGara(CR.getId_tipoGaraFS());
|
|
} else {
|
|
CR.setId_tipoGara(1L);
|
|
}
|
|
if (!CR.getLocalitaFS().isEmpty())
|
|
CR.setLocalita(CR.getLocalitaFS());
|
|
CR.setDataGaraInizio(CR.getDataGaraInizioFS());
|
|
CR.setAnno(CR.getAnnoFS());
|
|
CR.setFlgMese(CR.getFlgMeseFS());
|
|
} else {
|
|
pageNumber = (int)CR.getPageNumberFE();
|
|
if (CR.getId_tipoGaraFE() > 0L) {
|
|
CR.setId_tipoGara(CR.getId_tipoGaraFE());
|
|
} else {
|
|
CR.setId_tipoGara(2L);
|
|
}
|
|
if (!CR.getLocalitaFE().isEmpty())
|
|
CR.setLocalita(CR.getLocalitaFE());
|
|
CR.setDataGaraInizio(CR.getDataGaraInizioFE());
|
|
CR.setAnno(CR.getAnnoFE());
|
|
CR.setFlgMese(CR.getFlgMeseFE());
|
|
}
|
|
req.setAttribute("CR", CR);
|
|
req.setAttribute("list", bean.findWebByCR(CR, pageNumber, pageRow));
|
|
setJspPage("/garaCRIndex.jsp", req);
|
|
callJsp(req, res);
|
|
}
|
|
}
|