Package bo

Examples of bo.Geolog


        if (admin != null) {
            getContext().getRequest().getSession(true).setAttribute("admin", admin.getIdAdmin());
            return new ForwardResolution(GeologiActionBean.class, "validareConturi");
        }
        IGeologDao geo = new GeologDao();
        Geolog geolog = geo.geologExistent(utilizator, parola);
        if (geolog != null) {
            if ((geolog.getConfirmare().equals("in asteptare"))||(geolog.getConfirmare().equals("refuzat"))) {
                getContext().getRequest().getSession(true).setAttribute("user", -2);
                return new ForwardResolution("/WEB-INF/jsp/home.jsp");
            } else {
                getContext().getRequest().getSession(true).setAttribute("user", geolog.getIdGeolog());
                return new ForwardResolution("/WEB-INF/jsp/geologLogat.jsp");
            }
        } else {
            getContext().getRequest().getSession(true).setAttribute("user", -1);
            return new ForwardResolution("/WEB-INF/jsp/home.jsp");
View Full Code Here


        return new ForwardResolution("/WEB-INF/jsp/inregistrare.jsp");
    }

    public Resolution submit() {
        IGeologDao geoDao = new GeologDao();
        Geolog geolog = geoDao.geologExistent(username, parola);
        if (geolog != null) {
            getContext().getRequest().getSession(true).setAttribute("user", geolog.getIdGeolog());
            return new ForwardResolution("/WEB-INF/jsp/geologLogat.jsp");
        } else {
            String confirmareVizibilitate;
            String acceptare = "in asteptare";
            if (getVizibilitate() == null) {
                confirmareVizibilitate = "nu";
            } else {
                confirmareVizibilitate = "da";
            }

            byte[] parolaB = parola.getBytes();
            try {
                MessageDigest algorithm = MessageDigest.getInstance("MD5");
                algorithm.reset();
                algorithm.update(parolaB);
                byte messageDigest[] = algorithm.digest();

                StringBuffer hexString = new StringBuffer();
                for (int i = 0; i < messageDigest.length; i++) {
                    hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
                }
                parola = hexString + "";
            } catch (Exception e) {
            }
            if (!isEmailValid(email)) {
                setEmailInvalid(true);
                return new ForwardResolution("/WEB-INF/jsp/inregistrare.jsp");
            }
            if (!isNumeric(telefon) || telefon.length() != 10) {
                setTelefonInvalid(true);
                return new ForwardResolution("/WEB-INF/jsp/inregistrare.jsp");
            }
            setGeologAdaugat(true);
            geoDao.saveOrUpdate(new Geolog(nume, prenume, telefon, email, adresa, username, parola, confirmareVizibilitate, acceptare));
            return new ForwardResolution("/WEB-INF/jsp/inregistrare.jsp");
        }
    }
View Full Code Here

        }
        return geologi;
    }

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

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

        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));
View Full Code Here

            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

        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();
View Full Code Here

        return new ForwardResolution("/WEB-INF/jsp/datePersonale.jsp");
    }

    public Resolution submit() {
        IGeologDao geologDao = new GeologDao();
        Geolog g;
        int i;
        if (getValidareR() != null) {
            for (i = 0; i < getValidareR().size(); i++) {
                g = geologDao.getGeologByID(Integer.parseInt(getValidareR().get(i).toString()));
                g.setConfirmare("acceptat");
                geologDao.saveOrUpdate(g);
            }
        }
        if (getRefuzareR() != null) {
            for (i = 0; i < getRefuzareR().size(); i++) {
                g = geologDao.getGeologByID(Integer.parseInt(getRefuzareR().get(i).toString()));
                g.setConfirmare("refuzat");
                geologDao.saveOrUpdate(g);
            }
        }
        // pt popularea listei pt stergere
        geologiPtStergere = geologDao.getGeologiPtStergere();
View Full Code Here

        } else { //daca sunt proiecte publice
            IGeologDao geologDao = new GeologDao();
            List<Geolog> geologi = geologDao.geologiPublici();
            Iterator it = geologi.iterator();
            while (it.hasNext()) {
                Geolog geolog = (Geolog) it.next();
                amplasamente = amplasamentDao.getAmplasamenteByBeneficiarIdAndGeologId(idB, geolog.getIdGeolog());
            }


        }
//        List<Amplasament> amplasamente;
View Full Code Here

        return foraje;
    }

    private List<Beneficiar> getBeneficiariPublici() {
        List<Beneficiar> beneficiari = new ArrayList<Beneficiar>();
        Geolog geolog;
        Beneficiar beneficiar;
        List<Integer> idbeneficiari = new ArrayList<Integer>();
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
        IGeologDao geologDao = new GeologDao();
        List<Geolog> geologi = geologDao.geologiPublici();
        if (geologi != null) {
            Iterator it = geologi.iterator();
            while (it.hasNext()) {
                geolog = (Geolog) it.next();
                idbeneficiari = geologBeneficiarDao.getGeologBeneficiariByGeologId(geolog.getIdGeolog());
                if (idbeneficiari != null) {
                    for (int i = 0; i < idbeneficiari.size(); i++) {
                        beneficiar = beneficiarDao.getBeneficiarByID(idbeneficiari.get(i));
                        beneficiari.add(beneficiar);
                    }
View Full Code Here

TOP

Related Classes of bo.Geolog

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.