Package net.caece.pri.hibernate

Examples of net.caece.pri.hibernate.Duty


            item = null;
            return;
        }
        sub = (DutyForm) item.getValue();

        Duty duty = convert(sub);

//        boolean success = (new File(duty.getModelFileName())).delete();

        DutyDao dao = new DutyDao();
View Full Code Here


        return isValid;
    }

    private Duty convert(DutyForm form) {
        Duty duty = new Duty();

        duty.setAuth(form.getAuth());
        duty.setDutyId(form.getDutyId());
        duty.setOrg(form.getOrg());
        duty.setUser(form.getUser());
        duty.setValidAfter(form.getValidAfter());
        duty.setValidBefore(form.getValidBefore());
        //       doc.setOperateBy(operateBy);
        duty.setOperateAt(form.getOperateAt());
        duty.setOperateBy(operateBy);

        return duty;
    }
View Full Code Here

    public void cancel() {
        this.detach();
    }

    public void addSub() {
        Duty var = subviewToForm(null);
        DutyDao dao = new DutyDao();
        dao.create(var);

    }
View Full Code Here

        dao.create(var);

    }

    public void updateSub() {
        Duty var = subviewToForm(dutyForm);
        DutyDao dao = new DutyDao();
        dao.update(var);

    }
View Full Code Here

        }

    }

    private Duty subviewToForm(DutyForm dutyForm) {
        Duty var = new Duty();
        if (dutyForm != null) {
            try {
                BeanUtils.copyProperties(var, dutyForm);
            } catch (Exception iae) {
                iae.printStackTrace();
            }
        }
        var.setOperateBy(operateBy);

        var.setUser(user);
        Listbox authListbox = (Listbox) getFellow("auth");
        var.setAuth((Auth) (authListbox.getSelectedItem()).getValue());

        Datebox validAfterDate = (Datebox) getFellow("validAfterDate");
        Timebox validAfterTime = (Timebox) getFellow("validAfterTime");
        if (validAfterDate.getValue() != null
                && validAfterTime.getValue() != null) {
            Timestamp validAfter = new Timestamp(validAfterDate.getValue().getTime());
            validAfter.setHours(validAfterTime.getValue().getHours());
            validAfter.setMinutes(validAfterTime.getValue().getMinutes());
            var.setValidAfter(validAfter);
        }

        Datebox validBeforeDate = (Datebox) getFellow("validBeforeDate");
        Timebox validBeforeTime = (Timebox) getFellow("validBeforeTime");
        if (validBeforeDate.getValue() != null
                && validBeforeTime.getValue() != null) {
            Timestamp validBefore = new Timestamp(validBeforeDate.getValue().getTime());
            validBefore.setHours(validBeforeTime.getValue().getHours());
            validBefore.setMinutes(validBeforeTime.getValue().getMinutes());
            var.setValidBefore(validBefore);
        }

        return var;
    }
View Full Code Here

TOP

Related Classes of net.caece.pri.hibernate.Duty

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.