Package bo

Examples of bo.Oras


 

    public Oras getOrasByID(int orasID) {

        Oras oras = null;
        try {
            this.session = (Session) HibernateUtil.getSessionFactory().getCurrentSession();
            org.hibernate.Transaction tx = session.beginTransaction();
            oras = (Oras) session.get(Oras.class, orasID);
        } catch (Exception e) {
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());
View Full Code Here

        geologBeneficiarDao.saveOrUpdate(new GeologBeneficiar(idGeolog, idBeneficiar));

        //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
        //numele geologului caruia i s-a repartizat amplasamentul
        IGeologDao geologDao = new GeologDao();
        Geolog geolog = geologDao.getGeologByID(idGeolog);
        RepartizareProiect repartizareProiect = (RepartizareProiect) getContext().getRequest().getSession().getAttribute("repartizareAmplasamente");
        if (repartizareProiect == null) {
            RepartizareProiect repartizareP = new RepartizareProiect();
            repartizareP.setIdAmplasament(Arrays.asList(amplasamentDao.getLastAmplasament().getIdAmplasament()));
            repartizareP.setGeolog(Arrays.asList(geolog));
            repartizareP.setOras(Arrays.asList(oras.getNumeOras()));
            repartizareP.setLocatie(Arrays.asList(getLocatie()));
            getContext().getRequest().getSession(true).setAttribute("repartizareAmplasamente", repartizareP);
        } else {
            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());
            auxA.add(amplasamentDao.getLastAmplasament().getIdAmplasament());
            repartizareProiect.setIdAmplasament(auxA);

            auxN.addAll(repartizareProiect.getGeolog());
            auxN.add(geolog);
            repartizareProiect.setGeolog(auxN);

            auxO.addAll(repartizareProiect.getOras());
            auxO.add(oras.getNumeOras());
            repartizareProiect.setOras(auxO);

            auxL.addAll(repartizareProiect.getLocatie());
            auxL.add(getLocatie());
            repartizareProiect.setLocatie(auxL);
View Full Code Here

TOP

Related Classes of bo.Oras

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.