Package org.salamanca.commands

Examples of org.salamanca.commands.MessageException


    /**
     * execute
     */
    public void execute() throws MessageException {
        if (this.pago == null) {
            throw new MessageException(
                    "No existe el pago para anular!");
        }
        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
        pm.currentTransaction().begin();
View Full Code Here


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

        if (cuotaYaPagada()) { // no se permite pagar dos veces la misma cuota al mismo alumno
            throw new MessageException(
                    "La cuota en cuestion ya se encontraba pagada");
        }

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

        if (dni != persona.getDni()) { //verifico si quiere cambiar el dni que no lo tenga otro
            Vector v = BrokerServer.instance().query(Persona.class,
                    "dni==" + dni);
            if (v.size() > 0) {
                throw new MessageException(
                        "Ya existe una persona con ese DNI");
            }
        }
        pm.currentTransaction().begin();
            Persona personaPM=  (Persona)pm.getObjectById(javax.jdo.JDOHelper.getObjectId(persona),true);
View Full Code Here

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

        if (persona.getSetAlumno().size() > 0) {
            throw new MessageException(
                    "No se puede Borrar, la persona esta o estuvo inscripta en cursos");
        }

        if (persona.getSetDescuento().size() > 0) {
            throw new MessageException(
                    "No se puede Borrar, est� asociada a uno o mas Descuentos");
        }

        if (persona.getSetVale().size() > 0) {
            throw new MessageException(
                    "No se puede Borrar, est� asociada a uno o mas Vales");
        }

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

     * execute
     */
    public void execute() throws MessageException {
        if (persona.getNombre().trim().length() == 0 ||
            persona.getApellido().trim().length() == 0) {
            throw new MessageException(
                    "EL nombre y apellido no pueden estar vacios");
        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
        Vector v = BrokerServer.instance().query(Persona.class,
                                                 "dni==" + persona.getDni());
        if (v.size() > 0) {
            throw new MessageException(
                    "Ya existe una persona con ese DNI");
        }

        pm.currentTransaction().begin();
        pm.makePersistent(persona);
View Full Code Here

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

        if (this.concepto.trim().length() == 0) {
            throw new MessageException(
                    "EL concepto de la cuota no puede estar vacio");
        }
        if (this.fechaVencimiento.before(new Date())) {
            throw new MessageException(
                    "La fecha de vencimiento no puede ser anterior" +
                    " a la fecha actual del sistema");
        }
        if (this.importe < 0) {
            throw new MessageException(
                    "No se permiten valores negativos en la cuota");
        }

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

                                getPersistenceManager();
        pm.currentTransaction().begin();
        CuotaBasica cuotaBasicaPM = (CuotaBasica) pm.getObjectById(javax.jdo.
                JDOHelper.getObjectId(cuota),true);
        if (cuotaBasicaPM.getSetPago().size() > 0) {
            throw new MessageException(
                    "Esta cuota ya tiene pagos realizados por alumnos "+
                    ", por lo tanto no se puede eliminar");
        }
        cuotaBasicaPM.getCurso().removeCuotaBasica(cuotaBasicaPM);
        pm.deletePersistent(cuotaBasicaPM);
View Full Code Here

    public void execute() throws MessageException {



        if (cuota.getConcepto().trim().length() == 0) {
            throw new MessageException(
                    "EL concepto de la cuota no puede estar vacio");
        }

        if (cuota.getFechaVencimiento().before(new Date())) {
            throw new MessageException(
                    "La fecha de vencimiento no puede ser anterior"+
                  " a la fecha actual del sistema");
        }
        if (cuota.getImporte()<0) {
    throw new MessageException(
            "No se permiten valores negativos en la cuota");
}

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

           Calendar calUtil = Calendar.getInstance();
           calUtil.setTime(vale.getFechaEmision());

           if (calYa.get(Calendar.DAY_OF_YEAR) !=
               calUtil.get(Calendar.DAY_OF_YEAR)) {
               throw new MessageException(
                       "Los vales solo se pueden eliminados el mismo dia que fueron emitidos");
           }

        }
View Full Code Here

                alumnoNoNulo = true;
            }
        }

        if (alumnoNoNulo) {// tiene al menos un alumno habilitado
            throw new MessageException(
                    "Este curso tiene Alumnos inscriptos no se puede eliminar");
        }


        cursoPM.removeAllAlumnos();
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.