Package net.caece.fmII.hibernate

Examples of net.caece.fmII.hibernate.Mechanic


        }

    }

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


    public boolean validate() {
        return true;
    }

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


        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");

        var.setHasCitizenship(
                hasCitizenshipRG.getSelectedItem().getValue());
        var.setMechanicName(mechanicNameTB.getText());
        var.setUniId(uniIdTB.getText());
        if (companyCB.getSelectedItem() != null) {
            var.setCompany((Org) companyCB.getSelectedItem().getValue());
        }
        var.setSex(sexRG.getSelectedItem().getValue());


        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");

        var.setBirthday(birthdayDB.getValue());
        var.setHomePhone(homePhoneTB.getText());
        var.setMobile(mobileTB.getText());
        var.setInformPeople(informPeopleTB.getText());
        var.setRelation(relationTB.getText());


        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");

        var.setInformPhone(informPhoneTB.getText());
        var.setDeliveryZip(deliveryZipTB.getText());
        var.setDeliveryAddress(deliveryAddressTB.getText());
        var.setBillZip(billZipTB.getText());
        var.setBillAddress(billAddressTB.getText());

        return var;
    }
View Full Code Here

TOP

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

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.