getContext().getRequest().getSession(true).setAttribute("metC", met_cernerii);
return new ForwardResolution("/WEB-INF/jsp/metoda_cernerii.jsp");
}
public Resolution submit() {
IProbaDao probaDao = new ProbaDao();
//proba curenta
Proba proba = probaDao.geProbaByID(Integer.parseInt(getContext().getRequest().getSession().getAttribute("idProba").toString()));
//valori introduse
String x=getFormular().getVal0();
List<Float> valoriIntroduse = Arrays.asList(Float.parseFloat(getFormular().getVal0()), Float.parseFloat(getFormular().getVal1()), Float.parseFloat(getFormular().getVal2()), Float.parseFloat(getFormular().getVal3()), Float.parseFloat(getFormular().getVal4()), Float.parseFloat(getFormular().getVal5()), Float.parseFloat(getFormular().getVal6()), Float.parseFloat(getFormular().getVal7()), Float.parseFloat(getFormular().getVal8()), Float.parseFloat(getFormular().getVal9()), Float.parseFloat(getFormular().getVal10()), Float.parseFloat(getFormular().getVal11()), Float.parseFloat(getFormular().getVal12()), Float.parseFloat(getFormular().getVal13()), Float.parseFloat(getFormular().getVal14()), Float.parseFloat(getFormular().getVal15()), Float.parseFloat(getFormular().getVal16()), Float.parseFloat(getFormular().getVal17()));
//obiect format pt proba curenta cu valorile introduse pt introducere in BD
MetCernerii metCerneriiBO = new MetCernerii(proba, valoriIntroduse.get(0), valoriIntroduse.get(1), valoriIntroduse.get(2), valoriIntroduse.get(3), valoriIntroduse.get(4), valoriIntroduse.get(5), valoriIntroduse.get(6), valoriIntroduse.get(7), valoriIntroduse.get(8), valoriIntroduse.get(9), valoriIntroduse.get(10), valoriIntroduse.get(11), valoriIntroduse.get(12), valoriIntroduse.get(13), valoriIntroduse.get(14), valoriIntroduse.get(15), valoriIntroduse.get(16), valoriIntroduse.get(17));
IMetCerneriiDao metCerneriiDao = new MetCerneriiDao();
//daca s-a mai facut metoda cernerii pt proba curenta, atunci se v-a face update la tupla corespunzatoare,altfel se introduce
MetCernerii metCerneriiAuxiliar = metCerneriiDao.getMetCerneriiByIDProba(Integer.parseInt(getContext().getRequest().getSession().getAttribute("idProba").toString()));
if (metCerneriiAuxiliar == null) {
metCerneriiDao.saveOrUpdate(metCerneriiBO);
} else {
metCerneriiBO.setIdCernere(metCerneriiAuxiliar.getIdCernere());
metCerneriiDao.saveOrUpdate(metCerneriiBO);
}
//update la proba pt parametrii md si rs
proba.setMd(Float.parseFloat(getMdInput()));
proba.setRs(Float.parseFloat(getRsInput()));
probaDao.saveOrUpdate(proba);
met_cernerii = new MetodaCernerii();
//se modifica pt a afisa in pagina, noile valori introduse
MetCernerii metCerneriiDinBd = metCerneriiDao.getMetCerneriiByIDProba(proba.getIdProba());