getContext().getRequest().getSession(true).setAttribute("compresibilitate", getTabel(proba.getIdProba()));
return new ForwardResolution("/WEB-INF/jsp/compresibilitate.jsp");
}
public Resolution adauga() {
ICompresibilitateDao compDao = new CompresibilitateDao();
IProbaDao probaDao = new ProbaDao();
Proba proba = probaDao.geProbaByID(Integer.parseInt(getContext().getRequest().getSession().getAttribute("idProba").toString()));
if (getButonRadio() == null) {
setRadioNeselectat(true);
return new ForwardResolution("/WEB-INF/jsp/compresibilitate.jsp");
} else if (getButonRadio().equals("1")) {
if ((getAn_nou() == null) || (getLuna_nou() == null) || (getZi_nou() == null) || (getOra_nou() == null) || (getMinut_nou() == null) || (getSarcina_nou() == null) || (getCitire_nou() == null)) {
setCampuriNecompletate(true);
return new ForwardResolution("/WEB-INF/jsp/compresibilitate.jsp");
} else {
Date data = Date.valueOf(getAn_nou() + "-" + getLuna_nou() + "-" + getZi_nou());
Time timp = new Time(Integer.parseInt(getOra_nou()), Integer.parseInt(getMinut_nou()), 0);
Compresibilitate comp = new Compresibilitate(proba, data, timp, Float.parseFloat(getSarcina_nou()), Float.parseFloat(getCitire_nou()));
compDao.saveOrUpdate(comp);
}
} else if (getButonRadio().equals("2")) {
if ((getOra_modif() == null) || (getMinut_modif() == null) || (getSarcinaFilter() == null) || (getCitire_modif() == null) || (getDataFilter() == null)) {
setCampuriNecompletate(true);
return new ForwardResolution("/WEB-INF/jsp/compresibilitate.jsp");
} else {
Date data = Date.valueOf(getDataFilter());
Time timp = new Time(Integer.parseInt(getOra_modif()), Integer.parseInt(getMinut_modif()), 0);
float sarcina=compDao.getCompresibilitateByID(Integer.parseInt(getSarcinaFilter())).getSarcina();
Compresibilitate comp = new Compresibilitate(proba, data, timp, sarcina, Float.parseFloat(getCitire_modif()));
compDao.saveOrUpdate(comp);
}
}
getContext().getRequest().getSession(true).setAttribute("compresibilitate", getTabel(proba.getIdProba()));
return new ForwardResolution("/WEB-INF/jsp/compresibilitate.jsp");
}