Package bo

Examples of bo.Admin


        }
        return null;
    }

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


        if (parola == null || utilizator == null) {
            getContext().getRequest().getSession(true).setAttribute("user", -3);
            return new ForwardResolution("/WEB-INF/jsp/home.jsp");
        }
        IAdminDao adminDao = new AdminDao();
        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) {
View Full Code Here

    }

    public Resolution datePersonale() {
        IAdminDao adminDao = new AdminDao();
        int idAdmin = Integer.parseInt(getContext().getRequest().getSession(true).getAttribute("admin").toString());
        Admin adminC = adminDao.getAdminByID(idAdmin);
        parolaVeche = adminC.getParola();
        setAdmin(adminC);
        return new ForwardResolution("/WEB-INF/jsp/adminDatePersonale.jsp");
    }
View Full Code Here

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

    public Resolution submitDatePersonale() {
        IAdminDao adminDao = new AdminDao();
        Admin adminC = getAdmin();
        if (adminC.getParola().equals(getParolaVeche())) {
            adminDao.saveOrUpdate(adminC);
        } else {
            byte[] parolaB = adminC.getParola().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]));
                }
                adminC.setParola(hexString + "");

                adminDao.saveOrUpdate(adminC);
            } catch (Exception e) {
            }
        }
View Full Code Here

TOP

Related Classes of bo.Admin

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.