VERSION 5.00
Begin VB.Form Test_Criteria 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Item criteria list"
   ClientHeight    =   10500
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   12810
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "Test_Criteria.frx":0000
   ScaleHeight     =   10500
   ScaleWidth      =   12810
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmd_Quit 
      Height          =   615
      Left            =   12000
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   9840
      Width           =   675
   End
   Begin Project1.ArmGrid grd_List 
      Height          =   9735
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   12735
      _ExtentX        =   22463
      _ExtentY        =   17171
   End
End
Attribute VB_Name = "Test_Criteria"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Const SEP = "ой"                  'standard armstrong separator

Public m_Req As String
Public m_Plant As Boolean

Private Const FForm = "Test_Criteria"
Private ms_Server As String
'name of database to connect
Private ms_Db As String
'user name when opening connection to sql server
Private ms_User As String
'user passwrod
Private ms_Pwd As String
'application name displayed in connection row in sql server manager
Private ms_App As String

Private Sub cmd_Quit_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    
cmd_Quit.Picture = LoadResPicture(RES_QUIT, 1)


grd_List.load_A_Com

Set grd_List.ArmDb = ADB

If Not FillGrid Then
    MouseOn
    SendMessage 191, "Impossible to display item list", gut_LangLogin.Code
End If

MouseOn

End Sub



Private Function FillGrid() As Boolean
Dim la_Columns(10) As String

FillGrid = False

On Error GoTo Err_Grid
    
grd_List.ResetGrid
grd_List.Title = "Items for criteria list"
grd_List.MultiSelect = True

la_Columns(0) = "bi_sap_code" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "1" & CH_LDELIMIT & "bi_sap_code" & CH_LDELIMIT & "SAP code"
la_Columns(1) = "bml_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "bml_desc" & CH_LDELIMIT & "Material"
la_Columns(2) = "colour_desc" & CH_LDELIMIT & "1550" & CH_LDELIMIT & "0" & CH_LDELIMIT & "colour_desc" & CH_LDELIMIT & "Colour"
la_Columns(3) = "pe_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "pe_desc" & CH_LDELIMIT & "Edge/Group"
la_Columns(4) = "pf_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "pf_desc" & CH_LDELIMIT & "Family"
la_Columns(5) = "pp_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "pp_desc" & CH_LDELIMIT & "Pattern"
la_Columns(6) = "ps_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "ps_desc" & CH_LDELIMIT & "Range"
la_Columns(7) = "sf_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "sf_desc" & CH_LDELIMIT & "Surface"
la_Columns(8) = "pm_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "pm_desc" & CH_LDELIMIT & "Module"
la_Columns(9) = "ph_height" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "ph_height" & CH_LDELIMIT & "Height/Thickness"
If m_Plant Then
    la_Columns(10) = "mfgp_name" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "mfgp_name" & CH_LDELIMIT & "Plant"
Else
    la_Columns(10) = "sp_desc" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "sp_desc" & CH_LDELIMIT & "Supplier"
End If

grd_List.SetColumns la_Columns
'grd_List.LoadConstants ptSQL, "EXEC screen_csts_lst2 'cap_project_longlist', 'grid', '" & m_Language & "'", ctColumns

grd_List.Requests = m_Req
'grd_List.FetchAll = True

If Not grd_List.Execute Then
    Err.Raise C_ERRORRAISE + 191, ADB.LastErrorCode & " : " & ADB.LastErrorMessage & ", " & FForm & "/FillGrid: " & m_Req
End If

FillGrid = True
Exit Function

Err_Grid:
    UploadSQLError ADB, adb_err, FForm & "/FillGrid: " & m_Req
End Function
