Ejemplo n.º 1
0
        public bool Actualizar(Entidades.Solicitud solicitud)
        {
            ISolicitudDAO sol = new SolicitudDAO();

            if (String.IsNullOrEmpty(solicitud.Descripcion))
            {
                throw new BusinessException("El dato descripcion es obligatorio");
            }
            if (solicitud.Descripcion.Length > 140)
            {
                throw new BusinessException("La descripción excede el número de caracteres");
            }
            bool resultado = sol.Actualizar(solicitud);

            if (resultado == false)
            {
                throw new BusinessException("No se pudo actualziar la solicitud");
            }
            return(resultado);
        }
Ejemplo n.º 2
0
        public int Registrar(Entidades.Solicitud solicitud)
        {
            solicitud.FechaRegistro = DateTime.Today;
            ISolicitudDAO sol = new SolicitudDAO();

            if (String.IsNullOrEmpty(solicitud.Usuario))
            {
                throw new BusinessException("No hay usuario");
            }
            if (String.IsNullOrEmpty(solicitud.Descripcion))
            {
                throw new BusinessException("No hay descripcion");
            }
            if (solicitud.Descripcion.Length > 140)
            {
                throw new BusinessException("La descripción excede el número de caracteres");
            }

            return(sol.Guardar(solicitud));
        }