segunda-feira, 7 de setembro de 2020

DICAS 3079 -WEBDEV TUTORIAL 13-Licao 1.3-17-09-2020 16hrs-Lesson 1.3. PESQUISA SIMPLES BANCO DADOS LOGIN - PARTE I




https://youtu.be/ec5coUujtP8


Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 16:00 do dia 17/09/2020 
DICAS 3079 -WEBDEV TUTORIAL 13-Licao 1.3-17-09-2020 16hrs-Lesson 1.3. PESQUISA SIMPLES BANCO DADOS LOGIN - PARTE I
Lesson 1.3. My first pages


ASSUNTOS

PESQUISA SIMPLES BANCO DADOS
CLIAR PAGINA LOGIN 
CRIANDO CONTROLES LOGINE E SENHA 
CRIADO BOTOES CONECTAR E REGISTRAR 
NO REGISTRAR CHAMAR PAGINA FORMULARIO
EXECUTANDO PAGINA 


DICAS 3067 -WEBDEV TUTORIAL 1-Licao 1.1-14-09-2020 11hrs-DESCUBRA WEBDEV
DICAS 3068 -WEBDEV TUTORIAL 1-Licao 1.2-14-09-2020 15hrs-Web development and WEBDEV - PARTE A
DICAS 3069 -WEBDEV TUTORIAL 3-Licao 1.2-14-09-2020 16hrs-Web development and WEBDEV - PARTE B





PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
Playlist windev Franca PcSoft
Amarildo
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Site forum Google 
Video sobre 3 Mil Videos Windev 
PlayList Pedrosao
Video sobre Alfaserver servidor 
Ultimo Video manipulacao arquivos













Simple search in a database
We have seen how to create an input form and how to save values in a database. Let's continue our first WEBDEV discovery by performing a search in the database.
We are going to create a login page where the login and the password will be typed. Then, we will check whether the information typed is correct.

Creating the page

  • To create the page:
    1. Click Create an element among the quick access buttons.
    2. The window for creating a new element is displayed.
    3. Click "Page" then "Page". The page creation wizard starts.
    4. Select "Blank".
      Page creation wizard
    5. Make sure that "Responsive Web Design mode" is unchecked.
    6. Validate.
    7. The page is created and the save window is automatically displayed.
    8. Type the page title: "Login".
    9. Validate.

Creating controls

The login page will contain the following controls:
  • Two edit controls:
    • "Login" to type the login.
    • "Password" to type the password.
  • Two Button controls:
    • "Connect" to check the login and password.
    • "Register" to open the registration page (that was created beforehand).
These types of controls have already been created, let's see a reminder of operations to perform:
  • To create an edit control:
    1. On the "Creation" pane, in the "Usual controls" group, click Creating an edit control.
    2. Click inside the blank page to create the control.
    3. Click the control (simple click): the caption becomes editable.
    4. Type the caption ("Login" and "Password") and press Enter to validate. The caption is immediately modified.

      Remark

      The type of "Password" control must be "Password". To modify the type of edit control, simply open the description window.
  • To create a Button control:
    1. On the "Creation" pane, in the "Usual controls" group, click Creating a Button control.
    2. Click inside the page to create the Button control (below the edit controls for example). The control is created.
    3. Press the space bar: the caption becomes editable.
    4. Type the caption ("Connect" and "Register") and press Enter to validate. The caption is immediately modified.
  • You get the following page:
    Page in the editor
  • We will now see in detail how Button controls work. First of all, let's look at the "REGISTER" Button control.
    1. Select the "REGISTER" Button control.
    2. Open the control description window (double-click the control).
    3. In the "General" tab, in the "Button action" area, we are going to specify the action to perform. In our case, we are going to open the registration page:
      • In the "Type" area, select "Display a site page".
      • In the "Page" area, select "PAGE_Form".
        Description of the Button control
    4. Validate the description window.

EM PORTUGUES ------------------------------

Pesquisa simples em um banco de dados
Vimos como criar um formulário de entrada e como salvar valores em um banco de dados. Vamos continuar nossa primeira descoberta WEBDEV realizando uma pesquisa no banco de dados.
Vamos criar uma página de login onde serão digitados o login e a senha. Em seguida, verificaremos se a informação digitada está correta.

Criação da página

  • Para criar a página:
    1. Clique Crie um elementoentre os botões de acesso rápido.
    2. A janela para criar um novo elemento é exibida.
    3. Clique em "Página" e depois em "Página". O assistente de criação de página é iniciado.
    4. Selecione "Em branco".
      Assistente de criação de página
    5. Certifique-se de que o "Modo de design da Web responsivo" esteja desmarcado.
    6. Validar.
    7. A página é criada e a janela de salvamento é exibida automaticamente.
    8. Digite o título da página: "Login".
    9. Validar.

Criando controles

A página de login conterá os seguintes controles:
  • Dois controles de edição:
    • "Login" para digitar o login.
    • "Senha" para digitar a senha.
  • Dois controles de botão:
    • "Conectar" para verificar o login e a senha.
    • "Registrar" para abrir a página de registro (que foi criada anteriormente).
Esses tipos de controles já foram criados, vamos ver um lembrete das operações a serem realizadas:
  • Para criar um controle de edição:
    1. No painel "Criação", no grupo "Controles usuais", clique em Criação de um controle de edição.
    2. Clique dentro da página em branco para criar o controle.
    3. Clique no controle (clique simples): a legenda se torna editável.
    4. Digite a legenda ("Login" e "Senha") e pressione Enter para validar. A legenda é modificada imediatamente.

      Observação

      O tipo de controle de "Senha" deve ser "Senha". Para modificar o tipo de controle de edição, basta abrir a janela de descrição.
  • Para criar um controle de botão:
    1. No painel "Criação", no grupo "Controles usuais", clique em Criação de um controle de botão.
    2. Clique dentro da página para criar o controle Button (abaixo dos controles de edição, por exemplo). O controle é criado.
    3. Pressione a barra de espaço: a legenda se torna editável.
    4. Digite a legenda ("Conectar" e "Registrar") e pressione Enter para validar. A legenda é modificada imediatamente.
  • Você obtém a seguinte página:
    Página no editor
  • Veremos agora em detalhes como funcionam os controles de botão. Primeiramente, vamos dar uma olhada no controle do botão "REGISTAR".
    1. Selecione o controle do botão "REGISTAR".
    2. Abra a janela de descrição do controle (clique duas vezes no controle).
    3. Na guia "Geral", na área "Ação do botão", iremos especificar a ação a ser executada. No nosso caso, vamos abrir a página de registro:
      • Na área "Tipo", selecione "Exibir uma página do site".
      • Na área "Página", selecione "PAGE_Form".
        Descrição do controle de botão
    4. Valide a janela de descrição.

      Observação

      Nenhum código é necessário: no editor, o controle Button está associado à ação a ser executada (neste caso, abrir uma página).



    DICAS 3078 -WEBDEV TUTORIAL 12-Licao 1.3-17-09-2020 15hrs-Lesson 1.3. VERIFICACAO SENHA - PARTE G





    https://youtu.be/Pu5ROZZnADY


    Bom Dia/Boa Tarde/Boa Noite

    Esse Ao Vivo vai estrear as 15:00 do dia 17/09/2020 

    DICAS 3078 -WEBDEV TUTORIAL 12-Licao 1.3-17-09-2020 15hrs-Lesson 1.3. VERIFICACAO SENHA - PARTE H
    Lesson 1.3. My first pages

    ASSUNTOS

    CRIAR CAMPO VERIFICA SENHA 
    COLOCANDO O CODIGO PARA VER SE SENHA VERIFICA É IGUAL SENHA
    EXPLICANDO O CODIGO



    DICAS 3067 -WEBDEV TUTORIAL 1-Licao 1.1-14-09-2020 11hrs-DESCUBRA WEBDEV
    DICAS 3068 -WEBDEV TUTORIAL 1-Licao 1.2-14-09-2020 15hrs-Web development and WEBDEV - PARTE A
    DICAS 3069 -WEBDEV TUTORIAL 3-Licao 1.2-14-09-2020 16hrs-Web development and WEBDEV - PARTE B




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

    // BTN SALVAR - BROWSER

    // IF é usada para executar uma ação em uma condição. 
    // No nosso caso, a ação é realizada se os controles "Senha" e "Verificar" forem diferentes (operador '<>').

    // IF is used to perform an action on a condition.
    // In our case, the action is performed if the "Password" and "Verify" controls are different (operator '<>').

    // IF est utilisé pour exécuter une action sur une condition.
    // Dans notre cas, l'action est effectuée si les champs "Mot de passe" et "Vérifier" sont différents (opérateur '<>').

    // IF se usa para realizar una acción en una condición.
    // En nuestro caso, la acción se realiza si los controles "Contraseña" y "Verificar" son diferentes (operador '<>').

    IF EDT_SENHA<>EDT_SENHA_VERIFICA THEN
    Info("Erro - senha nao confere")
    // Em caso de diferença, os controles de edição são "limpos": uma string vazia é atribuída a eles.
    // In case of a difference, the editing controls are "clean": an empty string is assigned to them.
    // En cas de différence, les champs d'édition sont "propres": une chaîne vide leur est affectée.
    // En cas de différence, les champs d'édition sont "propres": une chaîne vide leur est affectée.
    EDT_SENHA=""
    EDT_SENHA_VERIFICA=""
    // ReturnToCapture é usado para posicionar o cursor no controle especificado (o controle "Senha" aqui) sem executar o código a seguir. 
    // ReturnToCapture is used to position the cursor on the specified control (the "Password" control here) without executing the following code. In our case, if the passwords entered are different, the "Password" control takes over and the code that is being executed is interrupted: the server code used to save the information in the database will not be executed.
    // ReturnToCapture is used to position the cursor on the specified control (the "Password" control here) without executing the following code. In our case, if the passwords entered are different, the "Password" control takes over and the code that is being executed is interrupted: the server code used to save the information in the database will not be executed.
    // ReturnToCapture se usa para colocar el cursor en el control especificado (el control "Contraseña" aquí) sin ejecutar el siguiente código. En nuestro caso, si las contraseñas ingresadas son diferentes, el control "Contraseña" toma el control y el código en ejecución se interrumpe: el código del servidor utilizado para guardar la información en la base de datos no se ejecutará.
    ReturnToCapture(EDT_SENHA)
    END


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


    // PageToFile é usado para recuperar o conteúdo dos controles de edição na página para transferi-lo para o arquivo de dados.
    // PageToFile is used to retrieve the content of the edit controls on the page to transfer it to the data file.
    // PageToFile est utilisé pour récupérer le contenu des contrôles d'édition sur la page pour le transférer dans le fichier de données.
    // PageToFile est utilisé pour récupérer le contenu des contrôles d'édition sur la page pour le transférer dans le fichier de données.

    PageToFile()

    // HAdd é usado para gravar os dados transferidos no arquivo de dados.
    // HAdd is used to write the transferred data to the data file.
    // HAdd est utilisé pour écrire les données transférées dans le fichier de données.
    // HAdd se utiliza para escribir los datos transferidos en el archivo de datos.

    HAdd(REGISTRO)

    // Info - são usadas para exibir uma mensagem.
    // Info - are used to display a message.
    // Info - sont utilisés pour afficher un message.
    // Info - sont utilisés pour afficher un message....

    Info("registro adicionado com sucesso ")








    PlayList WebDev tutorial Amarildo Webdev
    Playlist Windev Tutorial Amarildo Windev
    Playlist windev Franca PcSoft
    Amarildo
    Windev
    WxSolucoes
    Matos Informatica
    Repositorio Windev
    Site forum Google 
    Video sobre 3 Mil Videos Windev 
    PlayList Pedrosao
    Video sobre Alfaserver servidor 
    Ultimo Video manipulacao arquivos












    Checking the password

    To check the password, we are going to create the edit control allowing the user to type their password twice. Then, we will write the WLanguage code required for the check.
    • Create a new edit control. The caption of this control is "Check" and its type is "Password".
    • The WLanguage code for checking the password must be written in the events associated with the "SAVE" Button control.
      1. Click the "SAVE" Button control and press F2.
      2. This check consists in comparing the value typed in the "Password" control and the one typed in the "Check" control. The server is not required to perform this check: it can be performed locally in the browser.
      3. We are going to type the following code in the browser "Click" event:
        IF EDT_Password<>EDT_Check THEN
        Info("Error, the passwords are different.")
        EDT_Password = ""
        EDT_Check = ""
        ReturnToCapture(EDT_Password)
        END
      4. Let's study this code:
        • The IF statement is used to perform an action on a condition. In our case, the action is performed if the "Password" and "Check" controls are different ('<>' operator).
        • In case of difference, the edit controls are "cleared": an empty string is assigned to them.
        • ReturnToCapture is used to position the cursor in the specified control (the "Password" control here) without running the code that follows. In our case, if the passwords entered are different, the "Password" control takes the focus and the code being run is stopped: the server code that is used to save the information in the database will not be run.
    • Run the test of this page:
      1. Click the Run the test of a page icon among the quick access buttons.
      2. Enter the following information in the page that appears in a browser:
        • Last name: "Doe"
        • First name: "Peter"
        • Email: "Peter.Doe@gmail.com"
        • Login: "Peter"
        • Password: "Peter"
        • Check: "Louis"
      3. Click "SAVE".
      4. An error message is automatically displayed to indicate that the passwords are different.
      5. Validate this message.
      6. Close the browser.
    ======================= PORTUGUES

    Verificando a senha

    Para verificar a senha, vamos criar o controle de edição que permite ao usuário digitar sua senha duas vezes. Em seguida, escreveremos o código WLanguage necessário para a verificação.
    • Crie um novo controle de edição. A legenda deste controle é "Verificar" e seu tipo é "Senha".
    • O código WLanguage para verificação da senha deve ser escrito nos eventos associados ao controle do Botão "SALVAR".
      1. Clique no controle do botão "SALVAR" e pressione F2.
      2. Esta verificação consiste em comparar o valor digitado no controle "Senha" e o valor digitado no controle "Cheque". O servidor não é obrigado a realizar esta verificação: ela pode ser realizada localmente no navegador.
      3. Vamos digitar o seguinte código no evento "Click" do navegador:
        IF EDT_ Password <> EDT_ Check THEN Info ( "Erro, as senhas são diferentes." ) EDT_ Password = "" EDT_ Check = "" ReturnToCapture ( EDT_ Password ) END





      4. Vamos estudar este código:
        • A instrução IF é usada para executar uma ação em uma condição. No nosso caso, a ação é realizada se os controles "Senha" e "Verificar" forem diferentes (operador '<>').
        • Em caso de diferença, os controles de edição são "limpos": uma string vazia é atribuída a eles.
        • ReturnToCapture é usado para posicionar o cursor no controle especificado (o controle "Senha" aqui) sem executar o código a seguir. No nosso caso, se as senhas inseridas forem diferentes, o controle "Senha" assume o foco e o código que está sendo executado é interrompido: o código do servidor que serve para salvar as informações no banco de dados não será executado.
    • Execute o teste desta página:
      1. Clique no Execute o teste de uma páginaícone entre os botões de acesso rápido.
      2. Insira as seguintes informações na página que aparece em um navegador:
        • Sobrenome: "Doe"
        • Primeiro nome: "Peter"
        • Email: "Peter.Doe@gmail.com"
        • Login: "Peter"
        • Senha: "Peter"
        • Verifique: "Louis"
      3. Clique em "SALVAR".
      4. Uma mensagem de erro é exibida automaticamente para indicar que as senhas são diferentes.
      5. Valide esta mensagem.
      6. Feche o Navegador





    Teste

    Teste
    teste