Examples of MechanicForm


Examples of net.caece.fmII.hibernate.vo.MechanicForm

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

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

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

Examples of net.caece.fmII.hibernate.vo.MechanicForm

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

    public void objToView(Object obj) {
        MechanicForm form = (MechanicForm) obj;

        Radiogroup hasCitizenshipRG = (Radiogroup) getFellow("hasCitizenship");
        Textbox mechanicNameTB = (Textbox) getFellow("mechanicName");
        Textbox uniIdTB = (Textbox) getFellow("uniId");
        Combobox companyCB = (Combobox) getFellow("company");
        Radiogroup sexRG = (Radiogroup) getFellow("sex");

        Iterator it = hasCitizenshipRG.getItems().iterator();
        while (it.hasNext()) {
            Radio r = (Radio) it.next();
            if (r.getValue().equals(form.getHasCitizenship())) {
                r.setChecked(true);
            }
        }
        mechanicNameTB.setText(form.getMechanicName());
        uniIdTB.setText(form.getUniId());

        boolean mechanicBelongToCompany = false;
        Iterator companyCBItr = companyCB.getItems().iterator();
        while (companyCBItr.hasNext()) {
            Comboitem item = (Comboitem) companyCBItr.next();
            Org varCompany = (Org) item.getValue();
            if (form.getCompanyId() != null
                    && varCompany.getOrgId().equals(form.getCompanyId())) {
                companyCB.setSelectedItem(item);
                form.setCompany(varCompany); // if has company, re-link it now
                mechanicBelongToCompany = true;
            }
          
        }
        if(!mechanicBelongToCompany){
            companyCB.setValue("please");
        }

       
        Iterator sexRGItr = sexRG.getItems().iterator();
        while (sexRGItr.hasNext()) {
            Radio r = (Radio) sexRGItr.next();
            if (r.getValue().equals(form.getSex())) {
                r.setChecked(true);
            }
        }


        Datebox birthdayDB = (Datebox) getFellow("birthday");
        Textbox homePhoneTB = (Textbox) getFellow("homePhone");
        Textbox mobileTB = (Textbox) getFellow("mobile");
        Textbox informPeopleTB = (Textbox) getFellow("informPeople");
        Textbox relationTB = (Textbox) getFellow("relation");

        birthdayDB.setValue(form.getBirthday());
        homePhoneTB.setText(form.getHomePhone());
        mobileTB.setText(form.getMobile());
        informPeopleTB.setText(form.getInformPeople());
        relationTB.setText(form.getRelation());

        Textbox informPhoneTB = (Textbox) getFellow("informPhone");
        Textbox deliveryZipTB = (Textbox) getFellow("deliveryZip");
        Textbox deliveryAddressTB = (Textbox) getFellow("deliveryAddress");
        Textbox billZipTB = (Textbox) getFellow("billZip");
        Textbox billAddressTB = (Textbox) getFellow("billAddress");

        informPhoneTB.setText(form.getInformPhone());
        deliveryZipTB.setText(form.getDeliveryZip());
        deliveryAddressTB.setText(form.getDeliveryAddress());
        billZipTB.setText(form.getBillZip());
        billAddressTB.setText(form.getBillAddress());

    }
View Full Code Here

Examples of net.caece.fmII.hibernate.vo.MechanicForm

        Map para = new HashMap();
        para.put("mechanicName", mechanicName);

        refreshObjEntities(para);

        MechanicForm emptyObj = new MechanicForm();
        emptyObj.setMechanicName(mechanicName);
        objToView(emptyObj);
    }
View Full Code Here

Examples of net.caece.fmII.hibernate.vo.MechanicForm

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

    public void update() {
        MechanicForm obj = (MechanicForm) objListbox.getSelectedItem().getValue();
        MechanicDao dao = new MechanicDao();
        update(dao, obj);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.