oke,
this is first routine
[code] if Window1.Listbox4.ListCount>0 then
Dim StartTime as Double = Microseconds
dim totalrow as integer
totalrow = window1.Listbox4.listcount-1
for x as integer = 0 to totalrow
dim a,b,c,d,e,f,g,h,ii,j,k,l,m,n as string
a=window1.Listbox4.cell(x,0)
b=window1.Listbox4.cell(x,1)
c=window1.Listbox4.cell(x,2)
d=window1.Listbox4.cell(x,3)
e=window1.Listbox4.cell(x,4)
f=window1.Listbox4.cell(x,5)
g=window1.Listbox4.cell(x,6)
h=window1.Listbox4.cell(x,7)
ii=window1.Listbox4.cell(x,8)
j=window1.Listbox4.cell(x,9)
k=window1.Listbox4.cell(x,10)
l=window1.Listbox4.cell(x,11)
m=window1.Listbox4.cell(x,12)
m=Window1.l_shop.text
If AddTeamRow_all_report(a,b,c,d,e,f,g,h,ii,j,k,l,m,n) then
Label6.Text = label3.text +" data successfully uploaded"
Else
Label6.Text = "There was an error adding the data."
End If
If AddTeamRow_all_report1(a,b,c,d,e,f,g,h,ii,j,k,l,m,n) then
Label6.Text = label3.text +" data successfully uploaded"
Else
Label6.Text = "There was an error adding the data."
End If
next
Dim ThisTime as Double = Microseconds
Label6.Text = label3.text +" data successfully uploaded in "+ CStr((ThisTime-StartTime)/1000000) + " Seconds"
Label4.Text="0"
end if[/code]
This is method of AddTeamRow_all_report1
[code] Dim row As New DatabaseRecord
// ID will be added automatically
row.Column(“date”) = tgl
row.Column(“jam”) = jam
row.Column(“chk_id”) = chk_id
row.Column(“code_item”) = code_item
row.Column(“nama_item”) = nama_item
row.Column(“qty”) = qty
row.Column(“harga”) = harga
row.Column(“diskon”) = diskon
row.Column(“total”) = total
row.Column(“customer”) = customer
row.Column(“no_member”) = no_member
row.Column(“payment_type”) = payment_type
row.Column(“waiter”) = waiter
row.Column(“shop”) = shop
'===
dim aa,bb,cc as string
dim fdz as folderitem
dim tisx as TextInputStream
fdz =GetFolderItem(“shop” )
if fdz <> nil and fdz.Exists then
tisx = fdz.OpenAsTextFile
aa=tisx.Readline.Trim
end if
bb=Lowercase(aa)
cc=“all_report”
'===
'MsgBox str(cc)
mDB.InsertRecord(cc, row)
If mDB.Error Then
Label6.Text = "DB Error: " + mDB.ErrorMessage
Return False
End If[/code]
and the second routine,
[code] if Window1.Listbox4.ListCount>0 then
Dim StartTime as Double = Microseconds
dim totalrow as integer
totalrow = window1.Listbox4.listcount-1
for x as integer = 0 to totalrow
dim a,b,c,d,e,f,g,h,ii,j,k,l,m as string
a=window1.Listbox4.cell(x,0)
b=window1.Listbox4.cell(x,1)
c=window1.Listbox4.cell(x,2)
d=window1.Listbox4.cell(x,3)
e=window1.Listbox4.cell(x,4)
f=window1.Listbox4.cell(x,5)
g=window1.Listbox4.cell(x,6)
h=window1.Listbox4.cell(x,7)
ii=window1.Listbox4.cell(x,8)
j=window1.Listbox4.cell(x,9)
k=window1.Listbox4.cell(x,10)
l=window1.Listbox4.cell(x,11)
m=window1.Listbox4.cell(x,12)
If AddTeamRow1(a,b,c,d,e,f,g,h,ii,j,k,l,m) then
Label6.Text = label3.text +" data successfully uploaded"
Else
Label6.Text = "There was an error adding the data."
End If
next
'insert_data_all_report
dim oSock as new HTTPSocket
dim sGoogleText as String = oSock.Get("https://www.google.com", 5)
if sGoogleText = "" or oSock.ErrorCode <> 0 then
Window1.l_connection.text= "No Internet Connection"
Else
dim z,c as FolderItem
z=GetFolderItem("xdata.feed")
if z.Exists then z.Delete
Dim ThisTime as Double = Microseconds
Label6.Text = label3.text +" data successfully uploaded in "+ CStr((ThisTime-StartTime)/1000000) + " Seconds"
Label4.Text="0"
end if
end if[/code]
this is the method of AddTeamRow1
[code] Dim row As New DatabaseRecord
// ID will be added automatically
row.Column(“date”) = tgl
row.Column(“jam”) = jam
row.Column(“chk_id”) = chk_id
row.Column(“code_item”) = code_item
row.Column(“nama_item”) = nama_item
row.Column(“qty”) = qty
row.Column(“harga”) = harga
row.Column(“diskon”) = diskon
row.Column(“total”) = total
row.Column(“customer”) = customer
row.Column(“no_member”) = no_member
row.Column(“payment_type”) = payment_type
row.Column(“waiter”) = waiter
'===
dim aa,bb,cc as string
dim fdz as folderitem
dim tisx as TextInputStream
fdz =GetFolderItem(“shop” )
if fdz <> nil and fdz.Exists then
tisx = fdz.OpenAsTextFile
aa=tisx.Readline.Trim
end if
bb=Lowercase(aa)
cc=bb+"_report"
'===
'MsgBox str(cc)
mDB.InsertRecord(cc, row)
'MsgBox “insert done”
If mDB.Error Then
Label6.Text = "DB Error: " + mDB.ErrorMessage
Return False
End If
Return True
[/code]