113 lines
2.8 KiB
Java
113 lines
2.8 KiB
Java
|
|
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.Vectumerator;
|
||
|
|
import java.io.Serializable;
|
||
|
|
import java.sql.PreparedStatement;
|
||
|
|
import java.sql.SQLException;
|
||
|
|
|
||
|
|
public class Armatura extends DBAdapter implements Serializable {
|
||
|
|
private static final long serialVersionUID = 1468228167115L;
|
||
|
|
|
||
|
|
private long id_armatura;
|
||
|
|
|
||
|
|
private String descrizione;
|
||
|
|
|
||
|
|
private long numLicci;
|
||
|
|
|
||
|
|
private long numColpi;
|
||
|
|
|
||
|
|
private long partenza;
|
||
|
|
|
||
|
|
public Armatura(ApplParmFull newApplParmFull) {
|
||
|
|
super(newApplParmFull);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Armatura() {}
|
||
|
|
|
||
|
|
public long getId_armatura() {
|
||
|
|
return this.id_armatura;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setId_armatura(long id_armatura) {
|
||
|
|
this.id_armatura = id_armatura;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setDescrizione(String descrizione) {
|
||
|
|
this.descrizione = descrizione;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getDescrizione() {
|
||
|
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected ResParm checkDeleteCascade() {
|
||
|
|
return new ResParm(true);
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void deleteCascade() {}
|
||
|
|
|
||
|
|
public Vectumerator<Armatura> findByCR(ArmaturaCR CR, int pageNumber, int pageRows) {
|
||
|
|
String s_Sql_Find = "select A.* from ARMATURA AS A";
|
||
|
|
String s_Sql_Order = "";
|
||
|
|
WcString wc = new WcString();
|
||
|
|
if (!CR.getSearchTxt().trim().isEmpty())
|
||
|
|
wc.addWc("A.descrizione like '%" + CR.getSearchTxt().trim() + "%'");
|
||
|
|
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 long getNumLicci() {
|
||
|
|
return this.numLicci;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setNumLicci(long numLicci) {
|
||
|
|
this.numLicci = numLicci;
|
||
|
|
}
|
||
|
|
|
||
|
|
public long getNumColpi() {
|
||
|
|
return this.numColpi;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setNumColpi(long numColpi) {
|
||
|
|
this.numColpi = numColpi;
|
||
|
|
}
|
||
|
|
|
||
|
|
public long getPartenza() {
|
||
|
|
return this.partenza;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setPartenza(long partenza) {
|
||
|
|
this.partenza = partenza;
|
||
|
|
}
|
||
|
|
|
||
|
|
public ResParm salvaDettaglio(Vectumerator<ArmaturaDettaglio> vec) {
|
||
|
|
ResParm rp = new ResParm(true);
|
||
|
|
while (vec.hasMoreElements()) {
|
||
|
|
ArmaturaDettaglio row = (ArmaturaDettaglio)vec.nextElement();
|
||
|
|
rp = row.save();
|
||
|
|
}
|
||
|
|
return rp;
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean isCellaSelezionata(long riga, long colonna) {
|
||
|
|
boolean ret = false;
|
||
|
|
ArmaturaDettaglio row = new ArmaturaDettaglio(getApFull());
|
||
|
|
row.findByArmaturaRiga(getId_armatura(), riga);
|
||
|
|
if (row.getDBState() == 1) {
|
||
|
|
String col = row.getArmaturaRiga().substring((int)colonna - 1, (int)colonna);
|
||
|
|
if (col.equals("1"))
|
||
|
|
ret = true;
|
||
|
|
}
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
}
|