Package net.caece.pri.hibernate

Examples of net.caece.pri.hibernate.Fun


        return subList;
    }

    public void addFun() {
        Fun myfun = new Fun();
        myfun.setFunType("W");
        myfun.setFunType(FUN_TYPE_WEB);



        /*
        FunDao dao = new FunDao();
View Full Code Here


        }
    }

    public void add() {
        // insert into database
        Fun obj = (Fun) viewToObj(null);

        objTree = (Tree) getFellow("objTree");

        if (objTree.getSelectedItem() != null) {
            SimpleTreeNode node = (SimpleTreeNode) objTree.getSelectedItem().getValue();
            int parentLevel = objTree.getSelectedItem().getLevel();
            int currentLayerSeq = objTree.getSelectedItem().getChildren().size();
            Fun parent = (Fun) node.getData();
            obj.setFun(parent);

            //layer
            obj.setLayer((parentLevel + 1) + "");
            obj.setLayerSeq((currentLayerSeq + 1) + "");
View Full Code Here

    }

    //ck
    public void update() {
        FunForm var = null;
        Fun parentFun = null;

        objTree = (Tree) getFellow("objTree");
        if (objTree.getSelectedItem() != null) {
            SimpleTreeNode node = (SimpleTreeNode) objTree.getSelectedItem().getValue();
            var = (FunForm) node.getData();

            Treeitem parentItem = objTree.getSelectedItem().getParentItem();

            FunForm parentFunForm = null;
            if (parentItem != null) {
                SimpleTreeNode parentNode = (SimpleTreeNode) parentItem.getValue();
                parentFunForm = (FunForm) parentNode.getData();
            } else {
                parentFunForm = (FunForm) node.getData();
            }
            parentFun = new Fun();
            try {
                BeanUtils.copyProperties(parentFun, parentFunForm);
            } catch (Exception iae) {
                iae.printStackTrace();
            }
        }


        Fun obj = (Fun) viewToObj(var);
        obj.setFun(parentFun);

        FunDao dao = new FunDao();
        dao.update(obj);

        refreshObjEntities();
View Full Code Here

        refreshObjEntities();
    }

    private Fun getById(int funId) {
        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        Fun fun = (Fun) sess.selectOne("Fun.getById", funId);
        sess = null;
        return fun;
    }
View Full Code Here

                this.showMsg("還有下屬功能, 請先刪除", "必要的操作");
                return;
            }
        }

        Fun obj = (Fun) viewToObj(var);

        FunDao dao = new FunDao();
        dao.delete(obj);

        refreshObjEntities();
View Full Code Here

        objTree.setTreeitemRenderer(objTreeRenderer);

    }

    public Object viewToObj(Object obj) {
        Fun var = new Fun();
        if (obj != null) {
            try {
                BeanUtils.copyProperties(var, obj);
            } catch (Exception iae) {
                iae.printStackTrace();
            }
        }
        var.setOperateBy(operateBy);

        Combobox ServiceCB = (Combobox) getFellow("service");
        Textbox FunNameTB = (Textbox) getFellow("FunName");
        Combobox BootFlag = (Combobox) getFellow("BootFlag");
        Combobox ActiveFlag = (Combobox) getFellow("ActiveFlag");



        Textbox FunPathTB = (Textbox) getFellow("FunPathTB");

        Service service = (Service) ServiceCB.getSelectedItem().getValue();
        var.setService(service);

        var.setFunName(FunNameTB.getText());
        var.setActiveFlag(ActiveFlag.getSelectedItem().getValue().toString());
        var.setBootFlag(BootFlag.getSelectedItem().getValue().toString());




        List operationsLists = ParaCache.getInstance().getByCatalogue("pri.Fun.operations");

        StringBuffer sb = new StringBuffer();
        Iterator it = operationsLists.iterator();

        int firstCount = 0;
        while (it.hasNext()) {
            Para para = (Para) it.next();
            Checkbox cb = (Checkbox) getFellow("checkbox_" + para.getParaName());
            if (cb.isChecked()) {
                if (firstCount != 0) {
                    sb.append(":");
                }
                sb.append(cb.getValue());
            }
            firstCount++;
        }
        var.setOperations(sb.toString());


        var.setFunPath(FunPathTB.getText());

        //internal parameters
        var.setFunType("W");
        var.setFunCode("FM-II");

        return var;
    }
View Full Code Here

TOP

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

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.