Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATAMAJEMUK.accdb") Dim dt As New DataTable Dim dr As DataRow
Private Sub Latihan37017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim X As New OleDb.OleDbDataAdapter X = New OleDb.OleDbDataAdapter("Select BARANG.KODEBARANG, BARANG.NAMABARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, DETAILTRANSAKSI.UNIT*DETAILTRANSAKSI.HARGA AS JUMLAH from DETAILTRANSAKSI INNER JOIN BARANG ON DETAILTRANSAKSI.KODEBARANG=BARANG.KODEBARANG WHERE NOTRANS= '" & NOTRANS077.Text & "'", n) X.Fill(dt) X.Dispose()
Dim dataPrimary(1) As DataColumn dataPrimary(0) = dt.Columns("KODEBARANG") dt.PrimaryKey = dataPrimary
DGV037.DataSource = dt End Sub
Private Sub TOTALJUMLAH() Dim TOT As Double = 0 For Each x As DataRow In dt.Rows TOT = TOT + x("JUMLAH") Next TOTAL077.Text = TOT End Sub
Private Sub KB_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles KB077.Leave If KB077.Text.Length = 0 Then Exit Sub End If
Dim Pencari As New ByIskandar.CariKeDataBaseByIskandar Pencari.AturPencarianDataBase("BARANG", "KODEBARANG", KB077.Text, 1, n) If Pencari.JumlanBaris > 0 Then KB077.Text = Pencari.DataTablenya.Rows(0).Item("KODEBARANG") NB077.Text = Pencari.DataTablenya.Rows(0).Item("NAMABARANG") Else MsgBox("Kode barang tersebut tidak ada") Exit Sub End If End Sub
Private Sub KB_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KB077.TextChanged NB077.Text = "" UNIT077.Text = "" HB077.Text = "" End Sub
Private Sub UNIT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UNIT077.TextChanged, HB077.TextChanged JUM077.Text = Val(UNIT077.Text) * Val(HB077.Text) End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click 'a' If KB077.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NB077.Text.Length = 0 Then MsgBox("Nama barang sudah ada") End If
If Val(UNIT077.Text) = 0 Then MsgBox("Masukkan unit barang") Exit Sub End If
If Val(HB077.Text) = 0 Then MsgBox("Masukkan harga barang barang") Exit Sub End If
'b' dr = dt.Rows.Find(KB077.Text)
If dr Is Nothing Then dr = dt.NewRow dr("KODEBARANG") = KB077.Text Else MsgBox("Maaf kodebarang sudah ada") Exit Sub End If
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click 'a' If NOTRANS077.Text.Length = 0 Then MsgBox("No. transaksi sudah ada") Exit Sub End If
If JT077.Text.Length = 0 Then MsgBox("Jenis transaksi sudah ada") Exit Sub End If
'b' If dt.Rows.Count = 0 Then MsgBox("Jumlah baris tidak terisi") Exit Sub End If
'c' Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", NOTRANS077.Text, 1, n) If pencari.JumlanBaris > 0 Then MsgBox("data tersebut sudah ada") Exit Sub End If
'd' Dim CM As New OleDb.OleDbCommand CM = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI (NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & NOTRANS077.Text & "', #" & dateTimePicker.Value.Month & "/" & dateTimePicker.Value.Day & "/" & dateTimePicker.Value.Year & "#, '" & JT077.Text & "')", n) n.Open() CM.ExecuteNonQuery() n.Close()
'e' For Each X As DataRow In dt.Rows CM = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & NOTRANS077.Text & "','" & X("KODEBARANG") & "'," & X("UNIT") & ", " & X("HARGA") & ")", n) n.Open() CM.ExecuteNonQuery() n.Close() CM.Dispose() Next
Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click 'a' If c058.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If d058.Text.Length = 0 Then MsgBox("Nama barang sudah ada") End If
If Val(ee058.Text) = 0 Then MsgBox("Masukkan unit barang") Exit Sub End If
If Val(f058.Text) = 0 Then MsgBox("Masukkan harga barang barang") Exit Sub End If
'b' dr = dt.Rows.Find(c058.Text)
If dr Is Nothing Then dr = dt.NewRow dr("KODEBARANG") = c058.Text Else MsgBox("Maaf kodebarang sudah ada") Exit Sub End If
Private Sub simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click 'a' If a058.Text.Length = 0 Then MsgBox("No. transaksi sudah ada") Exit Sub End If
If b058.Text.Length = 0 Then MsgBox("Jenis transaksi sudah ada") Exit Sub End If
'b' If dt.Rows.Count = 0 Then MsgBox("Jumlah baris tidak terisi") Exit Sub End If
'c' Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", a058.Text, 1, yunha) If pencari.JumlanBaris > 0 Then MsgBox("data tersebut sudah ada") Exit Sub End If
'd' Dim z As New OleDb.OleDbCommand z = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI (NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & a058.Text & "', #" & DateTimePicker1.Value.Month & "/" & DateTimePicker1.Value.Day & "/" & DateTimePicker1.Value.Year & "#, '" & b058.Text & "')", yunha) yunha.Open() z.ExecuteNonQuery() yunha.Close()
'e' For Each X As DataRow In dt.Rows z = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & a058.Text & "','" & X("KODEBARANG") & "'," & X("UNIT") & ", " & X("HARGA") & ")", yunha) yunha.Open() z.ExecuteNonQuery() yunha.Close() z.Dispose() Next
Public Class Latihan_37_09081 Dim dt As New DataTable Dim OLC As New OleDb.OleDbCommand Dim yusri As New ByIskandar.CariKeDataBaseByIskandar Dim ian As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Datamajemuk.ACCDB")
Private Sub Latihan_37_09081_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 barang.KODEBARANG, barang.NAMABARANG, detailtransaksi.UNIT, detailtransaksi.HARGA, detailtransaksi.unit*harga as JUMLAH from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang where notrans ='" & notr081.Text & "'", ian) dt.Rows.Clear() a.Fill(dt) a.Dispose()
Dim dc(1) As DataColumn dc(0) = dt.Columns("kodebarang") dt.PrimaryKey = dc
dgv081.DataSource = dt End Sub
Private Sub yusrian() Dim yusrian1 As Integer = 0 For Each yusrian2 As DataRow In dt.Rows yusrian1 += yusrian2("JUMLAH") Next tot081.Text = yusrian1 End Sub
Private Sub unt081_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles unt081.TextChanged, hrg081.TextChanged jmlh081.Text = Val(unt081.Text) * Val(hrg081.Text) End Sub
Private Sub kodbar081_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles kodbar081.Leave If kodbar081.Text.Length = 0 Then Exit Sub End If yusri.AturPencarianDataBase("barang", "kodebarang", kodbar081.Text, 1, ian) If yusri.JumlanBaris > 0 Then kodbar081.Text = yusri.DataTablenya.Rows(0).Item("KODEBARANG") nabar081.Text = yusri.DataTablenya.Rows(0).Item("NAMABARANG") Else MsgBox("Maaf Kodebarang tersebut tidak ada") Exit Sub End If End Sub
Private Sub kodbar081_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kodbar081.TextChanged nabar081.Text = "" unt081.Text = "" hrg081.Text = "" End Sub
Private Sub tbmh081_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmbh081.Click If kodbar081.Text.Length = 0 Then MsgBox("Mohon kolom kode Barangnya diisi") Exit Sub End If
If Val(unt081.Text) = 0 Then MsgBox("Mohon kolom Unit diisi") Exit Sub End If
If Val(hrg081.Text) = 0 Then MsgBox("mohon kolom harga diisi") Exit Sub End If
Dim dr As DataRow dr = dt.Rows.Find(kodbar081.Text) If dr Is Nothing Then dr = dt.NewRow dr("KODEBARANG") = kodbar081.Text dr("NAMABARANG") = nabar081.Text dr("UNIT") = Val(unt081.Text) dr("HARGA") = Val(hrg081.Text) dr("JUMLAH") = Val(jmlh081.Text)
Else MsgBox("Kode barang tersebut sudah ada, mohon diganti") End If yusrian() End Sub
Private Sub save081_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save081.Click If notr081.Text.Length = 0 Then MsgBox("Mohon kolom no. tansaksi diisi") Exit Sub End If
If jetr081.Text.Length = 0 Then MsgBox("Mohon kolom Jenis Transaksi diisi") Exit Sub End If
If dt.Rows.Count = 0 Then MsgBox("Mohon datatable diisi") Exit Sub End If
yusri.AturPencarianDataBase("mastertransaksi", "notrans", notr081.Text, 1, ian) If yusri.JumlanBaris > 0 Then MsgBox("Maaf No.Transaksi tersebut sudah ada.") Exit Sub End If
For Each x As DataRow In dt.Rows OLC = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & notr081.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ian) ian.Open() OLC.ExecuteNonQuery() ian.Close() Next OLC.Dispose()
Muhammad Nur
BalasHapusPublic Class Latihan037077
Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATAMAJEMUK.accdb")
Dim dt As New DataTable
Dim dr As DataRow
Private Sub Latihan37017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim X As New OleDb.OleDbDataAdapter
X = New OleDb.OleDbDataAdapter("Select BARANG.KODEBARANG, BARANG.NAMABARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, DETAILTRANSAKSI.UNIT*DETAILTRANSAKSI.HARGA AS JUMLAH from DETAILTRANSAKSI INNER JOIN BARANG ON DETAILTRANSAKSI.KODEBARANG=BARANG.KODEBARANG WHERE NOTRANS= '" & NOTRANS077.Text & "'", n)
X.Fill(dt)
X.Dispose()
Dim dataPrimary(1) As DataColumn
dataPrimary(0) = dt.Columns("KODEBARANG")
dt.PrimaryKey = dataPrimary
DGV037.DataSource = dt
End Sub
Private Sub TOTALJUMLAH()
Dim TOT As Double = 0
For Each x As DataRow In dt.Rows
TOT = TOT + x("JUMLAH")
Next
TOTAL077.Text = TOT
End Sub
Private Sub KB_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles KB077.Leave
If KB077.Text.Length = 0 Then
Exit Sub
End If
Dim Pencari As New ByIskandar.CariKeDataBaseByIskandar
Pencari.AturPencarianDataBase("BARANG", "KODEBARANG", KB077.Text, 1, n)
If Pencari.JumlanBaris > 0 Then
KB077.Text = Pencari.DataTablenya.Rows(0).Item("KODEBARANG")
NB077.Text = Pencari.DataTablenya.Rows(0).Item("NAMABARANG")
Else
MsgBox("Kode barang tersebut tidak ada")
Exit Sub
End If
End Sub
Private Sub KB_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KB077.TextChanged
NB077.Text = ""
UNIT077.Text = ""
HB077.Text = ""
End Sub
Private Sub UNIT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UNIT077.TextChanged, HB077.TextChanged
JUM077.Text = Val(UNIT077.Text) * Val(HB077.Text)
End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click
BalasHapus'a'
If KB077.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NB077.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
End If
If Val(UNIT077.Text) = 0 Then
MsgBox("Masukkan unit barang")
Exit Sub
End If
If Val(HB077.Text) = 0 Then
MsgBox("Masukkan harga barang barang")
Exit Sub
End If
'b'
dr = dt.Rows.Find(KB077.Text)
If dr Is Nothing Then
dr = dt.NewRow
dr("KODEBARANG") = KB077.Text
Else
MsgBox("Maaf kodebarang sudah ada")
Exit Sub
End If
'c'
dr = dt.NewRow
dr("KODEBARANG") = KB077.Text
dr("NAMABARANG") = NB077.Text
dr("UNIT") = UNIT077.Text
dr("HARGA") = HB077.Text
dr("JUMLAH") = JUM077.Text
dt.Rows.Add(dr)
'd'
KB077.Text = ""
NB077.Text = ""
UNIT077.Text = ""
HB077.Text = ""
'e'
TOTALJUMLAH()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
'a'
If NOTRANS077.Text.Length = 0 Then
MsgBox("No. transaksi sudah ada")
Exit Sub
End If
If JT077.Text.Length = 0 Then
MsgBox("Jenis transaksi sudah ada")
Exit Sub
End If
'b'
If dt.Rows.Count = 0 Then
MsgBox("Jumlah baris tidak terisi")
Exit Sub
End If
'c'
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", NOTRANS077.Text, 1, n)
If pencari.JumlanBaris > 0 Then
MsgBox("data tersebut sudah ada")
Exit Sub
End If
'd'
Dim CM As New OleDb.OleDbCommand
CM = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI (NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & NOTRANS077.Text & "', #" & dateTimePicker.Value.Month & "/" & dateTimePicker.Value.Day & "/" & dateTimePicker.Value.Year & "#, '" & JT077.Text & "')", n)
n.Open()
CM.ExecuteNonQuery()
n.Close()
'e'
For Each X As DataRow In dt.Rows
CM = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & NOTRANS077.Text & "','" & X("KODEBARANG") & "'," & X("UNIT") & ", " & X("HARGA") & ")", n)
n.Open()
CM.ExecuteNonQuery()
n.Close()
CM.Dispose()
Next
'f'
NOTRANS077.Text = ""
JT077.Text = ""
JUM077.Text = ""
'g'
dt.Rows.Clear()
'h'
TOTALJUMLAH()
End Sub
End Class
Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click
BalasHapus'a'
If c058.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If d058.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
End If
If Val(ee058.Text) = 0 Then
MsgBox("Masukkan unit barang")
Exit Sub
End If
If Val(f058.Text) = 0 Then
MsgBox("Masukkan harga barang barang")
Exit Sub
End If
'b'
dr = dt.Rows.Find(c058.Text)
If dr Is Nothing Then
dr = dt.NewRow
dr("KODEBARANG") = c058.Text
Else
MsgBox("Maaf kodebarang sudah ada")
Exit Sub
End If
'c'
dr = dt.NewRow
dr("KODEBARANG") = c058.Text
dr("NAMABARANG") = d058.Text
dr("UNIT") = ee058.Text
dr("HARGA") = f058.Text
dr("JUMLAH") = g058.Text
dt.Rows.Add(dr)
'd'
c058.Text = ""
d058.Text = ""
ee058.Text = ""
f058.Text = ""
'e'
TOTALJUMLAH()
End Sub
Private Sub simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click
'a'
If a058.Text.Length = 0 Then
MsgBox("No. transaksi sudah ada")
Exit Sub
End If
If b058.Text.Length = 0 Then
MsgBox("Jenis transaksi sudah ada")
Exit Sub
End If
'b'
If dt.Rows.Count = 0 Then
MsgBox("Jumlah baris tidak terisi")
Exit Sub
End If
'c'
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", a058.Text, 1, yunha)
If pencari.JumlanBaris > 0 Then
MsgBox("data tersebut sudah ada")
Exit Sub
End If
'd'
Dim z As New OleDb.OleDbCommand
z = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI (NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & a058.Text & "', #" & DateTimePicker1.Value.Month & "/" & DateTimePicker1.Value.Day & "/" & DateTimePicker1.Value.Year & "#, '" & b058.Text & "')", yunha)
yunha.Open()
z.ExecuteNonQuery()
yunha.Close()
'e'
For Each X As DataRow In dt.Rows
z = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & a058.Text & "','" & X("KODEBARANG") & "'," & X("UNIT") & ", " & X("HARGA") & ")", yunha)
yunha.Open()
z.ExecuteNonQuery()
yunha.Close()
z.Dispose()
Next
'f'
a058.Text = ""
b058.Text = ""
g058.Text = ""
'g'
dt.Rows.Clear()
'h'
TOTALJUMLAH()
End Sub
End Class
Public Class Latihan_37_09081
BalasHapusDim dt As New DataTable
Dim OLC As New OleDb.OleDbCommand
Dim yusri As New ByIskandar.CariKeDataBaseByIskandar
Dim ian As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Datamajemuk.ACCDB")
Private Sub Latihan_37_09081_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 barang.KODEBARANG, barang.NAMABARANG, detailtransaksi.UNIT, detailtransaksi.HARGA, detailtransaksi.unit*harga as JUMLAH from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang where notrans ='" & notr081.Text & "'", ian)
dt.Rows.Clear()
a.Fill(dt)
a.Dispose()
Dim dc(1) As DataColumn
dc(0) = dt.Columns("kodebarang")
dt.PrimaryKey = dc
dgv081.DataSource = dt
End Sub
Private Sub yusrian()
Dim yusrian1 As Integer = 0
For Each yusrian2 As DataRow In dt.Rows
yusrian1 += yusrian2("JUMLAH")
Next
tot081.Text = yusrian1
End Sub
Private Sub unt081_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles unt081.TextChanged, hrg081.TextChanged
jmlh081.Text = Val(unt081.Text) * Val(hrg081.Text)
End Sub
Private Sub kodbar081_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles kodbar081.Leave
If kodbar081.Text.Length = 0 Then
Exit Sub
End If
yusri.AturPencarianDataBase("barang", "kodebarang", kodbar081.Text, 1, ian)
If yusri.JumlanBaris > 0 Then
kodbar081.Text = yusri.DataTablenya.Rows(0).Item("KODEBARANG")
nabar081.Text = yusri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
MsgBox("Maaf Kodebarang tersebut tidak ada")
Exit Sub
End If
End Sub
Private Sub kodbar081_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kodbar081.TextChanged
nabar081.Text = ""
unt081.Text = ""
hrg081.Text = ""
End Sub
Private Sub tbmh081_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmbh081.Click
BalasHapusIf kodbar081.Text.Length = 0 Then
MsgBox("Mohon kolom kode Barangnya diisi")
Exit Sub
End If
If Val(unt081.Text) = 0 Then
MsgBox("Mohon kolom Unit diisi")
Exit Sub
End If
If Val(hrg081.Text) = 0 Then
MsgBox("mohon kolom harga diisi")
Exit Sub
End If
Dim dr As DataRow
dr = dt.Rows.Find(kodbar081.Text)
If dr Is Nothing Then
dr = dt.NewRow
dr("KODEBARANG") = kodbar081.Text
dr("NAMABARANG") = nabar081.Text
dr("UNIT") = Val(unt081.Text)
dr("HARGA") = Val(hrg081.Text)
dr("JUMLAH") = Val(jmlh081.Text)
dt.Rows.Add(dr)
kodbar081.Text = ""
unt081.Text = ""
hrg081.Text = ""
Else
MsgBox("Kode barang tersebut sudah ada, mohon diganti")
End If
yusrian()
End Sub
Private Sub save081_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save081.Click
If notr081.Text.Length = 0 Then
MsgBox("Mohon kolom no. tansaksi diisi")
Exit Sub
End If
If jetr081.Text.Length = 0 Then
MsgBox("Mohon kolom Jenis Transaksi diisi")
Exit Sub
End If
If dt.Rows.Count = 0 Then
MsgBox("Mohon datatable diisi")
Exit Sub
End If
yusri.AturPencarianDataBase("mastertransaksi", "notrans", notr081.Text, 1, ian)
If yusri.JumlanBaris > 0 Then
MsgBox("Maaf No.Transaksi tersebut sudah ada.")
Exit Sub
End If
OLC = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & notr081.Text & "',#" & tgl081.Value.Month & "/" & tgl081.Value.Day & "/" & tgl081.Value.Year & "#,'" & jetr081.Text & "')", ian)
ian.Open()
OLC.ExecuteNonQuery()
ian.Close()
For Each x As DataRow In dt.Rows
OLC = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & notr081.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ian)
ian.Open()
OLC.ExecuteNonQuery()
ian.Close()
Next
OLC.Dispose()
notr081.Text = ""
jetr081.Text = ""
dt.Rows.Clear()
yusrian()
End Sub
End Class
http://kartika139.blogspot.com/2011/11/latihan-37.html
BalasHapushttp://krisnasaman-teddybear.blogspot.com/2011/12/latihan37.html
BalasHapushttp://winnymatarru.blogspot.com/2011/12/latihan-37.html
BalasHapushttp://parubakcatherine.blogspot.com/2011/12/latihan-37.html
BalasHapushttp://meylin-meylanierlangga.blogspot.com/2011/12/latihan-37.html
BalasHapushttp://elayuck.blogspot.com/2011/12/latihan-37.html
BalasHapushttp://valenndut.blogspot.com/2011/12/latihan-37.html
BalasHapushttp://sarshe-sarshe.blogspot.com/2011/12/latihan03736109060.html
BalasHapushttp://urimoktaviana.blogspot.com/2011/12/latihan-37.html
BalasHapushttp://nurulilmimustari.blogspot.com/2011/12/form-37.html
BalasHapushttp://derielrangers.blogspot.com/2011/12/form-37.html
BalasHapushttp://pute991.blogspot.com/2011/12/latihan-37.html
BalasHapus(36109057)
BalasHapusfatma sari
http://fatmacmr.blogspot.com/2011/12/latihan-37.html
http://hantualis.blogspot.com/2011/12/form-37-apkom-4.html
BalasHapushttp://gunawanmustari.blogspot.com/2011/12/latihan-37.html
BalasHapus