Package bo

Examples of bo.Strat


    }

    public Resolution salveaza() {

        IForajDao forajDao = new ForajDao();
        Strat strat = new Strat();
        try {
            float a = Float.valueOf(getAdancime().trim()).floatValue();
            strat.setAdancime(a);
            float n = Float.valueOf(getNivelHidrostatic().trim()).floatValue();
            strat.setNivelHidrostatic(n);
            String descriere = getDescriere1Filter() + " " + getDescriere2Filter() + " " + getDescriere3Filter() + " " + getDescriere4Filter();
            if (getAlteCaracteristici() != null) {
                descriere += " " + getAlteCaracteristici();
            }
            strat.setDescriere(descriere);
            try {
                Object f = getContext().getRequest().getSession(true).getAttribute("idForajCurent");
                if (f != null) {
                    int fI = Integer.parseInt(f.toString());
                    if (fI > 0) {
                        Foraj foraj = forajDao.getForajByID(fI);
                        strat.setForaj(foraj);
                        IStratDao stratDao = new StratDao();
                        stratDao.saveOrUpdate(strat);
                    }
                }
View Full Code Here


        }
        return strat;
    }

    public Strat geStratByID(int idStrat) {
        Strat strat = null;
        try {
            this.session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            org.hibernate.Transaction tx = session.beginTransaction();
            strat = (Strat) session.get(Strat.class, idStrat);
        } catch (Exception e) {
View Full Code Here

    public void delete(int idStrat) {
        try {
            this.session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            org.hibernate.Transaction tx = session.beginTransaction();
            Strat strat = (Strat) session.get(Strat.class, idStrat);
            session.delete(strat);
            tx.commit();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

    public void addNrStrat(int idStrat, int nrStrat) {
        try {
            this.session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            org.hibernate.Transaction tx = session.beginTransaction();
            Strat strat = (Strat) session.get(Strat.class, idStrat);
            strat.setNumarStrat(nrStrat);
            session.update(strat);
            tx.commit();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        IProbaDao probaDao = new ProbaDao();
        IForajDao forajDao = new ForajDao();
        int i = 0, j = 0;
        float adancimeProba = 0, adancimeStrat = 0, adancimeStratAnterior = 0;
        Proba probaCurenta = null;
        Strat stratCurent = null;
        try {
            setIdForajCurent(Integer.parseInt(forajFilter));
        } catch (Exception e) {
        }
        if (getIdForajCurent() > 0) {
            cota = forajDao.getForajByID(getIdForajCurent()).getCota().toString();
        }
        List<Strat> straturi = stratDao.getAll(getIdForajCurent());
        int nrStraturi = straturi.size();
        List<Proba> probe = probaDao.getAll(getIdForajCurent());
        int nrProbe = probe.size();
        i = 0;
        DatePtVizForaj d = null;
        while (i < nrStraturi) {
            d = new DatePtVizForaj();
            stratCurent = straturi.get(i);
            if (j < nrProbe) {
                probaCurenta = probe.get(j);
                adancimeProba = probaCurenta.getAdancime();
            } else {
                adancimeProba = 1000;
            }
            adancimeStrat = stratCurent.getAdancime();
            if (adancimeProba < adancimeStrat) {
                probaDao.addNrProba(probaCurenta.getIdProba(), j);
                d.setNrProba(Integer.toString(j));
                d.setAdancime(probaCurenta.getAdancime().toString());
                if (probaCurenta.getArgila() != null) {
                    d.setArgila(probaCurenta.getArgila().toString());
                }
                if (probaCurenta.getPraf() != null) {
                    d.setPraf(probaCurenta.getPraf().toString());
                }
                if (probaCurenta.getNisip() != null) {
                    d.setNisip(probaCurenta.getNisip().toString());
                }
                if (probaCurenta.getPietris() != null) {
                    d.setPietris(probaCurenta.getPietris().toString());
                }
                if (probaCurenta.getW() != null) {
                    d.setW(probaCurenta.getW().toString());
                }
                if (probaCurenta.getWl() != null) {
                    d.setwL(probaCurenta.getWl().toString());
                }
                if (probaCurenta.getWp() != null) {
                    d.setwP(probaCurenta.getWp().toString());
                }
                if (probaCurenta.getIp() != null) {
                    d.setIp(probaCurenta.getIp().toString());
                }
                if (probaCurenta.getIc() != null) {
                    d.setIc(probaCurenta.getIc().toString());
                }
                if (probaCurenta.getY() != null) {
                    d.setY(probaCurenta.getY().toString());
                }
                if (probaCurenta.getYd() != null) {
                    d.setYd(probaCurenta.getYd().toString());
                }
                if (probaCurenta.getN() != null) {
                    d.setN(probaCurenta.getN().toString());
                }
                if (probaCurenta.getEmic() != null) {
                    d.setEmic(probaCurenta.getEmic().toString());
                }
                if (probaCurenta.getM0() != null) {
                    d.setM0(probaCurenta.getM0().toString());
                }
                if (probaCurenta.getUl() != null) {
                    d.setUl(probaCurenta.getUl().toString());
                }
                if (probaCurenta.getYdmax() != null) {
                    d.setYdmax(probaCurenta.getYdmax().toString());
                }
                if (probaCurenta.getE() != null) {
                    d.setE(probaCurenta.getE().toString());
                }
                if (probaCurenta.getE100() != null) {
                    d.setE100(probaCurenta.getE100().toString());
                }
                if (probaCurenta.getE200() != null) {
                    d.setE200(probaCurenta.getE200().toString());
                }
                if (probaCurenta.getE300() != null) {
                    d.setE300(probaCurenta.getE300().toString());
                }
                if (probaCurenta.getIm3() != null) {
                    d.setIm3(probaCurenta.getIm3().toString());
                }
                if (probaCurenta.getTipulIncercarii() != null) {
                    d.setTempIncercarii(probaCurenta.getTipulIncercarii().toString());
                }
                if (probaCurenta.getViteza() != null) {
                    d.setViteza(probaCurenta.getViteza().toString());
                }
                if (probaCurenta.getO() != null) {
                    d.setO(probaCurenta.getO().toString());
                }
                if (probaCurenta.getC() != null) {
                    d.setC(probaCurenta.getC().toString());
                }
                j++;
            } else {
                d.setAdancime(Float.toString(adancimeStrat));
                //grosime
                d.setGrosime(Float.toString(adancimeStrat - adancimeStratAnterior));
                stratDao.addNrStrat(stratCurent.getIdStrat(), i);
                d.setNrStrat(Integer.toString(i));
                adancimeStratAnterior = adancimeStrat;
                d.setNivelHidrostatic(stratCurent.getNivelHidrostatic().toString());
                d.setDescriereStrat(stratCurent.getDescriere());
                i++;
            }
            date.add(d);
        }
        return new ForwardResolution("/WEB-INF/jsp/vizualizareForaj.jsp");
View Full Code Here

TOP

Related Classes of bo.Strat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.