sábado, 15 de agosto de 2020

DICAS 3026 - WINDEV TUTORIAL 49 - Pesquisa Multicriterio - Parametro Data - Parte G



https://youtu.be/uBZxG2seMLc


DICAS_3026_WINDEV_TUTORIAL_49_Pesquisa_multicritério_Parametro_data_Parte_G

Bom Dia/Boa Tarde/Boa Noite


Esse Ao Vivo vai estrear as 19:00 do dia 26/08/2020 

DICAS 3026 - WINDEV TUTORIAL 49 - Pesquisa Multicriterio - Parametro Data - Parte G
Tutoriel WINDEV : Leçon 4.4.g. Recherche multicritère - Troisième paramètre

ASSUNTOS

Explicando o que sera feito
Explicando template controle
pegando a data do template controle
alterando codigo da tabela para pegar os parametros data
MOstrando funcionando as pesquisas

  

Video original da Franca

https://youtu.be/5LGyqyFAM80


Playlist Windev TUTORIAL


// initializin table_qry_pedido_consulta
// The control is using a query with parameters to display its data.
// The parameters of this query must be defined before or when initializing the control.
// The query will be automatically run if at least one parameter was defined.
//
// See the help for more details:
// Query with parameters, Using a Table, List Box or Combo Box control
//
// Parameters of 'QRY_pedido_consulta' query

MySource.ParamStatus = RADIO_Status
MySource.ParamPaymentModeID = COMBO_PaymentMode_tipo_pagamento
MySource.ParamData_Inicial = EDT_StartDate
MySource.ParamData_Final = EDT_EndDate











Last parameter: Order date
The last query parameter corresponds to the date of orders taken into account. The user must be able to type a date interval. To do so, we are going to use a control template.

Remark

A control template is a specific window containing different controls. All types of controls can be included in this window. A control template is a file whose extension is "WDT".
The main benefit of a control template is the re-usability. A control template found in a project can be re-used in any project window.
Furthermore, the control templates can be overridden: code can be added, the controls can be moved in the window that is using the control template. The controls can also be modified.
  • To manage the order date:
    1. In the "Project explorer" pane, expand the "Control templates" folder.
    2. Drag the control template named "TPLC_ChoosePeriod" from the "Project explorer" pane and drop it in the "WIN_Menu" window (beside the "Payment mode" control).
      Drag and Drop control template
    3. Select the control template that was just created and open its description ("Description" in the popup menu).
    4. In the description window, rename the control template. The new name is "CTPL_ChoosePeriod".
    5. Validate the description window.
    6. Reposition and align the controls if necessary.
  • We are now going to use the selected dates to pass them to the query as parameter:
    1. Display the WLanguage events associated with the Table control:
      • Select the Table control.
      • Open the popup menu (right click) and select "Code".
    2. In the "Initializing" event of the Table control, replace the lines:
      MySource.ParamStartOfPeriod = "20160101"
      MySource.ParamEndOfPeriod = "20160331"
      by:
      MySource.ParamStartOfPeriod = EDT_StartDate
      MySource.ParamEndOfPeriod = EDT_EndDate
      In this WLanguage code, EDT_StartDate and EDT_EndDate are the names of two edit controls found in the control template. Their values are associated with the parameters ParamStartOfPeriod and ParamEndOfPeriod expected by the query.
    3. Close the code editor.
    4. Save the window by clicking Save the element among the quick access buttons.
  • We are now going to check how the parameters are passed:
    1. Click Run the test of a window among the quick access buttons.
    2. Select the "Finding orders" tab if necessary.
    3. Define the different search parameters:
      • Status of orders,
      • Payment method,
      • Range of dates to take into account.
    4. Click on the "Find" control. The content of Table control is modified.
      Window test with multi-criteria search
    5. Close the test window.

DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C






DICAS 3025 - WINDEV TUTORIAL 48 - Pesquisa Multicriterio - Segundo Parametro - Parte F



https://youtu.be/2trKZbRkLxE


Bom Dia/Boa Tarde/Boa Noite


Esse Ao Vivo vai estrear as 18:00 do dia 26/08/2020 

DICAS 3025 - WINDEV TUTORIAL 48 - Pesquisa Multicriterio - Segundo Parametro - Parte F
Tutoriel WINDEV : Leçon 4.4.f. Recherche multicritère - Deuxième paramètre

ASSUNTOS

Explicando o que sera feito
Criando combox forma de pagamento 
Colocando valor padrao 1
mudando Estilo combox para interno
no codigo da tabela, colocar o valor da combox 

  

Video original da Franca

https://youtu.be/QIq8l7Jdcvo


Playlist Windev TUTORIAL












Second parameter: Payment mode
Several payment methods can be used for an order: cash, checks, ... The available payment methods are stored in the "PaymentMode" data file.
We will use an Combo Box control based on this data file to allow the user to select the desired payment method.

Remark

The "Combo Box" control is used to display a list of elements and to select an element from this list.
Unlike a List Box, a Combo Box control is not expanded: the Combo Box control expands on request or when the cursor is positioned on the control input area.
The elements displayed in a Combo Box control can be defined when creating the control in the editor. These elements:
  • are defined by programming.
  • come from a data file or query.
  • To create a Combo Box control:
    1. On the "Creation" pane, in the "Usual controls" group, click "Combo Box".
    2. Click the location where the control must be created in the window (beside the Radio Button control that was just created for example).
    3. The Combo Box control creation wizard starts.
    4. Select "Display the data found in a file or in an existing query" and go to the next step.
    5. Select the "PaymentMode" data file and go to the next step.
    6. The item that will be displayed in the Combo Box control is "Caption". Uncheck "PaymentModeID" and check "Caption". Go to the next step.
    7. Select the sort item: "Caption". Go to the next step.
    8. Select the return value: "PaymentModeID". This return value is very important because it will be passed in parameter to the query. Go to the next step.
    9. Keep the default options in the different steps of the wizard and validate the creation of the Combo Box control.
    10. The Combo Box control is automatically created in the window.
  • We are going to modify some characteristics of Combo Box control:
    1. Select the Combo Box control and open the description window ("Description" in the popup menu).
    2. In the "General" tab, modify the control caption: replace "PaymentMode combobox" by "Payment mode".
    3. In the "Content" tab, specify the initial value displayed by the Combo Box control ("Initial value" at the bottom of description window). In our case, type "1". This value corresponds to a payment in cash.
    4. Validate the control description window.
  • Change the control style: to occupy less space, we are going to select a style that displays the caption above the control.
    1. Select the Combo Box control.
    2. In the popup menu (right mouse click), select "Choose a style".
    3. In the window that is displayed, select the "COMBO_Internal" style and validate.
    4. Reduce the control size.
  • We are now going to use the value selected in the Combo Box control to pass it to the query as parameter:
    1. Display the WLanguage events associated with the Table control:
      • Select the Table control.
      • Open the popup menu (right click) and select "Code".
    2. In the "Initializing" event of the Table control, replace the line:
      MySource.ParamPaymentModeID = "1"
      by the code:
      MySource.ParamPaymentModeID = COMBO_PaymentMode
      In this code, COMBO_PaymentMode is the name of the Combo Box control that was just created. The value of this control is associated with the ParamPaymentModeID parameter expected by the query.
    3. Close the code editor.
    4. Save the window by clicking Save an element among the quick access buttons.
  • We are now going to check how the first two parameters are passed:
    1. Click Run the test of a window among the quick access buttons.
    2. Select the "Finding orders" tab pane if necessary.
    3. Change the order status with the Radio Button control and modify the payment method with the Combo Box control, then click "Find". The content of Table control is modified.
      Window test with selection of order status and payment method
    4. Close the test window.


DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C









Teste

Teste
teste