Public NotInheritable Class form36_36109003 Dim arman As New ByIskandar.CariKeDataBaseByIskandar Dim anto As New DataTable Dim soe As New OleDb.OleDbCommand Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DataMajemuk.accdb'")
Private Sub form36_36109003_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim r As New OleDb.OleDbDataAdapter r = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & nt_36109003.Text & "'", ndut) r.Fill(anto) r.Dispose()
dgv_36109003.DataSource = anto
Dim sudar(1) As DataColumn sudar(0) = anto.Columns("kodebarang") anto.PrimaryKey = sudar
End Sub
Private Sub tambah_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah_36109003.Click If kb_36109003.Text.Length = 0 Then MsgBox("kode barang tidak terisi") ElseIf Val(unit_36109003.Text) = 0 Then MsgBox("unit tidak terisi") ElseIf Val(harga_36109003.Text) = 0 Then MsgBox("harga barang tidak terisi") Exit Sub End If
Dim dt As DataRow dt = anto.Rows.Find(kb_36109003.Text) If dt Is Nothing Then dt = anto.NewRow dt("KODEBARANG") = kb_36109003.Text dt("UNIT") = unit_36109003.Text dt("HARGA") = harga_36109003.Text
anto.Rows.Add(dt)
kb_36109003.Text = "" unit_36109003.Text = "" harga_36109003.Text = "" Else MsgBox("kode barang telah terdaftar,") End If
End Sub
Private Sub simpan_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109003.Click If nt_36109003.Text.Length = 0 Then MsgBox("nomor transaksi harus terisi") ElseIf jt_36109003.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") ElseIf anto.Rows.Count = 0 Then MsgBox("data table tidak boleh kosong") Exit Sub End If
arman.AturPencarianDataBase("mastertransaksi", "notrans", nt_36109003.Text, 1, ndut) If arman.JumlanBaris > 0 Then MsgBox("nomor transaksi telah ada") Exit Sub End If
For Each x As DataRow In anto.Rows soe = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & nt_36109003.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ndut) ndut.Open() soe.ExecuteNonQuery() ndut.Close() Next soe.Dispose()
FORM36 Public Class Form36 Dim poltek As New DataTable Dim has As New OleDb.OleDbCommand Dim uthi As New ByIskandar.CariKeDataBaseByIskandar Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form36_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 KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & no36109016.Text & "'", ak) a.Fill(poltek) a.Dispose()
dgv36109016.DataSource = poltek
Dim dc(1) As DataColumn dc(0) = poltek.Columns("kodebarang") poltek.PrimaryKey = dc End Sub
Private Sub tambah36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah36109016.Click If kode36109016.Text.Length = 0 Then MsgBox("Isi rong itu Kode Barang na..") Exit Sub End If
If Val(unit36109016.Text) = 0 Then MsgBox("Isi rong itu Unit na..") Exit Sub End If
If Val(harga36109016.Text) = 0 Then MsgBox("Isi rong itu Harga na..") Exit Sub End If
Dim dr As DataRow dr = poltek.Rows.Find(kode36109016.Text) If dr Is Nothing Then dr = poltek.NewRow dr("KODEBARANG") = kode36109016.Text dr("UNIT") = unit36109016.Text dr("HARGA") = harga36109016.Text
Else MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain") End If End Sub
Private Sub simpan36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan36109016.Click If no36109016.Text.Length = 0 Then MsgBox("Isi rong No Transaksi na..") Exit Sub End If
If jenis36109016.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") Exit Sub End If
If poltek.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable na..") Exit Sub End If
uthi.AturPencarianDataBase("mastertransaksi", "notrans", no36109016.Text, 1, ak) If uthi.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In poltek.Rows has = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & no36109016.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ak) ak.Open() has.ExecuteNonQuery() ak.Close() Next has.Dispose()
Public Class Form36_36109001 Dim dt As New DataTable Dim rr As New OleDb.OleDbCommand Dim apreal As New ByIskandar.CariKeDataBaseByIskandar Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form36_36109001_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 KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & nt_36109001.Text & "'", imps) a.Fill(dt) a.Dispose()
dgv_36109001.DataSource = dt
Dim dc(1) As DataColumn dc(0) = dt.Columns("kodebarang") dt.PrimaryKey = dc End Sub
Private Sub btn1_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1_36109001.Click If kb_36109001.Text.Length = 0 Then MsgBox("Isi Kolom Kode Barang") Exit Sub End If
If Val(un_36109001.Text) = 0 Then MsgBox("Isi Kolom Unit") Exit Sub End If
If Val(hrg_36109001.Text) = 0 Then MsgBox("Isi Kolom Harga") Exit Sub End If
Dim dr As DataRow dr = dt.Rows.Find(kb_36109001.Text) If dr Is Nothing Then dr = dt.NewRow dr("KODEBARANG") = kb_36109001.Text dr("UNIT") = un_36109001.Text dr("HARGA") = hrg_36109001.Text
Else MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain") End If End Sub
Private Sub btn2_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2_36109001.Click If nt_36109001.Text.Length = 0 Then MsgBox("Isi Kolom No Transaksi") Exit Sub End If
If jr_36109001.Text.Length = 0 Then MsgBox("Isi Kolom Jenis Transaksi") Exit Sub End If
If dt.Rows.Count = 0 Then MsgBox("Isi Kolom datatable") Exit Sub End If
apreal.AturPencarianDataBase("mastertransaksi", "notrans", nt_36109001.Text, 1, imps) If apreal.JumlanBaris > 0 Then MsgBox("Notrans seperti itu sudah ada, mohon diganti") Exit Sub End If
For Each x As DataRow In dt.Rows rr = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & nt_36109001.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", imps) imps.Open() rr.ExecuteNonQuery() imps.Close() Next rr.Dispose()
Public Class Form36_36109006 Dim dt As New DataTable Dim cm__36109006 As New OleDb.OleDbCommand Dim harun As New ByIskandar.CariKeDataBaseByIskandar Dim hma As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form36_36109006_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 KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & aa_36109006.Text & "'", hma) a.Fill(dt) a.Dispose()
dgv_36109006.DataSource = dt
Dim dc(1) As DataColumn dc(0) = dt.Columns("kodebarang") dt.PrimaryKey = dc End Sub
Private Sub gg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gg_36109006.Click If dd_36109006.Text.Length = 0 Then MsgBox("Isi rong itu Kode Barang na..") Exit Sub End If
If Val(ee_36109006.Text) = 0 Then MsgBox("Isi rong itu Unit na..") Exit Sub End If
If Val(ff_36109006.Text) = 0 Then MsgBox("Isi rong itu Harga na..") Exit Sub End If
Dim dr As DataRow dr = dt.Rows.Find(dd_36109006.Text) If dr Is Nothing Then dr = dt.NewRow dr("KODEBARANG") = dd_36109006.Text dr("UNIT") = ee_36109006.Text dr("HARGA") = ff_36109006.Text
Else MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain") End If End Sub
Private Sub hh_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hh_36109006.Click If aa_36109006.Text.Length = 0 Then MsgBox("Isi rong No Transaksi na..") Exit Sub End If
If cc_36109006.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") Exit Sub End If
If dt.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable na..") Exit Sub End If
harun.AturPencarianDataBase("mastertransaksi", "notrans", aa_36109006.Text, 1, hma) If harun.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In dt.Rows cm__36109006 = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & aa_36109006.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", hma) hma.Open() cm__36109006.ExecuteNonQuery() hma.Close() Next cm__36109006.Dispose()
ALWIYAH
BalasHapus3A-D3 / 36109009
http://alwiyah-chucha.blogspot.com/2011/12/latihanform36_01.html
Terima Kasih Pak
Ismi Febriani Asyikin
BalasHapus3a D3
361 09 005
http://ismifebriani.blogspot.com/2011/12/apkom-4-latihan-36.html
Amelia Indahsari
BalasHapus361 09 023
http://heiamee.blogspot.com/2011/12/form-36.html
RUSNANINGSI R
BalasHapus36109010
http://rusnaningsi.blogspot.com/2011/12/latihan-35-36-apkom-4.html
http://vievhy.blogspot.com/2011/12/form-35-37.html
BalasHapusPublic NotInheritable Class form36_36109003
BalasHapusDim arman As New ByIskandar.CariKeDataBaseByIskandar
Dim anto As New DataTable
Dim soe As New OleDb.OleDbCommand
Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DataMajemuk.accdb'")
Private Sub form36_36109003_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim r As New OleDb.OleDbDataAdapter
r = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & nt_36109003.Text & "'", ndut)
r.Fill(anto)
r.Dispose()
dgv_36109003.DataSource = anto
Dim sudar(1) As DataColumn
sudar(0) = anto.Columns("kodebarang")
anto.PrimaryKey = sudar
End Sub
Private Sub tambah_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah_36109003.Click
If kb_36109003.Text.Length = 0 Then
MsgBox("kode barang tidak terisi")
ElseIf Val(unit_36109003.Text) = 0 Then
MsgBox("unit tidak terisi")
ElseIf Val(harga_36109003.Text) = 0 Then
MsgBox("harga barang tidak terisi")
Exit Sub
End If
Dim dt As DataRow
dt = anto.Rows.Find(kb_36109003.Text)
If dt Is Nothing Then
dt = anto.NewRow
dt("KODEBARANG") = kb_36109003.Text
dt("UNIT") = unit_36109003.Text
dt("HARGA") = harga_36109003.Text
anto.Rows.Add(dt)
kb_36109003.Text = ""
unit_36109003.Text = ""
harga_36109003.Text = ""
Else
MsgBox("kode barang telah terdaftar,")
End If
End Sub
Private Sub simpan_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109003.Click
If nt_36109003.Text.Length = 0 Then
MsgBox("nomor transaksi harus terisi")
ElseIf jt_36109003.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
ElseIf anto.Rows.Count = 0 Then
MsgBox("data table tidak boleh kosong")
Exit Sub
End If
arman.AturPencarianDataBase("mastertransaksi", "notrans", nt_36109003.Text, 1, ndut)
If arman.JumlanBaris > 0 Then
MsgBox("nomor transaksi telah ada")
Exit Sub
End If
soe = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_36109003.Text & "',#" & tgl_36109003.Value.Month & "/" & tgl_36109003.Value.Day & "/" & tgl_36109003.Value.Year & "#,'" & jt_36109003.Text & "')", ndut)
ndut.Open()
soe.ExecuteNonQuery()
ndut.Close()
For Each x As DataRow In anto.Rows
soe = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & nt_36109003.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ndut)
ndut.Open()
soe.ExecuteNonQuery()
ndut.Close()
Next
soe.Dispose()
nt_36109003.Text = ""
jt_36109003.Text = ""
anto.Rows.Clear()
End Sub
End Class
HASTUTI
BalasHapus36109016
FORM36
Public Class Form36
Dim poltek As New DataTable
Dim has As New OleDb.OleDbCommand
Dim uthi As New ByIskandar.CariKeDataBaseByIskandar
Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form36_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 KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & no36109016.Text & "'", ak)
a.Fill(poltek)
a.Dispose()
dgv36109016.DataSource = poltek
Dim dc(1) As DataColumn
dc(0) = poltek.Columns("kodebarang")
poltek.PrimaryKey = dc
End Sub
Private Sub tambah36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah36109016.Click
If kode36109016.Text.Length = 0 Then
MsgBox("Isi rong itu Kode Barang na..")
Exit Sub
End If
If Val(unit36109016.Text) = 0 Then
MsgBox("Isi rong itu Unit na..")
Exit Sub
End If
If Val(harga36109016.Text) = 0 Then
MsgBox("Isi rong itu Harga na..")
Exit Sub
End If
Dim dr As DataRow
dr = poltek.Rows.Find(kode36109016.Text)
If dr Is Nothing Then
dr = poltek.NewRow
dr("KODEBARANG") = kode36109016.Text
dr("UNIT") = unit36109016.Text
dr("HARGA") = harga36109016.Text
poltek.Rows.Add(dr)
kode36109016.Text = ""
unit36109016.Text = ""
harga36109016.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain")
End If
End Sub
Private Sub simpan36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan36109016.Click
If no36109016.Text.Length = 0 Then
MsgBox("Isi rong No Transaksi na..")
Exit Sub
End If
If jenis36109016.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
Exit Sub
End If
If poltek.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable na..")
Exit Sub
End If
uthi.AturPencarianDataBase("mastertransaksi", "notrans", no36109016.Text, 1, ak)
If uthi.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
has = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & no36109016.Text & "',#" & tanggal36109016.Value.Month & "/" & tanggal36109016.Value.Day & "/" & tanggal36109016.Value.Year & "#,'" & jenis36109016.Text & "')", ak)
ak.Open()
has.ExecuteNonQuery()
ak.Close()
For Each x As DataRow In poltek.Rows
has = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & no36109016.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ak)
ak.Open()
has.ExecuteNonQuery()
ak.Close()
Next
has.Dispose()
no36109016.Text = ""
jenis36109016.Text = ""
poltek.Rows.Clear()
End Sub
End Class
ANDI WAHYUNI
BalasHapus361 09 019
http://wahyunistrongggg.blogspot.com/2011/12/latihan-35-37.html
http://febriantysuryaningtyas.blogspot.com/2011/12/latihan-36_28.html
BalasHapusPublic Class Form36_36109001
BalasHapusDim dt As New DataTable
Dim rr As New OleDb.OleDbCommand
Dim apreal As New ByIskandar.CariKeDataBaseByIskandar
Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form36_36109001_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 KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & nt_36109001.Text & "'", imps)
a.Fill(dt)
a.Dispose()
dgv_36109001.DataSource = dt
Dim dc(1) As DataColumn
dc(0) = dt.Columns("kodebarang")
dt.PrimaryKey = dc
End Sub
Private Sub btn1_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1_36109001.Click
If kb_36109001.Text.Length = 0 Then
MsgBox("Isi Kolom Kode Barang")
Exit Sub
End If
If Val(un_36109001.Text) = 0 Then
MsgBox("Isi Kolom Unit")
Exit Sub
End If
If Val(hrg_36109001.Text) = 0 Then
MsgBox("Isi Kolom Harga")
Exit Sub
End If
Dim dr As DataRow
dr = dt.Rows.Find(kb_36109001.Text)
If dr Is Nothing Then
dr = dt.NewRow
dr("KODEBARANG") = kb_36109001.Text
dr("UNIT") = un_36109001.Text
dr("HARGA") = hrg_36109001.Text
dt.Rows.Add(dr)
kb_36109001.Text = ""
un_36109001.Text = ""
hrg_36109001.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain")
End If
End Sub
Private Sub btn2_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2_36109001.Click
If nt_36109001.Text.Length = 0 Then
MsgBox("Isi Kolom No Transaksi")
Exit Sub
End If
If jr_36109001.Text.Length = 0 Then
MsgBox("Isi Kolom Jenis Transaksi")
Exit Sub
End If
If dt.Rows.Count = 0 Then
MsgBox("Isi Kolom datatable")
Exit Sub
End If
apreal.AturPencarianDataBase("mastertransaksi", "notrans", nt_36109001.Text, 1, imps)
If apreal.JumlanBaris > 0 Then
MsgBox("Notrans seperti itu sudah ada, mohon diganti")
Exit Sub
End If
rr = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_36109001.Text & "',#" & tgl_36109001.Value.Month & "/" & tgl_36109001.Value.Day & "/" & tgl_36109001.Value.Year & "#,'" & jr_36109001.Text & "')", imps)
imps.Open()
rr.ExecuteNonQuery()
imps.Close()
For Each x As DataRow In dt.Rows
rr = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & nt_36109001.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", imps)
imps.Open()
rr.ExecuteNonQuery()
imps.Close()
Next
rr.Dispose()
nt_36109001.Text = ""
jr_36109001.Text = ""
dt.Rows.Clear()
End Sub
End Class
iwan
BalasHapus361 09 026
3A-d3
http://iwandinejad.blogspot.com/#!/2012/01/latihan-36.html
Muhammad Harun Hamid
BalasHapus361 09 006
Public Class Form36_36109006
Dim dt As New DataTable
Dim cm__36109006 As New OleDb.OleDbCommand
Dim harun As New ByIskandar.CariKeDataBaseByIskandar
Dim hma As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form36_36109006_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 KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & aa_36109006.Text & "'", hma)
a.Fill(dt)
a.Dispose()
dgv_36109006.DataSource = dt
Dim dc(1) As DataColumn
dc(0) = dt.Columns("kodebarang")
dt.PrimaryKey = dc
End Sub
Private Sub gg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gg_36109006.Click
If dd_36109006.Text.Length = 0 Then
MsgBox("Isi rong itu Kode Barang na..")
Exit Sub
End If
If Val(ee_36109006.Text) = 0 Then
MsgBox("Isi rong itu Unit na..")
Exit Sub
End If
If Val(ff_36109006.Text) = 0 Then
MsgBox("Isi rong itu Harga na..")
Exit Sub
End If
Dim dr As DataRow
dr = dt.Rows.Find(dd_36109006.Text)
If dr Is Nothing Then
dr = dt.NewRow
dr("KODEBARANG") = dd_36109006.Text
dr("UNIT") = ee_36109006.Text
dr("HARGA") = ff_36109006.Text
dt.Rows.Add(dr)
dd_36109006.Text = ""
ee_36109006.Text = ""
ff_36109006.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain")
End If
End Sub
Private Sub hh_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hh_36109006.Click
If aa_36109006.Text.Length = 0 Then
MsgBox("Isi rong No Transaksi na..")
Exit Sub
End If
If cc_36109006.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
Exit Sub
End If
If dt.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable na..")
Exit Sub
End If
harun.AturPencarianDataBase("mastertransaksi", "notrans", aa_36109006.Text, 1, hma)
If harun.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
cm__36109006 = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & aa_36109006.Text & "',#" & bb_36109006.Value.Month & "/" & bb_36109006.Value.Day & "/" & bb_36109006.Value.Year & "#,'" & cc_36109006.Text & "')", hma)
hma.Open()
cm__36109006.ExecuteNonQuery()
hma.Close()
For Each x As DataRow In dt.Rows
cm__36109006 = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & aa_36109006.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", hma)
hma.Open()
cm__36109006.ExecuteNonQuery()
hma.Close()
Next
cm__36109006.Dispose()
aa_36109006.Text = ""
cc_36109006.Text = ""
dt.Rows.Clear()
End Sub
End Class