Package com.peusoft.ptcollect.core.err

Examples of com.peusoft.ptcollect.core.err.PTException


    }

    @Override
    public void createUser(User user) {
        if (user == null) {
            throw new PTException(
                    ErrorCode.ERR_WRONG_PARAMETER,
                    messageHelper.getErrorMessage(
                    ErrorCode.ERR_WRONG_PARAMETER,
                    new Object[]{"user", user},
                    "one of the parameter is null."));
View Full Code Here



    @Override
    public void dropUser(User user) {
        if (user == null) {
            throw new PTException(
                    ErrorCode.ERR_WRONG_PARAMETER,
                    messageHelper.getErrorMessage(
                    ErrorCode.ERR_WRONG_PARAMETER,
                    new Object[]{"user", user},
                    "one of the parameter is null."));
View Full Code Here

            String msg = (messageHelper.getErrorMessage(
                    ErrorCode.ERR_CANT_CONVERT_TYPES,
                    new Object[]{workDay.getBegin(), "Date", "BigDecimal"},
                    "Cant' parse Begin-string."));
            LOG.error(msg, e);
            throw new PTException(ErrorCode.ERR_CANT_CONVERT_TYPES, msg, e);
        }

        BigDecimal end;
        try {
            end = Converter.convertStringHHMM2BigDecimal(
                    Converter.convertTime2StringHHMM(
                    workDay.getEnd()));
        } catch (ParseException e) {
            String msg = (messageHelper.getErrorMessage(
                    ErrorCode.ERR_CANT_CONVERT_TYPES,
                    new Object[]{workDay.getEnd(), "Date", "BigDecimal"},
                    "Cant' parse End-string."));
            LOG.error(msg, e);
            throw new PTException(ErrorCode.ERR_CANT_CONVERT_TYPES, msg, e);
        }

        dayHours = end.subtract(b);
    }
View Full Code Here

            String msg = (messageHelper.getErrorMessage(
                    ErrorCode.ERR_CANT_CONVERT_TYPES,
                    new Object[]{beginOfWork, "Date", "BigDecimal"},
                    "Cant' parse Begin-string."));
            LOG.error(msg, e);
            throw new PTException(ErrorCode.ERR_CANT_CONVERT_TYPES, msg, e);
        }

        BigDecimal end;
        try {
            end = Converter.convertStringHHMM2BigDecimal(
                    Converter.convertTime2StringHHMM(
                    endOfWork));
        } catch (ParseException e) {
            String msg = (messageHelper.getErrorMessage(
                    ErrorCode.ERR_CANT_CONVERT_TYPES,
                    new Object[]{endOfWork, "Date", "BigDecimal"},
                    "Cant' parse End-string."));
            LOG.error(msg, e);
            throw new PTException(ErrorCode.ERR_CANT_CONVERT_TYPES, msg, e);
        }

        reallyWorkedHours = reallyWorkedHours.add(rec.getAmountOfHours());
        notWorkingHours = end.subtract(b).subtract(reallyWorkedHours);
    }
View Full Code Here

TOP

Related Classes of com.peusoft.ptcollect.core.err.PTException

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.