Package dao

Examples of dao.BeneficiarDao


        return false;
    }

    public String getBeneficiarSelectat() {
        if (getIdBeneficiarCurent() > 0) {
            BeneficiarDao beneficiarDao = new BeneficiarDao();
            String b = beneficiarDao.getPersonByID(getIdBeneficiarCurent());
            return b;
        }
        return "";
    }
View Full Code Here


    public List<Beneficiar> getBeneficiari() {
        List<Beneficiar> beneficiari = new ArrayList<Beneficiar>();
        int idGeolog = getIdGeologLogat();
        IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
        List<Integer> idBeneficiari = geologBeneficiarDao.getGeologBeneficiariByGeologId(idGeolog);
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        Iterator it = idBeneficiari.iterator();
        while (it.hasNext()) {
            Integer idBeneficiar = (Integer) it.next();
            Beneficiar beneficiar = beneficiarDao.getBeneficiarByID(idBeneficiar);
            beneficiari.add(beneficiar);
        }
        if (getIdBeneficiarCurent() == 0) {
            setIdBeneficiarCurent(
                    beneficiari.get(0).getIdBeneficiar());
View Full Code Here

        return date;
    }

    @DefaultHandler
    public Resolution currentDate() {
        BeneficiarDao helper = new BeneficiarDao();
        date = helper.getPersonByID(1);
        return new ForwardResolution(VIEW);
    }
View Full Code Here

        date = helper.getPersonByID(1);
        return new ForwardResolution(VIEW);
    }

    public Resolution randomDate() {
        IBeneficiarDao helper = new BeneficiarDao();
        date = helper.getPersonByID(2);
        return new ForwardResolution(VIEW);
    }
View Full Code Here

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

    public Resolution submit() {
        int proiect = Integer.parseInt(getContext().getRequest().getSession().getAttribute("creazaProiect").toString());
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        if (proiect == 0) {
            if ((getNume() == null) || (getCnp() == null)) {
                setCampuriNecompletate(true);
                return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
            }
            if (cnp.length() != 13) {
                setCnpIncorect(true);
                return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
            } else if (!isNumeric(cnp)) {
                setCnpIncorect(true);
                return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
            }
            Beneficiar beneficiar = new Beneficiar(nume, cnp, mentiuni, null);
            beneficiarDao.saveOrUpdate(beneficiar);
            Beneficiar bAux = beneficiarDao.getBeneficiarCnp(cnp);
            int idGeolog = getIdGeologLogat();
            IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
            geologBeneficiarDao.saveOrUpdate(new GeologBeneficiar(idGeolog, bAux.getIdBeneficiar()));
            setBeneficiarAdaugat(true);
            return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
        } //daca cream un proiect
        else if (proiect == 1) {
            if (getBtnRadio() == null) {
                setRadioNeselectat(true);
                return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
            } else if (getBtnRadio().equals("1")) {
                Beneficiar beneficiarSelectat = beneficiarDao.getBeneficiarByID(Integer.parseInt(getSelectBeneficiarFilter()));
                IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
                int idGeolog = getIdGeologLogat();
                geologBeneficiarDao.saveOrUpdate(new GeologBeneficiar(idGeolog, beneficiarSelectat.getIdBeneficiar()));
                getContext().getRequest().getSession(true).setAttribute("beneficiarProiect", beneficiarSelectat);
                return new ForwardResolution("/WEB-INF/jsp/proiect.jsp");
            } else if (getBtnRadio().equals("2")) {
                if ((getNume() == null) || (getCnp() == null)) {
                    setCampuriNecompletate(true);
                    return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
                }
                if (cnp.length() != 13) {
                    setCnpIncorect(true);
                    return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
                } else if (!isNumeric(cnp)) {
                    setCnpIncorect(true);
                    return new ForwardResolution("/WEB-INF/jsp/adaugaBeneficiar.jsp");
                }
                Beneficiar beneficiar = new Beneficiar(nume, cnp, mentiuni, null);
                beneficiarDao.saveOrUpdate(beneficiar);
                Beneficiar bAux = beneficiarDao.getBeneficiarCnp(cnp);
                int idGeolog = getIdGeologLogat();
                IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
                geologBeneficiarDao.saveOrUpdate(new GeologBeneficiar(idGeolog, bAux.getIdBeneficiar()));
                getContext().getRequest().getSession(true).setAttribute("beneficiarProiect", bAux);
                return new ForwardResolution("/WEB-INF/jsp/proiect.jsp");
View Full Code Here

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

    public Resolution editare() {
        Beneficiar beneficiar = new Beneficiar();
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        beneficiar.setIdBeneficiar(Integer.parseInt(getBeneficiarFilter()));
        beneficiar.setCuiBeneficiar(getCnpEditare());
        beneficiar.setMentiuniBeneficiar(getMentiuniEditare());
        String numeB = beneficiarDao.getBeneficiarByID(Integer.parseInt(getBeneficiarFilter())).getNumeBeneficiar();
        beneficiar.setNumeBeneficiar(numeB);
        beneficiarDao.saveOrUpdate(beneficiar);
        setBeneficiarEditat(true);
        return new ForwardResolution("/WEB-INF/jsp/editareBeneficiar.jsp");
    }
View Full Code Here

    public List<Beneficiar> getBeneficiari() {
        List<Beneficiar> beneficiari = new ArrayList<Beneficiar>();
        int idGeolog = getIdGeologLogat();
        IGeologBeneficiarDao geologBeneficiarDao = new GeologBeneficiarDao();
        List<Integer> idBeneficiari = geologBeneficiarDao.getGeologBeneficiariByGeologId(idGeolog);
        IBeneficiarDao beneficiarDao = new BeneficiarDao();
        Iterator it = idBeneficiari.iterator();
        while (it.hasNext()) {
            Integer idBeneficiar = (Integer) it.next();
            Beneficiar beneficiar = beneficiarDao.getBeneficiarByID(idBeneficiar);
            beneficiari.add(beneficiar);
        }

        return beneficiari;
    }
View Full Code Here

    public String getMentiuniBeneficiar() {
        if (getBeneficiarFilter() == null) {
            return "";
        } else {
            IBeneficiarDao beneficiarDao = new BeneficiarDao();
            Beneficiar beneficiar = beneficiarDao.getBeneficiarByID(Integer.parseInt(getBeneficiarFilter()));
            return beneficiar.getMentiuniBeneficiar();
        }
    }
View Full Code Here

    public String getCnpBeneficiar() {
        if (getBeneficiarFilter() == null) {
            return "";
        } else {
            IBeneficiarDao beneficiarDao = new BeneficiarDao();
            Beneficiar beneficiar = beneficiarDao.getBeneficiarByID(Integer.parseInt(getBeneficiarFilter()));
            return beneficiar.getCuiBeneficiar();
        }
    }
View Full Code Here

    public Resolution view() {
        return new ForwardResolution("/WEB-INF/jsp/adaugaAmplasament.jsp");
    }

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

TOP

Related Classes of dao.BeneficiarDao

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.