109 lines
2.6 KiB
Java
109 lines
2.6 KiB
Java
package it.acxent.art;
|
|
|
|
import it.acxent.anag.Iva;
|
|
import it.acxent.db.ApplParmFull;
|
|
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;
|
|
|
|
public class Reparto extends _ArtAdapter implements Serializable {
|
|
private long id_reparto;
|
|
|
|
private String descrizione;
|
|
|
|
private String sigla;
|
|
|
|
private long id_iva;
|
|
|
|
private Iva iva;
|
|
|
|
private long siglaEpson;
|
|
|
|
public Reparto(ApplParmFull newApplParmFull) {
|
|
super(newApplParmFull);
|
|
}
|
|
|
|
public Reparto() {}
|
|
|
|
public void setId_reparto(long newId_reparto) {
|
|
this.id_reparto = newId_reparto;
|
|
}
|
|
|
|
public void setDescrizione(String newDescrizione_it) {
|
|
this.descrizione = newDescrizione_it;
|
|
}
|
|
|
|
public long getId_reparto() {
|
|
return this.id_reparto;
|
|
}
|
|
|
|
public String getDescrizione() {
|
|
return (this.descrizione == null) ? "" :
|
|
this.descrizione.trim();
|
|
}
|
|
|
|
protected void deleteCascade() {}
|
|
|
|
public Vectumerator findByCR(RepartoCR CR, int pageNumber, int pageRows) {
|
|
String s_Sql_Find = "select A.* from REPARTO AS A";
|
|
String s_Sql_Order = " order by A.descrizione";
|
|
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) {
|
|
handleDebug(e);
|
|
return AB_EMPTY_VECTUMERATOR;
|
|
}
|
|
}
|
|
|
|
public String getSigla() {
|
|
return (this.sigla == null) ? "" : this.sigla.trim();
|
|
}
|
|
|
|
public void setSigla(String sigla) {
|
|
this.sigla = sigla;
|
|
}
|
|
|
|
public Iva getIva() {
|
|
this.iva = (Iva)getSecondaryObject(this.iva, Iva.class, new Long(getId_iva()));
|
|
return this.iva;
|
|
}
|
|
|
|
public void setId_iva(long newId_iva) {
|
|
this.id_iva = newId_iva;
|
|
setIva(null);
|
|
}
|
|
|
|
public long getId_iva() {
|
|
return this.id_iva;
|
|
}
|
|
|
|
public void setIva(Iva iva) {
|
|
this.iva = iva;
|
|
}
|
|
|
|
public long getSiglaEpson() {
|
|
return this.siglaEpson;
|
|
}
|
|
|
|
public void setSiglaEpson(long siglaEpson) {
|
|
this.siglaEpson = siglaEpson;
|
|
}
|
|
}
|