示例#1
0
        private bool RecoverClave(Gq_usuarios entity)
        {
            try
            {
                string newPass = UtilsFunctions.CreateRandomCode(6);
                if (entity != null)
                {
                    List <string> emails = new List <string> {
                        entity.Email
                    };

                    entity.RequiereClave = "S";
                    entity.Clave         = Encriptacion.Encriptar(newPass, Constantes.CLAVE_ENCRIPTACION);
                    using (var transaction = Services.session.BeginTransaction())
                    {
                        try
                        {
                            Services.Get <ServGq_usuarios>().Actualizar(entity);
                        }
                        catch
                        {
                        }
                        transaction.Commit();
                    }
                }

                return(MailHelper.Enviar_AvisoDeRecClave(entity, newPass));
            }
            catch (Exception)
            {
                return(false);
            }
        }