Package net.caece.pri.hibernate

Examples of net.caece.pri.hibernate.Auth


        refreshObjEntities();
    }

    public void add() {
        Auth obj = (Auth) viewToObj(null);
        AuthDao dao = new AuthDao();
        add(dao, obj);
    }
View Full Code Here


        AuthDao dao = new AuthDao();
        add(dao, obj);
    }

    public void delete() {
        Auth obj = (Auth) objListbox.getSelectedItem().getValue();
        AuthDao dao = new AuthDao();
        delete(dao, obj);

        // empty all fields
        Auth emptyObj = new Auth();
        objToView(emptyObj);
    }
View Full Code Here

        Auth emptyObj = new Auth();
        objToView(emptyObj);
    }

    public void objToView(Object obj) {
        Auth var = (Auth) obj;

        Textbox authNameTB = (Textbox) getFellow("authName");
        Textbox authDescTB = (Textbox) getFellow("authDescription");
        Radiogroup editable = (Radiogroup) getFellow("editable");

        authNameTB.setText(var.getAuthName());
        authDescTB.setText(var.getAuthDescription());

        Iterator it = editable.getItems().iterator();
        while (it.hasNext()) {
            Radio radio = (Radio) it.next();
            if (radio.getValue().equals(var.getEditable())) {
                radio.setChecked(true);
            }
        }
    }
View Full Code Here

    public void refreshObjEntities() {
        refreshObjEntities("Auth.getAll", objListRenderer);
    }

    public void update() {
        Auth obj = (Auth) objListbox.getSelectedItem().getValue();
        System.out.print("authName:" + obj.getAuthName() + ", authType:" + obj.getAuthType() + ", editable:" + obj.getEditable()
                + ", authDesc:" + obj.getAuthDescription() + ", operateBy:" + obj.getOperateBy() + ", operateAt" + obj.getOperateAt().toString());
        AuthDao dao = new AuthDao();
        update(dao, obj);
    }
View Full Code Here

    public boolean validate() {
        return true;
    }

    public Object viewToObj(Object obj) {
        Auth var = new Auth();

        if (obj != null) {
            try {
                BeanUtils.copyProperties(var, obj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        var.setOperateBy(operateBy);

        Textbox authNameTB = (Textbox) getFellow("authName");
        Textbox authTypeTB = (Textbox) getFellow("authType");
        Textbox unitIDTB = (Textbox) getFellow("unitId");
        Textbox authDescTB = (Textbox) getFellow("authDescription");
        Radiogroup editable = (Radiogroup) getFellow("editable");

        var.setAuthName(authNameTB.getText());
        var.setAuthType(authTypeTB.getText());
        var.setUnitId(unitIDTB.getText());
        var.setAuthDescription(authDescTB.getText());
        var.setEditable(editable.getSelectedItem().getValue());

        return var;
    }
View Full Code Here

TOP

Related Classes of net.caece.pri.hibernate.Auth

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.