Package event_manager.models

Examples of event_manager.models.Event


        Plastic3DLookAndFeel.setPlasticTheme(new ExperienceRoyale());
        lf = new Plastic3DLookAndFeel();
        UIManager.setLookAndFeel(lf);
        ensureDatabase();
        DBHelper.openConnection();
        Event evt = Event.findById(1);
        System.out.println("Net Amount: " + evt.getNetAmount());
//        new Login(new Staff()).setVisible(true);
        DBHelper.closeConnection();
//        Staff staff = Staff.findById(1);
//        new StaffForm(staff).setVisible(true);
//        new StaffForm(new Staff()).setVisible(true);
View Full Code Here


     * Sets event to edit.
     *
     * @param event event to return
     */
    public void setEvent(Event event) {
        Event oldEvent = this.event;
        this.event = event;
        firePropertyChange("event", oldEvent, event);
    }
View Full Code Here

    private void newTab(final String panelName, int panelId) {
        Component panel = null;
        switch(panelId) {
            case ViewHelper.LIST_EVENT:
                panel = new ListPanel(new EventsController(), new Event(), this);
                break;
            case ViewHelper.LIST_STAFF:
                panel = new ListPanel(new StaffsController(), new Staff(), this);
                break;
            case ViewHelper.LIST_CLIENT:
View Full Code Here

        view.show(panelName, ViewHelper.LIST_EVENT);
    }

    @Override
    public void createNew(View view) {
        new EventForm(view, true, new Event()).setVisible(true);
    }
View Full Code Here

    public boolean save(View view, Model model) {
        DBHelper.openConnection();

        boolean saved = false;
        String errors = "";
        Event event = (Event) model;
        double vatPercentage = event.getDouble("vat_percentage");
        double totalAmount = event.getDouble("total_amount");
        double amountWithVat = totalAmount + vatPercentage/100 * totalAmount;
        event.set("amount_with_vat", amountWithVat);

        if(event.save()) {
            saved = true;
        } else {
            errors += DBHelper.getNiceErrors(model);
        }

View Full Code Here

    }

    @Override
    public void show(View view, int modelId) {
        DBHelper.openConnection();
        Event event = Event.findById(modelId);
        new ShowEvent(view, true, event).setVisible(true);
        DBHelper.closeConnection();
    }
View Full Code Here

    }
   
    @Override
    public void edit(View view, int modelId) {
        DBHelper.openConnection();
        Event event = Event.findById(modelId);
        new EventForm(view, true, event).setVisible(true);
        DBHelper.closeConnection();
    }
View Full Code Here

    @Override
    public boolean delete(View view, int modelId) {
        boolean deleted = false;
        DBHelper.openConnection();
        Event event = Event.findById(modelId);
        if(event.delete()) {
            ViewHelper.showDialog("Deleted!");
            deleted = true;
        } else {
            ViewHelper.showDialog("Error deleting!");
        }
View Full Code Here

TOP

Related Classes of event_manager.models.Event

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.