Form 22
Public Class Form22
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Dim hxh1 As New DataTable
Dim hxh2 As New DataTable
Dim ima As New DataSet
Dim op1 As New BindingSource
Dim op2 As New BindingSource
Private Sub Form22_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ami1 As New OleDb.OleDbDataAdapter
Dim ami2 As New OleDb.OleDbDataAdapter
ami1 = New OleDb.OleDbDataAdapter("select * from mastertransaksi", CONECT)
ami1.Fill(hxh1)
dgv1_021.DataSource = op1
ami2 = New OleDb.OleDbDataAdapter("select * from query4", CONECT)
ami2.Fill(hxh2)
dgv2_021.DataSource = op2
ima.Tables.Add(hxh1)
ima.Tables.Add(hxh2)
hxh1.TableName = "sembarang1"
hxh2.TableName = "sembarang2"
ima.Relations.Add(New DataRelation("AA", ima.Tables("sembarang1").Columns("notrans"), ima.Tables("sembarang2").Columns("notrans")))
op1.DataSource = ima
op1.DataMember = "sembarang1"
op2.DataSource = op1
op2.DataMember = "AA"
End Sub
End Class
Form 23A
Public Class Form23A
Dim dt As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Private Sub Form23A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As New OleDb.OleDbDataAdapter
a = New OleDb.OleDbDataAdapter("select * from mastertransaksi", conect)
a.Fill(dt)
a.Dispose()
dgv_021.DataSource = dt
End Sub
Private Sub button_021_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_021.Click
If Form23B.Visible = False Then
Form23B.Show()
Else
Form23B.Activate()
End If
Form23B.t1_021.Text = dgv_021.CurrentRow.Cells("notrans").Value
Form23B.t2_021.Text = dgv_021.CurrentRow.Cells("tanggaltransaksi").Value
Form23B.t3_021.Text = dgv_021.CurrentRow.Cells("jenistransaksi").Value
Form23B.mee(Form23B.t1_021.Text)
End Sub
End Class
Form 23B
Public Class Form23B
Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Dim tabel As New DataTable
Public Sub mee(ByVal A As String)
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where notrans='" & A & "'", koneksi)
tabel.Rows.Clear()
adapter.Fill(tabel)
dgv_021.DataSource = tabel
End Sub
Private Sub Form23B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Form 24A
Public Class Form24A
Dim dt As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Private Sub Form23A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ami As New OleDb.OleDbDataAdapter
ami = New OleDb.OleDbDataAdapter("select * from BARANG", conect)
ami.Fill(dt)
ami.Dispose()
dgv_021.DataSource = dt
End Sub
Private Sub button_021_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_021.Click
If Form24B.Visible = False Then
Form24B.Show()
Else
Form23B.Activate()
End If
Form24B.t1_021.Text = dgv_021.CurrentRow.Cells("KODEBARANG").Value
Form24B.t2_021.Text = dgv_021.CurrentRow.Cells("NAMABARANG").Value
Form24B.t3_021.Text = dgv_021.CurrentRow.Cells("PERSEDIAANAWAL").Value
Form24B.t4_021.Text = dgv_021.CurrentRow.Cells("HARGAJUAL").Value
Form24B.mee(Form24B.t1_021.Text)
End Sub
End Class
Form 24B
Public Class Form24B
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Dim tabel As New DataTable
Public Sub mee(ByVal A As String)
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select* from DETAILTRANSAKSI where KODEBARANG='" & A & "'", conect)
tabel.Rows.Clear()
adapter.Fill(tabel)
dgv_021.DataSource = tabel
End Sub
End Class
Form 25A
Public Class Form25A
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
Dim tabel As New DataTable
Private Sub Form25A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select * from BARANG", conect)
tabel.Rows.Clear()
adapter.Fill(tabel)
adapter.Dispose()
dgv_021.DataSource = tabel
End Sub
Private Sub button_021_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_021.Click
If Form25B.Visible = False Then
Form25B.Show()
Else
Form25B.Activate()
End If
Form25B.t1_021.Text = dgv_021.CurrentRow.Cells("KODEBARANG").Value
Form25B.t2_021.Text = dgv_021.CurrentRow.Cells("NAMABARANG").Value
Form25B.t3_021.Text = dgv_021.CurrentRow.Cells("HARGAJUAL").Value
Form25B.t4_021.Text = dgv_021.CurrentRow.Cells("PERSEDIAANAWAL").Value
Form25B.mee(Form25B.t1_021.Text)
End Sub
End Class
Form 25B
Public Class Form25B
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Dim ami As New DataTable
Public Sub mee(ByVal A As String)
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS=MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG='" & A & "'", conect)
ami.Rows.Clear()
adapter.Fill(ami)
adapter.Dispose()
dgv_021.DataSource = ami
End Sub
End Class
Form 26A
Public Class Form26A
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
Dim tabel As New DataTable
Private Sub Form26A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select * from BARANG", conect)
tabel.Rows.Clear()
adapter.Fill(tabel)
adapter.Dispose()
dgv_021.DataSource = tabel
End Sub
Private Sub button_021_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_021.Click
If Form26B.Visible = False Then
Form26B.Show()
Else
Form26B.Activate()
End If
Form26B.t1_021.Text = dgv_021.CurrentRow.Cells("KODEBARANG").Value
Form26B.t2_021.Text = dgv_021.CurrentRow.Cells("NAMABARANG").Value
Form26B.t3_021.Text = dgv_021.CurrentRow.Cells("HARGAJUAL").Value
Form26B.t4_021.Text = dgv_021.CurrentRow.Cells("PERSEDIAANAWAL").Value
Form26B.mee(Form26B.t1_021.Text)
End Sub
End Class
Form 26B
Public Class Form26B
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
Dim ami As New DataTable
Public Sub mee(ByVal A As String)
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS=MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG='" & A & "'", conect)
ami.Rows.Clear()
adapter.Fill(ami)
adapter.Dispose()
ar()
dgv_021.DataSource = ami
End Sub
Private Sub ar()
Dim TU As Integer
Dim TJ As Integer
For Each x As DataRow In ami.Rows
TU = TU + x("Unit")
TJ = TJ + x("Jumlah")
Next
t5_021.Text = TU
t6_021.Text = TJ
End Sub
End Class
Tidak ada komentar:
Posting Komentar