VERSION 5.00
Begin VB.Form frmSearchSRM 
   Caption         =   "Search"
   ClientHeight    =   11010
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   14520
   LinkTopic       =   "Form1"
   ScaleHeight     =   11010
   ScaleWidth      =   14520
   StartUpPosition =   3  'Windows Default
   Begin Project1.SRM_Search mo_search 
      Height          =   10815
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   14295
      _ExtentX        =   25215
      _ExtentY        =   19076
   End
End
Attribute VB_Name = "frmSearchSRM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Private Const CH_LDELIMIT = "ой"

#If LIVE = 1 Then
    Dim mo_Db As Object
#Else
    Dim mo_Db As ARMSYSCOMLib.ArmDb
#End If

Private ms_Language_Code                As String       'current user interface language

Public mb_SearchOK As Boolean
Private mt_type As SRM_CompType
Private ms_ExternalFiltersDesc As String
Private ms_ExternalFilters As String


Property Let Language_Code(as_String As String)
    ms_Language_Code = as_String
End Property

Public Property Set ArmDb(ByRef local_connection As Object)
    If Not (local_connection Is Nothing) Then
        Set mo_Db = local_connection
    End If
End Property

Property Let SearchType(ByVal at_type As SRM_CompType)
    mt_type = at_type
End Property

Public Property Let ExternalFilters(ByVal as_ExternalFilters As String)
    ms_ExternalFilters = as_ExternalFilters
End Property

Public Property Let ExternalFiltersDesc(ByVal as_ExternalFiltersDesc As String)
    ms_ExternalFiltersDesc = as_ExternalFiltersDesc
End Property


Private Sub Form_Load()

On Error GoTo ErrHandler

    
    'mo_search.ComponentType = SRM_CompType.Vendor
    'mo_search.ExternalFilters = ""
    
    'mo_search.ComponentType = SRM_CompType.User
    'mo_search.ExternalFilters = ""
    
    'mo_search.ComponentType = SRM_CompType.Contact
    'mo_search.ExternalFilters = ""
    
    'mo_search.ComponentType = SRM_CompType.Product
    'mo_search.ExternalFiltersDesc = "Plant name = 'MUNSTER'"
    'mo_search.ExternalFilters = "MFGP_code" & CH_LDELIMIT & "P567-MUNS"
    
    
    Exit Sub
ErrHandler:
    Call MsgBox("Unexpected error occured. Please, contact IT department." & vbCrLf & "Error:" & Err.Description & " Err.Numer=" & Err.Number)
End Sub

Public Sub Load_A_Com()
On Error GoTo ErrHandler
    
    Set mo_search.ArmDb = mo_Db
    mo_search.Language_Code = ms_Language_Code
    mo_search.ComponentType = mt_type
    mo_search.ExternalFiltersDesc = ms_ExternalFiltersDesc
    mo_search.ExternalFilters = ms_ExternalFilters
    mo_search.Load_A_Com
    
    Exit Sub
ErrHandler:
    Call MsgBox("Unexpected error occured. Please, contact IT department." & vbCrLf & "Error:" & Err.Description & " Err.Numer=" & Err.Number)
End Sub

Public Sub UnLoad_A_Com()
On Error GoTo ErrHandler
    
    Set mo_search.ArmDb = Nothing
    mo_search.UnLoad_A_Com

    Call Unload(Me)
    Exit Sub
ErrHandler:
    Call MsgBox("Unexpected error occured. Please, contact IT department." & vbCrLf & "Error:" & Err.Description & " Err.Numer=" & Err.Number)
End Sub

Private Sub mo_search_quit()
    mb_SearchOK = mo_search.IsDataSelected
    Me.Hide
End Sub
