Package daoI

Examples of daoI.IGeologDao


        Admin admin = adminDao.adminExistent(utilizator, parola);
        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 {
View Full Code Here


    public Resolution inregistrare() {
        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

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

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

     geologBeneficiarDao.delete(idGeologSef, idBeneficiar);
     proiectDao.delete(idProiect);
     return new ForwardResolution("/WEB-INF/jsp/geologLogat.jsp");
}
    public List<Geolog> getGeologi() {
        IGeologDao geologDao = new GeologDao();
        List<Geolog> geologi = geologDao.getAll();
        return geologi;
    }
View Full Code Here

    public List<ProiecteGeologSef> getProiecteGeologSef() {
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        IProiectDao proiectDao = new ProiectDao();
        IAmplasamentDao amplasamentDao = new AmplasamentDao();
        IGeologDao geologDao = new GeologDao();
        Proiect p;
        ProiecteGeologSef proiect;
        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);
View Full Code Here

                        amplasamente.add(amplasament);
                    }
                }
            }
        } 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());
            }
View Full Code Here

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

        return geologi;
    }

    @DefaultHandler
    public Resolution afisareGeologi() {
        IGeologDao geolog = new GeologDao();
        geologi = geolog.getAll();
        return new ForwardResolution("/WEB-INF/jsp/geologi.jsp");
    }
View Full Code Here

        geologi = geolog.getAll();
        return new ForwardResolution("/WEB-INF/jsp/geologi.jsp");
    }

    public Resolution validareConturi() {
        IGeologDao geolog = new GeologDao();
        geologiIA = geolog.getAllNVGeo();
        return new ForwardResolution("/WEB-INF/jsp/validareConturi.jsp");
    }
View Full Code Here

TOP

Related Classes of daoI.IGeologDao

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.