Regalamiunsorriso/decompiled-libs/www/acxent-common-1.0.1/it/acxent/tex/anag/Fondo.java

93 lines
2.7 KiB
Java
Raw Normal View History

2026-04-22 18:41:37 +02:00
package it.acxent.tex.anag;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@Deprecated
public class Fondo extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1468228167664L;
private long id_fondo;
private String descrizione;
public Fondo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Fondo() {}
public void setId_fondo(long newId_fondo) {
this.id_fondo = newId_fondo;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_fondo() {
return this.id_fondo;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<Fondo> findByCR(FondoCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from FONDO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<Fondo> findByDatiTecniciTessuto(long id_datiTecniciTessuto) {
String s_Sql_Find = "select A.* from FONDO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc(" A.id_datiTecniciTessuto = " + id_datiTecniciTessuto);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<ColoreFondo> getColori() {
return new ColoreFondo(getApFull()).findByFondo(getId_fondo());
}
}