Example #1
0
 public Propuesta(String id, TipoPropuesta tipoPropuesta, Boolean preAprobada, Boolean aprobada, String texto)
 {
     
     if (id == "0000")
     {
         throw new ArgumentNullException("Constructor Propuesta - ID invalido.");
     }
     else
     {
         if (tipoPropuesta == null || tipoPropuesta.getID() == 0)
         {
             throw new ArgumentNullException("Constructor Propuesta - Tipo invalida.");
         }
         else
         {
             if (preAprobada != true && preAprobada != false)
             {
                 throw new ArgumentNullException("Constructor Propuesta - Valor Pre Aprobada invalido");
             }
             else
             {
                 if (aprobada != true && aprobada != false)
                 {
                     throw new ArgumentNullException("Constructor Propuesta . Valor Aprobacion invalido.");
                 }
                 else
                 {
                     if (texto == null || texto == "")
                     {
                         throw new ArgumentNullException("Constructor Propuesta - Texto invalido.");
                     }
                     else
                     {
                         setID(id);
                         setIdPropuestaRelacionada("0000");
                         setTipoPropuesta(tipoPropuesta);
                         setCalificaciones(new ArrayList());
                         setAdminVotaron(new ArrayList());
                         setVotosAprobarAdmin(0);
                         setPreAprobada(preAprobada);
                         setAprobada(aprobada);
                         setTexto(texto);
                         setFechaCreacion(DateTime.Now);
                         setFechaModificacion(DateTime.Now);
                     }
                 }
             }
         }
     }
     
 }