Package net.caece.fmII.hibernate

Examples of net.caece.fmII.hibernate.Bom


   
    public void add() {

        // insert into database
        Bom obj = (Bom) viewToObj(null);
        Tree objTree = (Tree) getFellow("objTree");

        if (objTree.getSelectedItem() != null) {
            SimpleTreeNode node = (SimpleTreeNode) objTree.getSelectedItem().getValue();
            BomForm parentBomForm = (BomForm) node.getData();
            Bom parentBom = new Bom();
            try {
                BeanUtils.copyProperties(parentBom, parentBomForm);
            } catch (Exception iae) {
                iae.printStackTrace();
            }
View Full Code Here


                }
            }
        }

        // get new value from the view, then update to the database
        Bom obj = (Bom) viewToObj(form);
        BomDao dao = new BomDao();
        dao.update(obj);

        // refresh bom by building
        selectBomByBuilding();

        // set selected
        Collection items = objTree.getItems();
        Iterator it = items.iterator();
        while (it.hasNext()) {
            Treeitem item = (Treeitem) it.next();
            SimpleTreeNode node = (SimpleTreeNode) item.getValue();
            BomForm var = (BomForm) node.getData();

            if (var.getBomId().equals(obj.getBomId())) {
                objTree.setSelectedItem(item);
            }
        }

View Full Code Here

        }



        // get new value from the view, then update to the database
        Bom obj = (Bom) viewToObj(form);
        BomDao dao = new BomDao();
        dao.delete(obj);

        // refresh bom by building
        selectBomByBuilding();
View Full Code Here

    public boolean validate() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

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

        Listbox buildingListbox = (Listbox) getFellow("buildingListbox");
        Combobox equipmentCB = (Combobox) getFellow("equipment");

        Textbox floorTB = (Textbox) getFellow("floor");
        Textbox regionTB = (Textbox) getFellow("region");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Textbox propertyCodeTB = (Textbox) getFellow("propertyCode");
        Textbox descriptionTB = (Textbox) getFellow("description");

        Building building = (Building) buildingListbox.getSelectedItem().getValue();
        var.setBuilding(building);

        Equipment equ = (Equipment) equipmentCB.getSelectedItem().getValue();
        var.setEquipment(equ);

        var.setFloor(floorTB.getText());
        var.setRegion(regionTB.getText());
        var.setPriority(priorityCB.getSelectedItem().getValue().toString());
        var.setPropertyCode(propertyCodeTB.getText());
        var.setDescription(descriptionTB.getText());


        return var;
    }
View Full Code Here

TOP

Related Classes of net.caece.fmII.hibernate.Bom

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.