Public Class Form35_36109010 Dim dt As New DataTable Dim cm As New OleDb.OleDbCommand Dim rusna As New ByIskandar.CariKeDataBaseByIskandar Dim mickey As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form35_36109010_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.Text & "'", mickey) a.Fill(dt) a.Dispose()
dgv.DataSource = dt End Sub
Private Sub gg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gg.Click If dd.Text.Length = 0 Then MsgBox("Isi rong itu Kode Barang na..") Exit Sub End If
If Val(ee.Text) = 0 Then MsgBox("Isi rong itu Unit na..") Exit Sub End If
If Val(ff.Text) = 0 Then MsgBox("Isi rong itu Harga na..") Exit Sub End If
Dim dr As DataRow dr = dt.NewRow dr("KODEBARANG") = dd.Text dr("UNIT") = ee.Text dr("HARGA") = ff.Text
dt.Rows.Add(dr)
dd.Text = "" ee.Text = "" ff.Text = "" End Sub
Private Sub hh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hh.Click If aa.Text.Length = 0 Then MsgBox("isi rong No Transaksi na..") Exit Sub End If
If cc.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
rusna.AturPencarianDataBase("mastertransaksi", "notrans", aa.Text, 1, mickey) If rusna.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In dt.Rows cm = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & aa.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", mickey) mickey.Open() cm.ExecuteNonQuery() mickey.Close() Next cm.Dispose()
Public NotInheritable Class form35_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 form35_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 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.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 = "" 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()
FORM35 Public Class Form35 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 Form35_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 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.NewRow dr("KODEBARANG") = kode36109016.Text dr("UNIT") = unit36109016.Text dr("HARGA") = harga36109016.Text
poltek.Rows.Add(dr)
kode36109016.Text = "" unit36109016.Text = "" harga36109016.Text = "" 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 Form35_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.AJT_36109001DB")
Private Sub Form35_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 = '" & notrans_36109001.Text & "'", imps) a.Fill(dt) a.Dispose()
dgv_36109001.DataSource = dt End Sub
Private Sub Btn_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_36109001.Click If KB_36109001.Text.Length = 0 Then MsgBox("Isi itu Kode Barang na..") Exit Sub End If
If Val(UN_36109001.Text) = 0 Then MsgBox("Isi itu Unit na..") Exit Sub End If
If Val(HR_36109001.Text) = 0 Then MsgBox("Isi itu Harga na..") Exit Sub End If
Dim dr As DataRow dr = dt.NewRow dr("KODEBARANG") = KB_36109001.Text dr("UNIT") = UN_36109001.Text dr("HARGA") = HR_36109001.Text
dt.Rows.Add(dr)
KB_36109001.Text = "" UN_36109001.Text = "" HR_36109001.Text = "" End Sub
Private Sub btn2_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2_36109001.Click If notrans_36109001.Text.Length = 0 Then MsgBox("isi No Transaksi na..") Exit Sub End If
If jt_36109001.Text.Length = 0 Then MsgBox("Isi Jenis Transaksi na..") Exit Sub End If
If dt.Rows.Count = 0 Then MsgBox("Mnotrans_36109001f...Isi itu datatable na..") Exit Sub End If
apreal.AturPencarianDataBase("mastertransaksi", "notrans", notrans_36109001.Text, 1, imps) If apreal.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In dt.Rows rr = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & notrans_36109001.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", imps) imps.Open() rr.ExecuteNonQuery() imps.Close() Next rr.Dispose()
Public Class Form35_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 Latihan35_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 End Sub
Private Sub gg_36109006Click(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.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 = "" 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()
Public Class Form35_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 Latihan35_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 End Sub
Private Sub gg_36109006Click(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.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 = "" 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()
Komentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class Form35_36109010
BalasHapusDim dt As New DataTable
Dim cm As New OleDb.OleDbCommand
Dim rusna As New ByIskandar.CariKeDataBaseByIskandar
Dim mickey As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Form35_36109010_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.Text & "'", mickey)
a.Fill(dt)
a.Dispose()
dgv.DataSource = dt
End Sub
Private Sub gg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gg.Click
If dd.Text.Length = 0 Then
MsgBox("Isi rong itu Kode Barang na..")
Exit Sub
End If
If Val(ee.Text) = 0 Then
MsgBox("Isi rong itu Unit na..")
Exit Sub
End If
If Val(ff.Text) = 0 Then
MsgBox("Isi rong itu Harga na..")
Exit Sub
End If
Dim dr As DataRow
dr = dt.NewRow
dr("KODEBARANG") = dd.Text
dr("UNIT") = ee.Text
dr("HARGA") = ff.Text
dt.Rows.Add(dr)
dd.Text = ""
ee.Text = ""
ff.Text = ""
End Sub
Private Sub hh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hh.Click
If aa.Text.Length = 0 Then
MsgBox("isi rong No Transaksi na..")
Exit Sub
End If
If cc.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
rusna.AturPencarianDataBase("mastertransaksi", "notrans", aa.Text, 1, mickey)
If rusna.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
cm = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & aa.Text & "',#" & bb.Value.Month & "/" & bb.Value.Day & "/" & bb.Value.Year & "#,'" & cc.Text & "')", mickey)
mickey.Open()
cm.ExecuteNonQuery()
mickey.Close()
For Each x As DataRow In dt.Rows
cm = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & aa.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", mickey)
mickey.Open()
cm.ExecuteNonQuery()
mickey.Close()
Next
cm.Dispose()
aa.Text = ""
cc.Text = ""
dt.Rows.Clear()
End Sub
End Class
ALWIYAH
BalasHapus3A-D3 / 36109009
http://alwiyah-chucha.blogspot.com/2011/12/latihanform35.html
Terima Kasih Pak
Public NotInheritable Class form35_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 form35_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
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.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 = ""
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
Ismi Febriani Asyikin
BalasHapus3a d3
361 09 005
http://ismifebriani.blogspot.com/2011/12/apkom-4-latihan-35.html
amelia indahsari
BalasHapus361 09 023
http://heiamee.blogspot.com/2011/12/form-35.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
BalasHapusridhayanti saleh
BalasHapus36109015
http://ridhacayoo-ridhaahmad.blogspot.com/2011/12/tugas-35-baru.html
HASTUTI
BalasHapus36109016
FORM35
Public Class Form35
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 Form35_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
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.NewRow
dr("KODEBARANG") = kode36109016.Text
dr("UNIT") = unit36109016.Text
dr("HARGA") = harga36109016.Text
poltek.Rows.Add(dr)
kode36109016.Text = ""
unit36109016.Text = ""
harga36109016.Text = ""
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-35.html
BalasHapushttp://azzuraarrahma.blogspot.com/2011/12/jawaban-form-35-sampe-form-40b.html
BalasHapusmakasih, Pak.
Public Class Form35_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.AJT_36109001DB")
Private Sub Form35_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 = '" & notrans_36109001.Text & "'", imps)
a.Fill(dt)
a.Dispose()
dgv_36109001.DataSource = dt
End Sub
Private Sub Btn_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_36109001.Click
If KB_36109001.Text.Length = 0 Then
MsgBox("Isi itu Kode Barang na..")
Exit Sub
End If
If Val(UN_36109001.Text) = 0 Then
MsgBox("Isi itu Unit na..")
Exit Sub
End If
If Val(HR_36109001.Text) = 0 Then
MsgBox("Isi itu Harga na..")
Exit Sub
End If
Dim dr As DataRow
dr = dt.NewRow
dr("KODEBARANG") = KB_36109001.Text
dr("UNIT") = UN_36109001.Text
dr("HARGA") = HR_36109001.Text
dt.Rows.Add(dr)
KB_36109001.Text = ""
UN_36109001.Text = ""
HR_36109001.Text = ""
End Sub
Private Sub btn2_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2_36109001.Click
If notrans_36109001.Text.Length = 0 Then
MsgBox("isi No Transaksi na..")
Exit Sub
End If
If jt_36109001.Text.Length = 0 Then
MsgBox("Isi Jenis Transaksi na..")
Exit Sub
End If
If dt.Rows.Count = 0 Then
MsgBox("Mnotrans_36109001f...Isi itu datatable na..")
Exit Sub
End If
apreal.AturPencarianDataBase("mastertransaksi", "notrans", notrans_36109001.Text, 1, imps)
If apreal.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
rr = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanBtn_36109001altransaksi, jenistransaksi) values ('" & notrans_36109001.Text & "',#" & dtp_36109001.Value.Month & "/" & dtp_36109001.Value.Day & "/" & dtp_36109001.Value.Year & "#,'" & jt_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 ('" & notrans_36109001.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", imps)
imps.Open()
rr.ExecuteNonQuery()
imps.Close()
Next
rr.Dispose()
notrans_36109001.Text = ""
jt_36109001.Text = ""
dt.Rows.Clear()
End Sub
End Class
iwan
BalasHapus361 09 026
3A-D3
http://iwandinejad.blogspot.com/#!/2012/01/latihan-35.html
Muhammad Harun Hamid
BalasHapus361 09 006
Public Class Form35_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 Latihan35_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
End Sub
Private Sub gg_36109006Click(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.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 = ""
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
Muhammad Harun Hamid
BalasHapus361 09 006
Public Class Form35_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 Latihan35_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
End Sub
Private Sub gg_36109006Click(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.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 = ""
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