Package net.caece.fmII.hibernate

Examples of net.caece.fmII.hibernate.Supplier


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

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


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

    public void update() {
        Supplier obj = (Supplier) objListbox.getSelectedItem().getValue();
        SupplierDao dao = new SupplierDao();
        update(dao, obj);
    }
View Full Code Here

        update(dao, obj);
    }

    public void delete() {

        Supplier obj = (Supplier) objListbox.getSelectedItem().getValue();
        SupplierDao dao = new SupplierDao();
        delete(dao, obj);

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

        Map para = new HashMap();
        para.put("name", queryString);
        refreshObjEntities(para);

        // empty all fields , except the query condition field
        Supplier emptyObj = new Supplier();
        objToView(emptyObj);
        nameTB.setText(queryString);
    }
View Full Code Here

         */
        return isValid;
    }

    public Object viewToObj(Object supplier) {
        Supplier obj;
        if (supplier != null) {
            obj = (Supplier) supplier;
        } else {
            obj = new Supplier();
        }


        Textbox uniIdTB = (Textbox) getFellow("uniId");
        Textbox nameTB = (Textbox) getFellow("name");
        Textbox shortNameTB = (Textbox) getFellow("shortName");
        Textbox contactTB = (Textbox) getFellow("contact");
        Textbox officeTel1TB = (Textbox) getFellow("officeTel1");
        obj.setUniId(uniIdTB.getText());
        obj.setName(nameTB.getText());
        obj.setShortName(shortNameTB.getText());
        obj.setContact(contactTB.getText());
        obj.setOfficeTel1(officeTel1TB.getText());

        Textbox inChargeTB = (Textbox) getFellow("inCharge");
        Textbox regAddressZipTB = (Textbox) getFellow("regAddressZip");
        Textbox regAddressTB = (Textbox) getFellow("regAddress");
        Textbox docReceiverTB = (Textbox) getFellow("docReceiver");
        Textbox recAddressZipTB = (Textbox) getFellow("recAddressZip");
        obj.setInCharge(inChargeTB.getText());
        obj.setRegAddressZip(regAddressZipTB.getText());
        obj.setRegAddress(regAddressTB.getText());
        obj.setDocReceiver(docReceiverTB.getText());
        obj.setRecAddressZip(recAddressZipTB.getText());

        Textbox recAddressTB = (Textbox) getFellow("recAddress");
        obj.setRecAddress(recAddressTB.getText());

        // optional fields
        Textbox faxTelTB = (Textbox) getFellow("faxTel");
        Textbox contactMobileTB = (Textbox) getFellow("contactMobile");
        Textbox officeTel2TB = (Textbox) getFellow("officeTel2");
        Textbox contactEmailTB = (Textbox) getFellow("contactEmail");
        Intbox quotaTB = (Intbox) getFellow("quota");
        obj.setFaxTel(faxTelTB.getText());
        obj.setContactMobile(contactMobileTB.getText());
        obj.setOfficeTel2(officeTel2TB.getText());
        obj.setContactEmail(contactEmailTB.getText());
        if (!"".equals(quotaTB.getText())) {
            obj.setQuota(Integer.parseInt(quotaTB.getText()));
        }

        return obj;
    }
View Full Code Here

        return obj;
    }

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

        Textbox uniIdTB = (Textbox) getFellow("uniId");
        Textbox nameTB = (Textbox) getFellow("name");
        Textbox shortNameTB = (Textbox) getFellow("shortName");
        Textbox contactTB = (Textbox) getFellow("contact");
        Textbox officeTel1TB = (Textbox) getFellow("officeTel1");
        uniIdTB.setText(var.getUniId());
        nameTB.setText(var.getName());
        shortNameTB.setText(var.getShortName());
        contactTB.setText(var.getContact());
        officeTel1TB.setText(var.getOfficeTel1());

        Textbox inChargeTB = (Textbox) getFellow("inCharge");
        Textbox regAddressZipTB = (Textbox) getFellow("regAddressZip");
        Textbox regAddressTB = (Textbox) getFellow("regAddress");
        Textbox docReceiverTB = (Textbox) getFellow("docReceiver");
        Textbox recAddressZipTB = (Textbox) getFellow("recAddressZip");
        inChargeTB.setText(var.getInCharge());
        regAddressZipTB.setText(var.getRegAddressZip());
        regAddressTB.setText(var.getRegAddress());
        docReceiverTB.setText(var.getDocReceiver());
        recAddressZipTB.setText(var.getRecAddressZip());

        Textbox recAddressTB = (Textbox) getFellow("recAddress");
        recAddressTB.setText(var.getRecAddress());

        Textbox faxTelTB = (Textbox) getFellow("faxTel");
        Textbox contactMobileTB = (Textbox) getFellow("contactMobile");
        Textbox officeTel2TB = (Textbox) getFellow("officeTel2");
        Textbox contactEmailTB = (Textbox) getFellow("contactEmail");
        Intbox quotaTB = (Intbox) getFellow("quota");
        faxTelTB.setText(var.getFaxTel());
        contactMobileTB.setText(var.getContactMobile());
        officeTel2TB.setText(var.getOfficeTel2());
        contactEmailTB.setText(var.getContactEmail());
        quotaTB.setText(var.getQuota() + "");

    }
View Full Code Here

        sess = null;
        logger.debug("supplier CB size:" + keyValueList.size());

        Iterator it = keyValueList.iterator();
        while (it.hasNext()) {
            Supplier s = (Supplier) it.next();
            Comboitem item = new Comboitem();
            item.setValue(s);
            item.setLabel(s.getShortName());
            item.setParent(supplierIdCB);
        }
    }
View Full Code Here

        equipmentNameTB.setText(var.getEquipmentName());

        Iterator supplierIt = supplierIdCB.getItems().iterator();
        while (supplierIt.hasNext()) {
            Comboitem item = (Comboitem) supplierIt.next();
            Supplier s = (Supplier) item.getValue();
            if (var.getSupplierId() != null && var.getSupplierId() == s.getSupplierId()) {
                supplierIdCB.setSelectedItem(item);
            }
        }

        pccCodeTB.setText(var.getPccCode());
        venderCodeTB.setText(var.getVenderCode());

        Textbox insideCodeTB = (Textbox) getFellow("insideCode");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Doublebox latestPriceTB = (Doublebox) getFellow("latestPrice");
        Intbox inventoryAmountTB = (Intbox) getFellow("inventoryAmount");
        Combobox systemTypeCB = (Combobox) getFellow("system");

        insideCodeTB.setText(var.getInsideCode());
        Iterator priorityIt = priorityCB.getItems().iterator();
        while (priorityIt.hasNext()) {
            Comboitem item = (Comboitem) priorityIt.next();

            String priorityStr = item.getValue().toString();
            if (var.getPriority() != null && var.getPriority().equals(priorityStr)) {
                priorityCB.setSelectedItem(item);
            }
        }
        latestPriceTB.setValue(var.getLatestPrice());
        inventoryAmountTB.setValue(var.getInventoryAmount());

        Iterator stItr = systemTypeCB.getItems().iterator();
        while (stItr.hasNext()) {
            Comboitem item = (Comboitem) stItr.next();
            String s = (String) item.getValue();
            if (s.equals(var.getSystemType())) {
                systemTypeCB.setSelectedItem(item);
            }
        }
    }
View Full Code Here

TOP

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

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.