def telaOperacoesBancarias(login):

    endereco = f'Banco de Dados\\Usuarios\\{login}\\saldo.txt'
    saldo = lerArquivo(endereco)

    os.system('cls')

    print(
        f'\nBANCO WTIC - [OPERAÇÕES BANCÁRIAS] - SALDO ATUAL: (R$ {saldo})\n')

    print('POR FAVOR SELECIONE UMA OPÇÃO OU DIGITE "sair" PARA SAIR\n')

    print('(01) DEPÓSITO')
    print('(02) SAQUE')
    print('(03) TRANSFERÊNCIA')
    print('(04) EXTRATO\n')

    resp = input('>>> ')

    if resp.lower() == 'sair':
        return False

    return_tratamento = tratarNum(resp)

    if return_tratamento == True:

        resp = int(resp)
        return_tratamento = tratarOpcao(resp, 1, 2, 3, 4)

        if return_tratamento == True:

            controleOperacoesBancarias(resp, login)
def telaUsuario(login):

    informacoes_usuario = capturarInformacoesUsuario(login)

    nome = informacoes_usuario[0]

    os.system('cls')

    print(f'\nBANCO WTIC - [TELA USUÁRIO] - BEM-VINDO ({nome.title()})!\n')

    print('POR FAVOR SELECIONE UMA OPÇÃO OU DIGITE "sair" PARA SAIR\n')

    print('(01) OPERAÇÕES BANCÁRIAS')
    print('(02) CONFIGURAÇÕES DO USUÁRIO\n')

    resp = input('>>> ')

    if resp.lower() == 'sair':
        sairBanco()

    return_tratamento = tratarNum(resp)
    '''
    PARTE LÓGICA DA TELA USUÁRIO
    '''
    if return_tratamento == True:

        resp = int(resp)
        return_tratamento = tratarOpcao(resp, 1, 2)

        if return_tratamento == True:

            controleUsuario(resp, login)

    telaUsuario(login)
def telaInicio():
    '''
    EXIBE A TELA INICIAL DE LOGIN OU CADASTRO
    '''

    os.system('cls')

    print('\nBEM-VINDO AO BANCO WTIC!\n')

    print('POR FAVOR SELECIONE UMA OPÇÃO OU DIGITE "sair" PARA SAIR:\n')

    print('(01) LOGIN')
    print('(02) CADASTRO\n')

    resp = input('>>> ')

    if resp.lower() == 'sair':
        sairBanco()

    return_tratamento = tratarNum(resp)
    '''
    PARTE LÓGICA DA TELA INÍCIO
    '''
    if return_tratamento == True:

        resp = int(resp)
        return_tratamento = tratarOpcao(resp, 1, 2)

        if return_tratamento == True:

            controleInicio(resp)

    telaInicio()
Esempio n. 4
0
def telaConfiguracoesUsuario(login):
    '''
    EXIBE A TELA DAS CONFIGURAÇÕES DO USUÁRIO
    '''

    os.system('cls')

    print('\nBANCO WTIC - [TELA USUÁRIO -> CONFIGURAÇÕES DO USUÁRIO]\n')

    print('POR FAVOR SELECIONE UMA OPÇÃO OU DIGITE "sair" PARA SAIR\n')

    print('(01) ALTERAR INFORMAÇÕES PESSOAIS')
    print('(02) ENCERRAR CONTA\n')

    resp = input('>>> ')
    print(resp)

    if resp.lower() == 'sair':
        informacoes = [False, login]
        return informacoes

    return_tratamento = tratarNum(resp)

    if return_tratamento == True:

        resp = int(resp)
        return_tratamento = tratarOpcao(resp, 1, 2)

        if return_tratamento == True:
            controleConfiguracoesUsuario(resp, login)

    telaConfiguracoesUsuario(login)
def controleEncerrarConta(resp, login):

    '''
    FUNÇÃO RESPONSÁVEL POR EXCLUIR A CONTA DO USUÁRIO
    '''

    return_resp = tratarAlpha(resp)

    if return_resp == True:


        return_resp = tratarOpcao(resp, 's', 'n')

        if return_resp == True:

            '''
            APAGA A CONTA DO USUÁRIO SE resp == 's'
            '''
            if resp == 's':

                diretorio_usuario = f'Banco de Dados\\Usuarios\\{login}'

                '''
                APAGA OS ARQUIVOS DENTRO DA PASTA DO USUÁRIO
                E EM SEGUIDA, APAGA SUA PASTA
                '''
                nome_arquivos = ['extrato.txt', 'idade.txt', 'login.txt', 'nome.txt', 'saldo.txt', 'senha.txt']

                for nome_arquivo in nome_arquivos:

                    arquivo = f'{diretorio_usuario}\\{nome_arquivo}'
                    os.remove(arquivo)

                os.removedirs(diretorio_usuario)

                print('\nCONTA EXCLUÍDA COM SUCESSO.')

                sairBanco()


            elif resp == 'n':

                print('\nOPERAÇÃO CANCELADA\n')
                os.system('pause')

                return False
def controleAlterarInformacoesPessoais(resp, login):
    '''
    FUNÇÃO RESPONSÁVEL PELO CONTROLE DE FLUXO
    DA OPÇÃO ESCOLHIDA PELO USUÁRIO

    ====================================================

    CASO A OPÇÃO ESCOLHIDA SEJA A Nº 01
    O USUÁRIO SERÁ REDIRECIONADO PARA A TELA ALTERAR LOGIN

    CASO A OPÇÃO ESCOLHIDA SEJA A Nº 02
    O USUÁRIO SERÁ REDIRECIONADO PARA A TELA ALTERAR SENHA
    '''

    return_tratamento = tratarNum(resp)

    if return_tratamento == True:

        resp = int(resp)
        return_tratamento = tratarOpcao(resp, 1, 2)

        if return_tratamento == True:

            if resp == 1:
                print(login)
                return_login = mudarLogin(login)

                if return_login == False:
                    return False

                return return_login

            elif resp == 2:
                return_senha = mudarSenha(login)

                if return_senha == False:
                    return False