예제 #1
0
        /// <summary>
        /// 
        /// </summary>
        public void GetUsuarioByEmail()
        {
            try
            {
                DASeguridad dataAcces = new DASeguridad();
                DTUsuario usuario = dataAcces.GetUsuarioByEmail(Data.Usuario.Email);
                if (usuario == null)
                    throw new CustomizedException(string.Format("El email {0} no se encuentra registrado.", Data.Usuario.Email), null,
                                                         enuExceptionType.ValidationException);
                Data.Usuario = usuario;

                ObtenerRolesUsuario();
            }
            catch (CustomizedException ex)
            { throw ex; }
            catch (Exception ex)
            {
                throw new CustomizedException(string.Format("Fallo en {0} - GetUsuarioByEmail", ClassName), ex,
                                              enuExceptionType.BusinessLogicException);
            }
        }
예제 #2
0
        /// <summary>
        /// Validars the respuesta.
        /// </summary>
        public void ValidarRespuesta()
        {
            try
            {
                DASeguridad dataAcces = new DASeguridad();
                DTUsuario usuario = dataAcces.GetUsuarioByEmail(Data.Usuario.Email);

                if (!usuario.PaswordRespuesta.Equals(Data.Usuario.PaswordRespuesta))
                {
                    throw new MembershipPasswordException();
                }

            }
            catch (MembershipPasswordException ex)
            {
                throw new CustomizedException(string.Format("La respuesta proporcionada no es válida.", ClassName), ex,
                                              enuExceptionType.SecurityException);
            }
            catch (Exception ex)
            {
                throw new CustomizedException(string.Format("Fallo en {0} - CambiarPassword", ClassName), ex,
                                              enuExceptionType.BusinessLogicException);
            }
        }