johanpawan
Member
Sub getstokitem As ResumableSub
For i = 0 To ClvBO.Size - 1
Dim ABO As databackorder = ClvBO.GetValue(i)
Dim panel As B4XView = ClvBO.GetPanel(i)
panel.IsInitialized
Dim txtkodebo As B4XView = ClvBO.GetPanel(i).GetView(0)
If txtkodebo.Text.Length>0 Then
ABO.txtkodebarang=txtkodebo.Text
Dim req As DBRequestManager=CreateRequest
Dim cmd As DBCommand=CreateCommand("getstokitem", Array(ABO.txtkodebarang))
Wait for (req.ExecuteQuery(cmd,0,Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j,"req")
wait for (req) req_result(res As DBResult)
If res.Rows.Size=0 Then
MsgboxAsync("Tidak ada data", "Info")
Else
For Each row() As Object In res.Rows
Dim SI As StokItem
SI.txtonhand=row(0)
Dim Pnl06 As B4XView = XUI.CreatePanel(Null)
Pnl06.Color = XUI.Color_Gray
Pnl06.SetLayoutAnimated(0, 0, 0, ClvBO.AsView.Width, 30dip)
PCLV6.AddItem (25dip, XUI.Color_Cyan, SI)
PCLV6.Commit
Next
End If
Else
Log("ERROR: " &j.ErrorMessage)
End If
End If
Next
j.Release
End Sub
For i = 0 To ClvBO.Size - 1
Dim ABO As databackorder = ClvBO.GetValue(i)
Dim panel As B4XView = ClvBO.GetPanel(i)
panel.IsInitialized
Dim txtkodebo As B4XView = ClvBO.GetPanel(i).GetView(0)
If txtkodebo.Text.Length>0 Then
ABO.txtkodebarang=txtkodebo.Text
Dim req As DBRequestManager=CreateRequest
Dim cmd As DBCommand=CreateCommand("getstokitem", Array(ABO.txtkodebarang))
Wait for (req.ExecuteQuery(cmd,0,Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j,"req")
wait for (req) req_result(res As DBResult)
If res.Rows.Size=0 Then
MsgboxAsync("Tidak ada data", "Info")
Else
For Each row() As Object In res.Rows
Dim SI As StokItem
SI.txtonhand=row(0)
Dim Pnl06 As B4XView = XUI.CreatePanel(Null)
Pnl06.Color = XUI.Color_Gray
Pnl06.SetLayoutAnimated(0, 0, 0, ClvBO.AsView.Width, 30dip)
PCLV6.AddItem (25dip, XUI.Color_Cyan, SI)
PCLV6.Commit
Next
End If
Else
Log("ERROR: " &j.ErrorMessage)
End If
End If
Next
j.Release
End Sub