'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL1 As SQL
Dim cursor1 As Cursor
Dim index1 As Object
Dim index2 As Object
Dim index3 As Object
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim SP_Start As Spinner
Dim SP_Start_valSelected
Dim Panel1 As Panel
Dim panel2 As Panel
Dim psv1 As Panel
Dim psv2 As Panel
'Dim psv3 As Panel
Dim LVDb As ListView
Dim cmdAdd As Button
Dim cmdDelete As Button
Dim cmdEdit As Button
Dim ID As String
Dim SelCustomer As SearchView
'Dim SelDescription As SearchView
Dim SelProduct As SearchView
Dim lbl_pro As Label
Dim lbl_cust As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("orderentry")
If SQL1.IsInitialized = False Then
SQL1.Initialize(File.DirInternal, "client.db", False)
End If
SelCustomer.Initialize(Me,"SelCustomer")
SelProduct.Initialize(Me,"SelProduct")
'SelDescription.Initialize(Me,"SelDescription")
SelCustomer.AddToParent(panel2, 0,0, 200dip, 300dip)
SelProduct.AddToParent(Panel1, 0, 0, 200dip, 300dip)
'SelDescription.AddToParent(Activity, 450, 0, 200dip, 300dip)
If FirstTime Then
Dim List1 As List
Dim list2 As List
Dim list3 As List
List1.Initialize
list2.Initialize
'list3.Initialize
cursor1 = SQL1.ExecQuery("Select name, code,street1,city1,afm from customer")
For i = 0 To cursor1.RowCount - 1
cursor1.Position = i
List1.Add(cursor1.GetString("name") & " " & cursor1.GetString("code"))
Next
index1 = SelCustomer.SetItems(List1)
cursor1 = SQL1.ExecQuery("select code,description, whsprice, rtlprice from material")
For i = 0 To cursor1.RowCount - 1
cursor1.Position = i
list2.Add(cursor1.GetString("code") & " " & cursor1.GetString("description"))
'list3.Add(cursor1.GetString("description") & " " & cursor1.GetString("code"))
Next
index2 = SelProduct.SetItems(list2)
'index3 = SelDescription.SetItems(list3)
Else
SelCustomer.SetIndex(index1)
SelProduct.SetIndex(index2)
'SelDescription.SetIndex(index3)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub OrderSave_Click
Panel1.RemoveView
SP_Start.visible=True
End Sub
Sub OrderSave_LongClick
End Sub
Sub SelUpd_Click
End Sub
Sub SelRem_Click
End Sub
Sub SelProduct_ItemClick (Value As String)
End Sub
Sub SelProduct_EnterPressed
End Sub
Sub SelDescription_ItemClick (Value As String)
End Sub
Sub SelDescription_EnterPressed
End Sub
Sub SelCustomer_ItemClick (Value As String)
End Sub
Sub SelAdd_Click
End Sub
Sub LVDb_ItemClick (Position As Int, Value As Object)
End Sub
Sub Panel2_Touch (Action As Int, X As Float, Y As Float)
lbl_cust.Text=SelCustomer
panel2.Visible=False
End Sub
Sub Panel2_Click
End Sub
Sub Panel1_Touch (Action As Int, X As Float, Y As Float)
lbl_pro.Text=SelProduct
Panel1.Visible=False
End Sub
Sub Panel1_Click
End Sub
Sub lbl_Prod_Click
Panel1.Visible=True
End Sub
Sub lbl_Prod_LongClick
End Sub
Sub lbl_Cust_Click
panel2.Visible=True
End Sub
Sub lbl_Cust_LongClick
End Sub