Package event_manager.models

Examples of event_manager.models.Staff


     * Sets client to edit.
     *
     * @param staff staff to return
     */
    public void setStaff(Staff staff) {
        Staff oldStaff = this.staff;
        this.staff = staff;
        firePropertyChange("staff", oldStaff, staff);
    }
View Full Code Here


     * Sets client to edit.
     *
     * @param staff staff to return
     */
    public void setStaff(Staff staff) {
        Staff oldStaff = this.staff;
        this.staff = staff;
        firePropertyChange("staff", oldStaff, staff);
    }
View Full Code Here

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Login(new Staff()).setVisible(true);
            }
        });
    }
View Full Code Here

        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:
                panel = new ListPanel(new ClientsController(), new Client(), this);
                break;
            default:
View Full Code Here

     * Sets client to edit.
     *
     * @param staff staff to return
     */
    public void setStaff(Staff staff) {
        Staff oldStaff = this.staff;
        this.staff = staff;
        firePropertyChange("staff", oldStaff, staff);
    }
View Full Code Here

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

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

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

        boolean saved = false;
        String errors = "";
        Staff st = (Staff) model;
        String profilePicturePath = st.getProfilePicturePath();

        if(st.save()) {
            saved = true;
            // Upload profile picture if provided
            if(!profilePicturePath.equals("")) {
                File tmpFile = new File(profilePicturePath);
                if(tmpFile.exists() && tmpFile.isFile()) {
                    if(FileHelper.fileSizeInMB(tmpFile) < FileHelper.UPLOAD_LIMIT) {
                        try {
                            String profilePicture = FileHelper.absolutePathToLocalFilename(profilePicturePath, (String)st.get("username"));
                            FileUtils.copyFile(new File(profilePicturePath), new File(FileHelper.PROFILE_PIC_DIR + profilePicture));
                            st.set("profile_picture", profilePicture);
                            st.save();
                        } catch (IOException ex) {
                            errors += "Error saving profile picture";
                        }
                    } else {
                        errors += "The upload limit is " + FileHelper.UPLOAD_LIMIT + "MB";
View Full Code Here

    }

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

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

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

TOP

Related Classes of event_manager.models.Staff

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.