Package org.salamanca.commands

Examples of org.salamanca.commands.MessageException


     * execute
     */
    public void execute() throws MessageException {

        if (curso.getNombre().trim().length() == 0) {
            throw new MessageException(
                    "EL nombre del curso no puede estar vacio");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
View Full Code Here


     * execute
     */
    public void execute() throws MessageException {

        if (this.nombre.trim().length() == 0) {
            throw new MessageException(
                    "EL nombre del curso no puede estar vacio");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
View Full Code Here

     * execute
     */
    public void execute() throws MessageException {

        if (this.porcentajeRecargoPorDiaCuotas < 0) {
            throw new MessageException(
                    "No se permiten Recargos negativos");
        }

        if (this.porcentajeRecargoPorDiaPagosExtra < 0) {
            throw new MessageException(
                    "No se permiten Recargos negativos");
        }

        if (this.diasLuegoVencimientoAnulaDescuento < 0) {
            throw new MessageException(
                    "No se permiten dias negativos");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
View Full Code Here

        String filtro = "nombre.startsWith(\"" + descuentoSumaFija.getNombre() +
                         "\")";

         Vector v = BrokerServer.instance().query(Descuento.class, filtro);
         if (v.size() > 0) {
             throw new MessageException(
                     "EL nombre del descuento es demasiado parecido a uno ya existente");
        }

        if (descuentoSumaFija.getNombre().trim().length() == 0) {
            throw new MessageException(
                    "EL nombre del descuento no puede estar vacio");
        }

        if (descuentoSumaFija.getSumaFija() < 0) {
            throw new MessageException(
                    "No se permiten descuentos negativos");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
View Full Code Here

     * execute
     */
    public void execute() throws MessageException {
        if (alumno.getVectorPeriodos().size()>=
            alumno.getCurso().getCantidadPeriodos()+1) {//es mas uno porque tambien va el Examen final
            throw new MessageException(
                    "Este curso no permite mas periodos");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
View Full Code Here

    /**
     * execute
     */
    public void execute() throws MessageException {
        if(user.getName().trim().length()==0){
     throw new MessageException(
                     "EL nombre del usuario no puede estar vacio");
}


        PersistenceManager pm = BrokerServer.instance().getPMF().
View Full Code Here

     */
    public void execute() throws MessageException {


     if(periodo.getAlumno().getVectorPeriodos().lastElement()!=periodo){
         throw new MessageException(
                    "Solo se puede eliminar el ultimo periodo");
     }


        PersistenceManager pm = BrokerServer.instance().getPMF().
View Full Code Here

    /**
     * execute
     */
    public void execute() throws MessageException {
        if (descuentoSumaFija.getSetPersona().size() > 0) {
            throw new MessageException(
                    "Imposible eliminar, el descuento tiene personas asociadas");
        }
        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
        pm.currentTransaction().begin();
View Full Code Here

    /**
     * execute
     */
    public void execute() throws MessageException {
        if (recargo.getConcepto().trim().length() == 0) {
            throw new MessageException(
                    "EL concepto no puede estar vacios");
        }
        String filtro = "concepto.startsWith(\"" + recargo.getConcepto() +
                        "\")";
        Vector v = BrokerServer.instance().query(Recargo.class, filtro);
        if (v.size() > 0) {
            throw new MessageException(
                    "Ya existe un Recargo que comienza igual");
        }
        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
        pm.currentTransaction().begin();
View Full Code Here

        String filtro = "nombre.startsWith(\"" + descuentoPorcentual.getNombre() +
                         "\")";

        Vector v = BrokerServer.instance().query(Descuento.class, filtro);
        if (v.size() > 0) {
            throw new MessageException(
                    "EL nombre del descuento es demasiado parecido a uno ya existente");
        }

        if (descuentoPorcentual.getNombre().trim().length() == 0) {
            throw new MessageException(
                    "EL nombre del descuento no puede estar vacio");
        }

        if (descuentoPorcentual.getPorcentaje() < 0) {
            throw new MessageException(
                    "No se permiten descuentos con porcentajes negativos");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
View Full Code Here

TOP

Related Classes of org.salamanca.commands.MessageException

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.