Package net.caece.fmII.hibernate

Examples of net.caece.fmII.hibernate.RequestMaintain


            item.setParent(buildingCB);
        }
    }

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


    public boolean validate() {
        return true;
    }

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

        Textbox requestByTB = (Textbox) getFellow("requestBy");
        Datebox requestAtDate = (Datebox) getFellow("requestAtDate");
        Timebox requestAtTime = (Timebox) getFellow("requestAtTime");
        Combobox statusCB = (Combobox) getFellow("status");
        Textbox requestMobilePhoneTB = (Textbox) getFellow("requestMobilePhone");
        Combobox urgentLevelCB = (Combobox) getFellow("urgentLevel");

        var.setRequestBy(requestByTB.getText());
        if (requestAtDate.getValue() != null
                && requestAtTime.getValue() != null) {
            Timestamp requestAt = new Timestamp(requestAtDate.getValue().getTime());
            requestAt.setHours(requestAtTime.getValue().getHours());
            requestAt.setMinutes(requestAtTime.getValue().getMinutes());
            var.setRequestAt(requestAt);
        }
        var.setStatus(statusCB.getSelectedItem().getValue().toString());
        var.setRequestMobilePhone(requestMobilePhoneTB.getText());
        var.setUrgentLevel(urgentLevelCB.getSelectedItem().getValue().toString());

        Textbox requestMaintainNoTB = (Textbox) getFellow("requestMaintainNo");
        Combobox buildingCB = (Combobox) getFellow("building");
        Textbox requestReasonTB = (Textbox) getFellow("requestReason");
        Datebox firstResponseAtDate = (Datebox) getFellow("firstResponseAtDate");
        Timebox firstResponseAtTime = (Timebox) getFellow("firstResponseAtTime");
        Textbox responseMessageTB = (Textbox) getFellow("responseMessage");

        var.setRequestMaintainNo(requestMaintainNoTB.getText());
        var.setBuilding((Building) buildingCB.getSelectedItem().getValue());
        var.setRequestReason(requestReasonTB.getText());
        if (firstResponseAtDate.getValue() != null
                && firstResponseAtTime.getValue() != null) {
            Timestamp firstResponseAt = new Timestamp(firstResponseAtDate.getValue().getTime());
            firstResponseAt.setHours(firstResponseAtTime.getValue().getHours());
            firstResponseAt.setMinutes(firstResponseAtTime.getValue().getMinutes());
            var.setFirstResponseAt(firstResponseAt);
        }


        var.setResponseMessage(responseMessageTB.getText());

        Datebox responseSolutionAtDate = (Datebox) getFellow("responseSolutionAtDate");
        Timebox responseSolutionAtTime = (Timebox) getFellow("responseSolutionAtTime");
        Textbox solutionMessageTB = (Textbox) getFellow("solutionMessage");

        if (responseSolutionAtDate.getValue() != null
                && responseSolutionAtTime.getValue() != null) {
            Timestamp responseSolutionAt = new Timestamp(responseSolutionAtDate.getValue().getTime());
            responseSolutionAt.setHours(responseSolutionAtTime.getValue().getHours());
            responseSolutionAt.setMinutes(responseSolutionAtTime.getValue().getMinutes());
            var.setResponseSolutionAt(responseSolutionAt);
        }
        var.setSolutionMessage(solutionMessageTB.getText());

        return var;
    }
View Full Code Here

TOP

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

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.