VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Begin VB.Form PrdValOf 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "#Product validation"
   ClientHeight    =   5340
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   12045
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5340
   ScaleWidth      =   12045
   StartUpPosition =   1  'CenterOwner
   Tag             =   "PrdValOf"
   Begin Project1.ArmCombobox cbo_LR 
      Height          =   345
      Left            =   3600
      TabIndex        =   7
      Top             =   4380
      Width           =   4455
      _ExtentX        =   7858
      _ExtentY        =   609
   End
   Begin Project1.ToolBr pbItem 
      Align           =   1  'Align Top
      Height          =   315
      Left            =   0
      TabIndex        =   6
      Top             =   0
      Width           =   12045
      _ExtentX        =   21246
      _ExtentY        =   556
   End
   Begin VB.CheckBox chk_Ref 
      Height          =   255
      Left            =   3600
      TabIndex        =   5
      Tag             =   "chk_Ref"
      Top             =   4920
      Width           =   1335
   End
   Begin MSComctlLib.ListView lv_Products 
      Height          =   3015
      Left            =   -30
      TabIndex        =   4
      Top             =   1245
      Width           =   12015
      _ExtentX        =   21193
      _ExtentY        =   5318
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      Checkboxes      =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   10
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Object.Tag             =   "c1"
         Text            =   "#WON"
         Object.Width           =   1058
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Object.Tag             =   "c2"
         Text            =   "#M/A"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Object.Tag             =   "c3"
         Text            =   "#Area"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Object.Tag             =   "c4"
         Text            =   "#Short Code"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Object.Tag             =   "c5"
         Text            =   "#Product"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Object.Tag             =   "c6"
         Text            =   "#Size"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   6
         Object.Tag             =   "c7"
         Text            =   "#Module"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   7
         Object.Tag             =   "c8"
         Text            =   "#Measure"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   8
         Object.Tag             =   "c9"
         Text            =   "#Creator"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(10) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   9
         Object.Tag             =   "c10"
         Text            =   "#Date entered"
         Object.Width           =   2540
      EndProperty
   End
   Begin VB.TextBox txt_Desc 
      Enabled         =   0   'False
      Height          =   375
      Left            =   5040
      TabIndex        =   1
      Top             =   720
      Width           =   5655
   End
   Begin VB.Label lbl_Ref 
      Caption         =   "#Reference Project"
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Tag             =   "lbl_Ref"
      Top             =   4920
      Width           =   3315
   End
   Begin VB.Label lbl_LR 
      Caption         =   "#Reason why unselect lines were lost"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Tag             =   "lbl_LR"
      Top             =   4440
      Width           =   3315
   End
   Begin VB.Label lbl_Desc 
      Alignment       =   1  'Right Justify
      Caption         =   "#Project Name"
      Height          =   255
      Left            =   2280
      TabIndex        =   0
      Tag             =   "lbl_Desc"
      Top             =   780
      Width           =   2655
   End
End
Attribute VB_Name = "PrdValOf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'******** Curseur de connexion
Private mo_ArmDb As Object
Private mb_Created As Boolean
Private mb_use_framework_connection As Boolean
Private ms_ConnectString As String
Private ms_UID As String

Private mb_DoCheck As Boolean

Private m_Language As String

Private ms_SP As String                 ' Sales Project ID
Private mi_Conc As Integer
Private ms_SpCountry As String

Private mb_Validated As Boolean

Private p_CountRec As Integer

Private mb_AskByApp As Boolean

Public Property Set ArmDb(ByRef ao_local_connection As Object)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:ArmDb_Set"
    #End If
    CapMouseOff
    
    If Not (ao_local_connection Is Nothing) Then
        Set mo_ArmDb = ao_local_connection
        mb_use_framework_connection = True
        Set cbo_LR.ArmDb = mo_ArmDb
        Set pbitem.ArmDb = mo_ArmDb
    End If
    
Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:ArmDb_Set"
    #End If
    CapMouseOn
End Property

Property Let ConnectString(as_ConnectString As String)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:ConnectString_Let", "as_ConnectString=" & as_ConnectString
    #End If
    CapMouseOff
    
    ms_UID = ConnectionStringValidation(as_ConnectString)
    If ms_UID = "" Then GoTo Trace_End
    
    ms_ConnectString = as_ConnectString
    cbo_LR.ConnectString = ms_ConnectString
    pbitem.ConnectString = ms_ConnectString

Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:ConnectString_Let"
    #End If
    CapMouseOn
End Property

Property Let Language(ALng As String)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Language_Let", "ALng=" & ALng
    #End If
    CapMouseOff
    
    m_Language = ALng
    pbitem.Language = m_Language
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Language_Let"
    #End If
    CapMouseOn
End Property

Public Property Get Validated() As Boolean
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Validated_Get"
    #End If
    CapMouseOff
    
    Validated = mb_Validated
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Validated_Get", "Result=" & Validated
    #End If
    CapMouseOn
End Property

Property Get CountRec() As Integer
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:CountRec_Get"
    #End If
    CapMouseOff
    
    CountRec = p_CountRec
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:CountRec_Get", "Result=" & CountRec
    #End If
    CapMouseOn
End Property

Property Let iConc(AiConc As Integer)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:iConc_Let", "AiConc=" & AiConc
    #End If
    CapMouseOff
    
    mi_Conc = AiConc
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:iConc_Let"
    #End If
    CapMouseOn
End Property

Public Property Get project() As String
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Project_Get"
    #End If
    CapMouseOff
    
    project = ms_SP
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Project_Get", "Result=" & project
    #End If
    CapMouseOn
End Property

Public Property Let project(ByVal as_ProjectKey As String)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Project_Let", "as_ProjectKey=" & as_ProjectKey
    #End If
    CapMouseOff
    
    ms_SP = as_ProjectKey
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Project_Let"
    #End If
    CapMouseOn
End Property

Public Property Let projectCountry(ByVal as_ProjectCountry As String)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:projectCountry", "as_ProjectCountry=" & as_ProjectCountry
    #End If
    CapMouseOff
    
    ms_SpCountry = as_ProjectCountry
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:projectCountry"
    #End If
    CapMouseOn
End Property

Public Sub Display()
Dim TheRequest As String
Dim ll_Cursor As Long

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Display"
    #End If
      
    'Try connection, 'use_framework_connection' is inside 'ASC_ConnectToDB' !
    If Not ASC_ConnectToDB(mo_ArmDb, ms_ConnectString, mb_Created) Then GoTo Trace_End
    
    TheRequest = "exec sales_project_t_sel4 " & "'" & ms_SP & "', 'E'"
    ll_Cursor = mo_ArmDb.OpenSQL(TheRequest, -1, 0)
    If ll_Cursor = 0 Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceSQLError mo_ArmDb, "PrdValOf:Display", "Request=" & TheRequest
        GoTo Trace_End
    End If
    txt_desc = mo_ArmDb.GetFields(ll_Cursor, "SP_desc")
    LoadListView
    
Trace_End:
    mo_ArmDb.Close ll_Cursor
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Display"
    #End If
    CapMouseOn
    Exit Sub
Trace_Err:
    mo_ArmDb.Close ll_Cursor
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:Display"
    CapMouseOn
End Sub

Public Function Save() As Boolean
Dim ll_Idx As Long
Dim ll_Count As Long
Dim ls_SOL_Code As String
Dim li_conc As String
Dim ls_S_code As String
Dim lv_Key As Variant
Dim ls_LR_code As String
Dim ls_S_install As String
Dim ls_Req As String
Dim li_concp    As Integer
Dim ls_LFlag As String
Dim lb_Result As Boolean
Dim ls_Result As String

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Save"
    #End If
      
    Save = False
    
    If Not ASC_ConnectToDB(mo_ArmDb, ms_ConnectString, mb_Created) Then GoTo Trace_End
    
    ll_Count = lv_Products.ListItems.Count
    
    ls_LFlag = "L"
    If Not mb_DoCheck Then
        ls_LFlag = "N"
        For ll_Idx = 1 To ll_Count
            If lv_Products.ListItems.Item(ll_Idx).Checked Then
                ls_LFlag = "L"
                Exit For
            End If
        Next
    End If

    lb_Result = True
    For ll_Idx = 1 To ll_Count
        lv_Key = Split(lv_Products.ListItems.Item(ll_Idx).Tag, CH_LDELIMIT)
        ls_SOL_Code = lv_Key(0)
        ls_S_code = lv_Key(1)
        li_conc = CInt(lv_Key(2))
        
        If lv_Products.ListItems.Item(ll_Idx).Checked Then
            ls_LR_code = "NULL"
            ls_S_install = "W"
        Else
            ls_LR_code = "'" & GetCodeFromCombo(cbo_LR) & "'"
            ls_S_install = ls_LFlag
        End If
            
        ls_Req = "exec Cap_SolutionSystem_upd2 " & "'" & ls_SOL_Code & "', '" & ls_S_code & "', " & ls_LR_code & ", '" & ls_S_install & "', '" & li_conc & "'"
        lb_Result = ASC_RecordExec(mo_ArmDb, ls_Req, ls_Result)
        If lb_Result = False Then GoTo Trace_End
    Next
    
    If chk_Ref.value = 1 Then
        li_concp = mi_Conc + 1
        ls_Req = "exec Sales_Project_upd3 " & "'" & ms_SP & "', '" & li_concp & "' , '16'"
        lb_Result = ASC_RecordExec(mo_ArmDb, ls_Req, ls_Result)
    End If

    Save = lb_Result

Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Save", "Result=" & lb_Result
    #End If
    CapMouseOn
    Exit Function
    
Trace_Err:
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:Save", "Result=False"
    CapMouseOn
End Function

Private Function Check() As Boolean
Dim ll_Idx As Long
Dim ll_Count As Long
Dim lb_Check As Boolean
Dim lb_UnCheck As Boolean
Dim lb_Result As String
Dim ls_Result As String
Dim ls_Request As String

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Check"
    #End If
     
    If Not cbo_LR.SelectedItem Is Nothing Then
        If GetCodeFromCombo(cbo_LR) <> "" Then
            ls_Request = "Exec Cap_LooseReason_chk " & GetCodeFromCombo(cbo_LR) & ",'" & ms_SpCountry & "'"
            lb_Result = ASC_RecordExec(mo_ArmDb, ls_Request, ls_Result, False)
            If lb_Result Then
                If Mid(ls_Result, 1, 1) = "~" Then
                    Call ASC_SendMessage(mo_ArmDb, m_Language, 926, "#This data is not authorized for this country", lbl_LR.Caption & " : " & cbo_LR.SelectedItem.DisplayText)
                    cbo_LR.SetFocus
                    GoTo Trace_End
                End If
            End If
        End If
    End If
    
    If Not mb_DoCheck Then
        Check = True
        GoTo Trace_End
    End If
     
    lb_UnCheck = False
    lb_Check = False
   
    ' if one item is not checked, user must choose a loose reason
    ll_Count = lv_Products.ListItems.Count
    
    For ll_Idx = 1 To ll_Count
        If Not lv_Products.ListItems.Item(ll_Idx).Checked Then
            lb_UnCheck = True
        Else
            lb_Check = True
        End If
    Next
    
    If lb_UnCheck And (GetCodeFromCombo(cbo_LR) = "") Then
        Call ASC_SendMessage(mo_ArmDb, m_Language, 203, "#You must choose a loose reason")
        Check = False
        GoTo Trace_End
    End If
    
    If Not lb_Check Then
        Call ASC_SendMessage(mo_ArmDb, m_Language, 204, "You must confirm at least one product")
        Check = False
        GoTo Trace_End
    End If
    
    Check = True
    
Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Check", "Result=" & Check
    #End If
    CapMouseOn
    Exit Function
Trace_Err:
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:Check"
    CapMouseOn
End Function

Private Sub LoadListView()
Dim ln_Node As ListItem
Dim ls_LRcode As String
Dim ls_Req As String
Dim ls_LRdesc As String
Dim ll_Cursor As Long

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:LoadListView"
    #End If
      
    If Not ASC_ConnectToDB(mo_ArmDb, ms_ConnectString, mb_Created) Then GoTo Trace_End
    
    ls_Req = "exec Cap_ProjectProduct_t_lst2 " & "'" & ms_SP & "', '" & m_Language & "'"
    ll_Cursor = mo_ArmDb.OpenSQL(ls_Req, -1, 0)
    If ll_Cursor = 0 Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceSQLError mo_ArmDb, "PrdValOf:LoadListView", "Request=" & ls_Req
        GoTo Trace_End
    End If
    
    p_CountRec = mo_ArmDb.RowCount(ll_Cursor)
    
    lv_Products.ListItems.Clear
    mo_ArmDb.First ll_Cursor
    Do Until mo_ArmDb.EOF(ll_Cursor)
        Set ln_Node = lv_Products.ListItems.Add
        ln_Node.Text = ""
        ln_Node.Tag = mo_ArmDb.GetFields(ll_Cursor, "SOL_CODE") & CH_LDELIMIT & mo_ArmDb.GetFields(ll_Cursor, "S_CODE") & CH_LDELIMIT & CStr(mo_ArmDb.GetFields(ll_Cursor, "iConcurrency"))
        ln_Node.Checked = IIf(mo_ArmDb.GetFields(ll_Cursor, "S_InstallFlag") = "W", 1, 0)
        ln_Node.SubItems(1) = mo_ArmDb.GetFields(ll_Cursor, "MA_desc")
        ln_Node.SubItems(2) = mo_ArmDb.GetFields(ll_Cursor, "AR_DESC")
        ln_Node.SubItems(3) = mo_ArmDb.GetFields(ll_Cursor, "S_CODE")
        ln_Node.SubItems(4) = mo_ArmDb.GetFields(ll_Cursor, "S_DESC")
        ln_Node.SubItems(5) = mo_ArmDb.GetFields(ll_Cursor, "PM_DESC")
        ln_Node.SubItems(6) = mo_ArmDb.GetFields(ll_Cursor, "SS_QTY")
        ln_Node.SubItems(7) = mo_ArmDb.GetFields(ll_Cursor, "UM_code")
        ln_Node.SubItems(8) = mo_ArmDb.GetFields(ll_Cursor, "Z_creator")
        ln_Node.SubItems(9) = mo_ArmDb.GetFields(ll_Cursor, "Z_creation")
        If mo_ArmDb.GetFields(ll_Cursor, "LR_CODE") <> "" And mo_ArmDb.GetFields(ll_Cursor, "LR_CODE") <> "0" Then
            ls_LRcode = mo_ArmDb.GetFields(ll_Cursor, "LR_CODE")
            ls_LRdesc = mo_ArmDb.GetFields(ll_Cursor, "LR_desc")
        End If
       
        mo_ArmDb.Next ll_Cursor
    Loop
    If ls_LRcode <> "" And ls_LRcode <> "0" Then
             cbo_LR.AddItem Array(ls_LRcode, ls_LRdesc), True
    End If
    
Trace_End:
    mo_ArmDb.Close ll_Cursor
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:LoadListView"
    #End If
    CapMouseOn
    Exit Sub
Trace_Err:
    mo_ArmDb.Close ll_Cursor
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:LoadListView"
    CapMouseOn
End Sub

Private Sub Form_Activate()
    If Not mb_AskByApp Then
        Me.Hide
    End If
End Sub

Private Sub Form_Initialize()
    
    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Form_Initialize"
    #End If
      
    ms_SP = ""
    mb_Validated = False

Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Form_Initialize"
    #End If
    CapMouseOn
    Exit Sub
Trace_Err:
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:Form_Initialize"
    CapMouseOn
End Sub

Public Sub Load_A_Com()

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Load_A_Com"
    #End If
      
    VerifyInitialization mo_ArmDb, ms_ConnectString, m_Language, Me
    
    pbitem.Load_A_Com
    cbo_LR.Load_A_Com
    
    cbo_LR.FirstBlankItem = False
    cbo_LR.SearchPrefix = " "
    cbo_LR.Request = "exec cap_loosereason_cbo " & "'" & ms_UID & "', '" & m_Language & "'"
    
    pbitem.ClearAllIcons
    pbitem.PictureDisplayed = "P_Valid=1 P_Undo=2 P_Quit=-1"
    
    Call LoadLabels(mo_ArmDb, Me, "Cap_Product_Validation", m_Language)
    
    Call RAZ
    
Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Load_A_Com"
    #End If
    CapMouseOn
    Exit Sub
Trace_Err:
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:Load_A_Com"
    CapMouseOn
End Sub

Public Sub Unload_A_Com()

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Unload_A_Com"
    #End If
      
    pbitem.Unload_A_Com
    cbo_LR.Unload_A_Com
    
    ASC_DisconnectFromDB mo_ArmDb, ms_UID, mb_Created
    
    Set mo_ArmDb = Nothing

Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Unload_A_Com"
    #End If
    CapMouseOn
    Exit Sub
Trace_Err:
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:Form_Unload"
    CapMouseOn
End Sub

Private Sub pbItem_action(ByVal as_ActionType As String)

    On Error GoTo Trace_Err
    CapMouseOff
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:pbItem_action", "as_ActionType=" & as_ActionType
    #End If
      
    Select Case as_ActionType
        Case "Quit"
            Me.Hide

        Case "Undo"
            LoadListView
            
        Case "Valid"
            If Check = True Then
                Me.Hide
                mb_Validated = True
            End If
        
        Case Else
            Me.Hide
    End Select

Trace_End:
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:pbItem_action"
    #End If
    CapMouseOn
    Exit Sub
Trace_Err:
    If Not go_Trace Is Nothing Then go_Trace.WriteTraceError Err.Number, Err.Description, "PrdValOf:pbItem_action"
    CapMouseOn
End Sub

Public Property Let DoCheck(ByVal ab_DoCheck As Boolean)
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:DoCheck_Let", "ab_DoCheck =" & ab_DoCheck
    #End If
    CapMouseOff
    
    mb_DoCheck = ab_DoCheck
    lbl_LR.FontBold = mb_DoCheck
    cbo_LR.Clear
    cbo_LR.FirstBlankItem = Not mb_DoCheck
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:DoCheck_Let"
    #End If
    CapMouseOn
End Property

Public Property Get DoCheck() As Boolean
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:DoCheck_Get"
    #End If
    CapMouseOff
    
    DoCheck = mb_DoCheck
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:DoCheck_Get", "Result =" & mb_DoCheck
    #End If
    CapMouseOn
End Property

Public Function Launch() As Boolean
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:Launch"
    #End If
    CapMouseOff
    
    mb_Validated = False
    CapMouseOn True
    mb_AskByApp = True
    Call show(vbModal)
    mb_AskByApp = False
    CapMouseOff True
    Launch = mb_Validated
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:Launch", "Result =" & mb_Validated
    #End If
    CapMouseOn
End Function

Public Sub RAZ()
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc True, "PrdValOf:RAZ"
    #End If
    CapMouseOff
    
    mb_Validated = False
    
    #If CapDebug Then
        If Not go_Trace Is Nothing Then go_Trace.WriteTraceProc False, "PrdValOf:RAZ"
    #End If
    CapMouseOn
End Sub
