Powered By Blogger

Kamis, 24 November 2011

Latihan 24

Latihan 24A

Public Class Latihan24A

Dim NINI_DT As New DataTable
Dim NINI_36109008 As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DataTransaksiJualBeli.accdb'")

Private Sub Latihan24A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim np_36109008 As New OleDb.OleDbDataAdapter
np_36109008 = New OleDb.OleDbDataAdapter("select * From BARANG", NINI_36109008)
NINI_DT.Rows.Clear()
np_36109008.Fill(NINI_DT)
np_36109008.Dispose()
DGV_36109008.DataSource = NINI_DT
End Sub
Private Sub button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_36109008.Click
If Latihan24B.Visible = False Then
Latihan24B.Show()
Else
Latihan24B.Activate()
End If

Latihan24B.KB_36109008.Text = DGV_36109008.CurrentRow.Cells("KODEBARANG").Value
Latihan24B.NB_36109008.Text = DGV_36109008.CurrentRow.Cells("NAMABARANG").Value
Latihan24B.HJ_36109008.Text = DGV_36109008.CurrentRow.Cells("HARGAJUAL").Value
Latihan24B.JB_36109008.Text = DGV_36109008.CurrentRow.Cells("PERSEDIAANAWAL").Value

Latihan24B.ANISA(Latihan24B.KB_36109008.Text)
End Sub
End Class

Latihan 24B

Public Class Latihan24B

Dim NINI_DT As New DataTable
Dim NINI_36109008 As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DataTransaksiJualBeli.accdb'")

Public Sub ANISA(ByVal NISA As String)
Dim np1_36109008 As New OleDb.OleDbDataAdapter
np1_36109008 = New OleDb.OleDbDataAdapter("select * From DETAILTRANSAKSI Where KODEBARANG='" & NISA & "'", NINI_36109008)
NINI_DT.Rows.Clear()
np1_36109008.Fill(NINI_DT)
np1_36109008.Dispose()
DGV_36109008.DataSource = NINI_DT
End Sub

Private Sub Latihan24B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class

Tidak ada komentar:

Posting Komentar