Package event_manager.models

Examples of event_manager.models.Staff.save()


        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()) {
View Full Code Here


                    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

TOP
Copyright © 2018 www.massapi.com. 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.