Package bo

Examples of bo.Amplasament


            float c = Float.valueOf(cota.trim()).floatValue();
            foraj.setCota(c);
            foraj.setNumeForaj(nume);
            try {
                int amplasamentID = Integer.parseInt(amplasamentFilter);
                Amplasament amplasament = amplasamentDao.getAmplasamentByID(amplasamentID);
                foraj.setAmplasament(amplasament);
                IForajDao forajDao = new ForajDao();
                forajDao.saveOrUpdate(foraj);
                setIdAmplasamentCurent(amplasamentID);
                getContext().getRequest().getSession(true).setAttribute("idAmplasamentCurent", amplasamentID);
View Full Code Here


    }

    public String getAmplasamentSelectat() {
        if (getIdAmplasamentCurent() > 0) {
            AmplasamentDao amplasamentDao = new AmplasamentDao();
            Amplasament a = amplasamentDao.getAmplasamentByID(getIdAmplasamentCurent());
            return a.getLocatie();
        }
        return "";
    }
View Full Code Here

public class AmplasamentDao implements IAmplasamentDao {

    Session session = null;

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

        }
    }

    public void delete(int idAmplasament) {
        List<Amplasament> list = null;
        Amplasament a = null;
        try {
            this.session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            org.hibernate.Transaction tx = session.beginTransaction();
            Query q = session.createQuery("from Amplasament as amplasament where amplasament.idAmplasament='" + idAmplasament + "' ");
View Full Code Here

        return amplasamente;
    }

    public Amplasament getLastAmplasament() {
        List<Amplasament> amplasamente = null;
        Amplasament amplasament = null;
        try {
            this.session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            org.hibernate.Transaction tx = session.beginTransaction();
            Query q = session.createQuery("from Amplasament ");
View Full Code Here

    public Resolution adauga() {
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        Beneficiar beneficiar = beneficiarDao.getBeneficiarByID(Integer.parseInt(getBeneficiarFilter()));
        IOrasDao orasDao = new OrasDao();
        Oras oras = orasDao.getOrasByID(Integer.parseInt(getOrasFilter()));
        Amplasament amplasament = new Amplasament();
        amplasament.setBeneficiar(beneficiar);
        amplasament.setOras(oras);
        amplasament.setLocatie(getLocatie());
        amplasament.setIdGeolog(getIdGeologLogat());
        setAmplasamentAdaugat(true);
        IAmplasamentDao amplasamentDao = new AmplasamentDao();
        amplasamentDao.saveOrUpdate(amplasament);
        return new ForwardResolution("/WEB-INF/jsp/adaugaAmplasament.jsp");
    }
View Full Code Here

        //adaugam amplasamentul
        int idProiect = ((Proiect) getContext().getRequest().getSession().getAttribute("proiectInLucru")).getIdProiect();
        IOrasDao orasDao = new OrasDao();
        Oras oras = orasDao.getOrasByID(Integer.parseInt(getOrasFilter()));
        Amplasament amplasament = new Amplasament();
        amplasament.setBeneficiar(beneficiar);
        amplasament.setOras(oras);
        amplasament.setLocatie(getLocatie());
        amplasament.setIdGeolog(idGeolog);
        amplasament.setIdProiect(idProiect);
        setAmplasamentAdaugat(true);
        IAmplasamentDao amplasamentDao = new AmplasamentDao();
        amplasamentDao.saveOrUpdate(amplasament);

        //restul pentru afisarea in tabel
View Full Code Here

        } else {
           
               int idAmplasament = Integer.parseInt(getButonRadio());
            int idBeneficiar = ((Beneficiar) getContext().getRequest().getSession().getAttribute("beneficiarProiect")).getIdBeneficiar();
            IAmplasamentDao amplasamentDao = new AmplasamentDao();
            Amplasament amplasament=amplasamentDao.getAmplasamentByID(idAmplasament);
            amplasamentDao.delete(idAmplasament);
            IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
            int idGeolog = amplasament.getIdGeolog();
            geologBeneficiarDao.delete(idGeolog, idBeneficiar);

            IGeologDao geologDao = new GeologDao();
            Geolog geolog = geologDao.getGeologByID(idGeolog);

            RepartizareProiect repartizareProiect = (RepartizareProiect) getContext().getRequest().getSession().getAttribute("repartizareAmplasamente");
            List<Integer> auxA = new ArrayList<Integer>();
            List<Geolog> auxN = new ArrayList<Geolog>();
            List<String> auxO = new ArrayList<String>();
            List<String> auxL = new ArrayList<String>();

             auxA.addAll(repartizareProiect.getIdAmplasament());
            auxN.addAll(repartizareProiect.getGeolog());
             auxO.addAll(repartizareProiect.getOras());
             auxL.addAll(repartizareProiect.getLocatie());

            int aux = 1, pozitie = -1;
            Iterator it = auxN.iterator();
            while (it.hasNext() && aux == 1) {
                pozitie++;
                Geolog g = (Geolog) it.next();
                if (g.getIdGeolog() == amplasament.getIdGeolog() && (auxO.get(pozitie).equals(amplasament.getOras().getNumeOras()) )&& (auxL.get(pozitie).equals(amplasament.getLocatie()) )) {
                    aux = 0;
                }
            }

            auxA.remove(pozitie);
View Full Code Here

     int idGeologSef=proiectDao.getProiectByID(idProiect).getIdGeolog();
     int idBeneficiar=proiectDao.getProiectByID(idProiect).getIdBeneficiar();
     List<Amplasament> amplasamente=amplasamentDao.getAmplasamenteByProiectId(idProiect);
     Iterator it=amplasamente.iterator();
     while(it.hasNext()){
         Amplasament amplasament=(Amplasament)it.next();
         geologBeneficiarDao.delete(amplasament.getIdGeolog(), idBeneficiar);
         amplasamentDao.delete(amplasament.getIdAmplasament());
     }
     geologBeneficiarDao.delete(idGeologSef, idBeneficiar);
     proiectDao.delete(idProiect);
     return new ForwardResolution("/WEB-INF/jsp/geologLogat.jsp");
}
View Full Code Here

        RepartizareProiect repartizareProiect;
        List<Amplasament> amplasamente;
        List<Geolog> geologi;
        List<String> orase;
        List<String> locatii;
        Amplasament amplasament;
        Geolog geolog;
        String oras, locatie;
        List<ProiecteGeologSef> proiecteGeologSef = new ArrayList<ProiecteGeologSef>();

        List<Proiect> proiecte = proiectDao.getProiecteByGeologId(getIdGeologLogat());
        Iterator it = proiecte.iterator();
        while (it.hasNext()) {
            p = (Proiect) it.next();
            proiect = new ProiecteGeologSef();
            proiect.setNumeProiect(p.getNumeProiect()); //nume proiect
            //nume beneficiar
            proiect.setNumeBeneficiar(beneficiarDao.getBeneficiarByID(p.getIdBeneficiar()).getNumeBeneficiar());
            // determinam amplasamentele pt un proiect
            amplasamente = amplasamentDao.getAmplasamenteByProiectId(p.getIdProiect());
            repartizareProiect = new RepartizareProiect();
            geologi = new ArrayList<Geolog>();
            orase = new ArrayList<String>();
            locatii = new ArrayList<String>();

            for (int i = 0; i < amplasamente.size(); i++) {
                amplasament = amplasamente.get(i);
                geolog = geologDao.getGeologByID(amplasament.getIdGeolog());
                oras = amplasament.getOras().getNumeOras();
                locatie = amplasament.getLocatie();
                geologi.add(geolog);
                orase.add(oras);
                locatii.add(locatie);
            }
            repartizareProiect.setGeolog(geologi);
View Full Code Here

TOP

Related Classes of bo.Amplasament

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.