VERSION 5.00
Begin VB.Form TestRes 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   7515
   ClientLeft      =   1695
   ClientTop       =   405
   ClientWidth     =   8220
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   7515
   ScaleWidth      =   8220
   ShowInTaskbar   =   0   'False
   Begin VB.PictureBox ButtonBox 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   6675
      Left            =   7450
      ScaleHeight     =   6645
      ScaleWidth      =   630
      TabIndex        =   15
      Top             =   720
      Width           =   665
      Begin VB.PictureBox pic_refresh 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   26
         Top             =   3600
         Width           =   480
      End
      Begin VB.PictureBox pic_log 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   25
         Top             =   2400
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_print 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   24
         Top             =   3000
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_search 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   1920
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   23
         Top             =   120
         Width           =   384
      End
      Begin VB.PictureBox pic_delete 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   22
         Top             =   1200
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_upd 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   21
         Top             =   600
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_add 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   20
         Top             =   60
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_quit 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   19
         Top             =   4200
         Width           =   480
      End
      Begin VB.PictureBox pic_help 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   8640
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   18
         Top             =   120
         Width           =   384
      End
      Begin VB.PictureBox pic_Language 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   17
         Top             =   4800
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.PictureBox pic_Order 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   16
         Top             =   1800
         Visible         =   0   'False
         Width           =   480
      End
   End
   Begin VB.TextBox txt_Result 
      Height          =   285
      Index           =   5
      Left            =   2760
      Locked          =   -1  'True
      MaxLength       =   40
      TabIndex        =   9
      Top             =   1740
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.TextBox txt_Result 
      Height          =   285
      Index           =   4
      Left            =   2760
      Locked          =   -1  'True
      MaxLength       =   40
      TabIndex        =   8
      Top             =   1320
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.TextBox txt_Result 
      Height          =   285
      Index           =   2
      Left            =   2760
      Locked          =   -1  'True
      MaxLength       =   40
      TabIndex        =   7
      Top             =   480
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.TextBox txt_Result 
      Height          =   285
      Index           =   1
      Left            =   2760
      Locked          =   -1  'True
      MaxLength       =   40
      TabIndex        =   6
      Top             =   60
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.CommandButton cmd_result 
      Caption         =   "..."
      Height          =   285
      Index           =   5
      Left            =   5820
      TabIndex        =   5
      Top             =   1740
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.CommandButton cmd_result 
      Caption         =   "..."
      Height          =   285
      Index           =   4
      Left            =   5820
      TabIndex        =   4
      Top             =   1335
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.CommandButton cmd_result 
      Caption         =   "..."
      Height          =   285
      Index           =   3
      Left            =   5820
      TabIndex        =   3
      Top             =   915
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.CommandButton cmd_result 
      Caption         =   "..."
      Height          =   285
      Index           =   2
      Left            =   5820
      TabIndex        =   2
      Top             =   480
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.CommandButton cmd_result 
      Caption         =   "..."
      Height          =   285
      Index           =   1
      Left            =   5820
      TabIndex        =   1
      Top             =   60
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.TextBox txt_Result 
      Height          =   285
      Index           =   3
      Left            =   2760
      Locked          =   -1  'True
      MaxLength       =   40
      TabIndex        =   0
      Top             =   900
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.Label lbl_Result 
      Caption         =   "Result 5"
      Height          =   195
      Index           =   5
      Left            =   120
      TabIndex        =   14
      Top             =   1800
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.Label lbl_Result 
      Caption         =   "Result 4"
      Height          =   195
      Index           =   4
      Left            =   120
      TabIndex        =   13
      Top             =   1380
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.Label lbl_Result 
      Caption         =   "Result 3"
      Height          =   255
      Index           =   3
      Left            =   120
      TabIndex        =   12
      Top             =   915
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.Label lbl_Result 
      Caption         =   "Result 2"
      Height          =   255
      Index           =   2
      Left            =   120
      TabIndex        =   11
      Top             =   495
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.Label lbl_Result 
      Caption         =   "Result 1"
      Height          =   195
      Index           =   1
      Left            =   120
      TabIndex        =   10
      Top             =   120
      Visible         =   0   'False
      Width           =   2535
   End
End
Attribute VB_Name = "TestRes"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public mi_TopForm As Integer
Public mi_LeftForm As Integer
Private mla_TYTTranslate(4) As Long       ' task 462 used to translate index->tyt_code in GetCode()


Private Sub cmd_result_Click(Index As Integer)

'iconcurrency
gut_Param.Str25 = gv_result(GetCode(Index), 3)
'field code
gut_Param.Str26 = gv_result(GetCode(Index), 1)
'test code
gut_Param.Str27 = CStr(gi_TestCode)
'concatenated field
gut_Param.Str28 = gv_result(GetCode(Index), 4)
'curve ID
gut_Param.Str29 = gv_result(GetCode(Index), 5)

If gv_result(GetCode(Index), 2) = 3 Then
    'curve with 6 items
    gs_ParamReqIns = "exec Test_Value_Curve_ins1"
    gs_ParamReqUpd = "exec Test_Value_Curve_upd1"
    gut_Param.Str1 = "Test_6"
    gut_Param.Str23 = "exec Screen_Csts 'mtnc_Curve_6v'"
ElseIf gv_result(GetCode(Index), 2) = 4 Then
    'curve with 18 items
    gs_ParamReqIns = "exec Test_Value_Curve_ins2"
    gs_ParamReqUpd = "exec Test_Value_Curve_upd2"
    gut_Param.Str1 = "Test_18"
    gut_Param.Str23 = "exec Screen_Csts 'mtnc_Curve_18v'"
End If

gs_Action = "MoreInfo"
Tech_Value_Curve.show 1

MouseOn

End Sub


Private Sub Form_Load()

On Error GoTo suite

MouseOff

If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharSet Me

pic_add.Picture = LoadResPicture(RES_ADD, 1)
pic_delete.Picture = LoadResPicture(RES_DELETE, 1)
pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
pic_Quit.Picture = LoadResPicture(RES_QUIT, 1)
pic_Print.Picture = LoadResPicture(RES_PRINT, 1)
pic_refresh.Picture = LoadResPicture(RES_REFRESH, 1)
pic_help.Picture = LoadResPicture(RES_HELP, 1)
pic_Log.Picture = LoadResPicture(RES_LOG, 1)
gut_LangWork = gut_LangLogin
Top = mi_TopForm
Left = mi_LeftForm
Width = 8250
Height = 7545

txt_Result(1).Enabled = False
txt_Result(2).Enabled = False
txt_Result(3).Enabled = False
txt_Result(4).Enabled = False
txt_Result(5).Enabled = False

If Test_UpdateCommonInformation() = OK Then
    ' read screen constants (depends on test category)
    ReadConstants
    FillTabResults gi_TestCode, gut_LangLogin.Code
    Permission
End If

MouseOn
Exit Sub

suite:
StdError
End Sub

Private Sub FillTabResults(ByVal li_tst_code As Integer, ByVal ls_Language_Code As String)
'------------------------------------------------------------------
' Name : FillTabResults()
'
' Purpose : fill in the results tab
'
' Parameters : li_tst_code : (integer) test code
'              ls_language_code : (string)
'
' review : 04/20/1999 by D. Pozzera
'------------------------------------------------------------------

Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim i As Integer

txt_Result(1) = ""
txt_Result(2) = ""
txt_Result(3) = ""
txt_Result(4) = ""
txt_Result(5) = ""
' task 462 JN
For i = LBound(mla_TYTTranslate) To UBound(mla_TYTTranslate)
    mla_TYTTranslate(i) = 0
Next i

Call InitResult(gs_CodeCategory)
'mb_FillTabResults = KO

ls_Req = "EXEC Test_Result_t_lst " _
    & li_tst_code _
    & ", '" & gut_LangLogin.Code & "'"

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        i = ODBCData(ll_Statement, 1)
        'code of the result
        gv_result(i, 1) = i
        ' iConcurrency
        gv_result(i, 3) = ODBCData(ll_Statement, 2)
        ' desc
        gv_result(i, 4) = ODBCData(ll_Statement, 3)
        ' code of the curve if available
        gv_result(i, 5) = ODBCData(ll_Statement, 4)
    End If
Loop

li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)


For i = 1 To gi_nbresult
    Select Case gv_result(GetCode(i), 2)
    Case 1, 2
        txt_Result(i).Visible = OK
        txt_Result(i) = gv_result(GetCode(i), 4)
        cmd_result(i).Visible = KO
    Case 3, 4
        'if result was a curve, command button was visible
    'If gv_result(GetCode(i), 2) >= 3 Then
        txt_Result(i).Visible = OK
        txt_Result(i) = gv_result(GetCode(i), 4)
        cmd_result(i).Visible = OK
    Case 5
        txt_Result(i).Visible = OK
        txt_Result(i) = gv_result(GetCode(i), 4)
    End Select
Next i

MouseOn
Exit Sub

End Sub






Private Sub ReadConstants()
'------------------------------------------------------------------
' Name : ReadConstants()
'
' Purpose : Read all label in a specific language
'
'
' review : 02/06/1999 by JJB
' review : Jan/28/2000 by JJB We don't save anymore the constants in a file because now, we cache the stored procedure
'------------------------------------------------------------------

Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Field As String
Dim ls_Text As String
Dim ls_Title As String

On Error GoTo Err_ReadConstants
ls_Req = "EXEC Screen_Csts 'TestRs" & gs_CodeCategory & "', '" & gut_LangLogin.Code & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Field = ODBCData(ll_Statement, 1)
        ls_Text = ODBCData(ll_Statement, 2)
        Select Case ls_Field
            Case "lbl_Result1":
                lbl_Result(1) = ls_Text
                lbl_Result(1).Visible = OK
            Case "lbl_Result2":
                lbl_Result(2) = ls_Text
                lbl_Result(2).Visible = OK
            Case "lbl_Result3":
                lbl_Result(3) = ls_Text
                lbl_Result(3).Visible = OK
            Case "lbl_Result4":
                lbl_Result(4) = ls_Text
                lbl_Result(4).Visible = OK
            Case "lbl_Result5":
                lbl_Result(5) = ls_Text
                lbl_Result(5).Visible = OK
        End Select
  End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

Err_ReadConstants:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub



Private Sub Permission()
On Error GoTo suite

If gb_TestCanUpd Then
' pic_add.Visible = OK
' pic_delete.Visible = OK
 pic_upd.Visible = OK
Else
' pic_add.Visible = KO
' pic_delete.Visible = KO
 pic_upd.Visible = KO
End If
Exit Sub

suite:
StdError
End Sub

Private Function GetCode(ByVal li_indexchamp As Integer) As Integer
'------------------------------------------------------------------
' Name : GetCode
'
' Purpose : return the code of the field according to test category
'
' Parameters : li_indexchamp : field index
'
' Return values : (integer) the code of field
'
' review : 04/20/1999 by D. Pozzera
'------------------------------------------------------------------
    GetCode = mla_TYTTranslate(li_indexchamp - 1)

End Function



'------------------------------
'initilisation of all parameters because all data are not in table
'if you crate parameters, don't forget to modify GetCode and GetIndex
'
'gv_result(x, 1) : field code / test type code
'gv_result(x, 2) : field type 1=string 2=integer 3=curve_6_items
'                  4=curve_18_items 5=global set string
'gv_result(x, 3) : iconcurrency
'gv_result(x, 4) : description
'------------------------------
' task462 B
Private Sub InitResult(ByVal as_catCode As String)
    Const C_REQ As String = "EXEC Test_Result_info_lst $CAT_CODE$"

    Dim ls_req As String
    Dim ll_resIdx  As Long
    Dim ll_Statement As Long
    Dim li_Status As Integer
    gi_nbresult = 0
    ls_req = Replace(C_REQ, "$CAT_CODE$", as_catCode)
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
        li_Status = SQL_SUCCESS
    Else
        li_Status = SQL_ERROR
    End If
    Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
        li_Status = SQLFetch(ll_Statement)
        If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
            gi_nbresult = gi_nbresult + 1
        
            ll_resIdx = ODBCData(ll_Statement, 1) '"TYT_CODE"
            gv_result(ll_resIdx, 1) = ll_resIdx
            gv_result(ll_resIdx, 2) = ODBCData(ll_Statement, 2) '"TYPE_FIELD"
            gv_result(ll_resIdx, 3) = 1
            gv_result(ll_resIdx, 4) = ""
            mla_TYTTranslate(ODBCData(ll_Statement, 3) - 1) = ll_resIdx

        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)

    End Sub

Private Sub pic_quit_Click()
MouseOff
'Test_main.Show
'Test_main.SSP_Tab.Visible = KO
Unload Me
MouseOn
End Sub

Private Sub pic_refresh_Click()
On Error GoTo suite

MouseOff
FillTabResults gi_TestCode, gut_LangLogin.Code
MouseOn
Exit Sub

suite:
StdError
End Sub


Private Sub pic_upd_Click()

On Error GoTo suite

MouseOff
gb_Return = KO
gs_Action = "Update"
TestRes_mtnc.show 1

If gb_Return Then
End If

MouseOn
Exit Sub

suite:
StdError
End Sub


