Dim dwitya As New OleDb.OleDbCommand Dim saadah As New ByIskandar.CariKeDataBaseByIskandar Dim wiwi As New DataTable Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=ngekngek")
Private Sub TM46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109001.Click If KB46109001.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UN46109001.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(HR46109001.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim tingting As DataRow tingting = wiwi.NewRow tingting("KODEBARANG") = Val(KB46109001.Text) tingting("UNIT") = Val(UN46109001.Text) tingting("HARGA") = Val(HR46109001.Text)
Private Sub LATIHAN036_46109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ting As New OleDb.OleDbDataAdapter ting = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109001.Text & "'", conect) ting.Fill(wiwi) ting.Dispose()
DATA46109001.DataSource = wiwi
End Sub
Private Sub S46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109001.Click If NT46109001.Text.Length = 0 Then MsgBox("isi rong No Transaksi na..") Exit Sub End If
If JT46109001.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") Exit Sub End If
If wiwi.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable na..") Exit Sub End If
saadah.AturPencarianDataBase("mastertransaksi", "notrans", NT46109001.Text, 1, conect) If saadah.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In wiwi.Rows dwitya = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109001.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect) conect.Open() dwitya.ExecuteNonQuery() conect.Close() Next dwitya.Dispose()
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;jet oledb:database Password=thepinkers29") Dim WAHDA As New DataTable Dim NIAH As New OleDb.OleDbCommand Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN36_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim DANIAH As New OleDb.OleDbDataAdapter DANIAH = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_46109051.Text & "'", CONECT) WAHDA.Rows.Clear() DANIAH.Fill(WAHDA) DANIAH.Dispose()
DG_46109051.DataSource = WAHDA
Dim dc(1) As DataColumn dc(0) = WAHDA.Columns("kodebarang") WAHDA.PrimaryKey = dc
End Sub
Private Sub SAVE_46109051_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SAVE_46109051.Click If NT_46109051.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If JT_46109051.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
For Each x As DataRow In WAHDA.Rows NIAH = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT_46109051.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", CONECT) CONECT.Open() NIAH.ExecuteNonQuery() CONECT.Close() Next NIAH.Dispose()
NT_46109051.Text = "" JT_46109051.Text = ""
WAHDA.Rows.Clear() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB_46109051.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(U_46109051.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(H_46109051.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
Dim MMM As DataRow MMM = WAHDA.Rows.Find(KB_46109051.Text) If MMM Is Nothing Then MMM = WAHDA.NewRow MMM("KODEBARANG") = KB_46109051.Text MMM("UNIT") = U_46109051.Text MMM("HARGA") = H_46109051.Text
Dim fahrul As New OleDb.OleDbCommand Dim arul As New ByIskandar.CariKeDataBaseByIskandar Dim april As New DataTable Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=arul")
Private Sub TM46109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109005.Click If KB46109005.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UN46109005.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(HR46109005.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim barru As DataRow barru = april.NewRow barru("KODEBARANG") = Val(KB46109005.Text) barru("UNIT") = Val(UN46109005.Text) barru("HARGA") = Val(HR46109005.Text)
Private Sub LATIHAN036_46109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ting As New OleDb.OleDbDataAdapter ting = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109005.Text & "'", conect) ting.Fill(april) ting.Dispose()
DATA46109005.DataSource = april
End Sub
Private Sub S46109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109005.Click If NT46109005.Text.Length = 0 Then MsgBox("isi rong No Transaksi na..") Exit Sub End If
If JT46109005.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") Exit Sub End If
If april.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable na..") Exit Sub End If
arul.AturPencarianDataBase("mastertransaksi", "notrans", NT46109005.Text, 1, conect) If arul.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In april.Rows fahrul = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109005.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect) conect.Open() fahrul.ExecuteNonQuery() conect.Close() Next fahrul.Dispose()
Public Class Form36 Dim FADILLAH As New OleDb.OleDbCommand Dim SAGENA As New ByIskandar.CariKeDataBaseByIskandar Dim DILA As New DataTable Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=240991")
Private Sub TAMBAH_059_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH_059.Click If KODE_059.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UNIT_059.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(HARGA_059.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim UDHE As DataRow UDHE = DILA.NewRow UDHE("KODEBARANG") = Val(KODE_059.Text) UDHE("UNIT") = Val(UNIT_059.Text) UDHE("HARGA") = Val(HARGA_059.Text)
Private Sub Form36_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim DAUDE As New OleDb.OleDbDataAdapter DAUDE = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & DILA1_059.Text & "'", conect) DAUDE.Fill(DILA) DAUDE.Dispose()
DATA_059.DataSource = DILA
End Sub
Private Sub SIMPAN_059_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN_059.Click If DILA1_059.Text.Length = 0 Then MsgBox("isi No Transaksi") Exit Sub End If
If DILA2_059.Text.Length = 0 Then MsgBox("Isi Jenis Transaksi") Exit Sub End If
If DILA.Rows.Count = 0 Then MsgBox("Isi datatable") Exit Sub End If
SAGENA.AturPencarianDataBase("mastertransaksi", "notrans", DILA1_059.Text, 1, conect) If SAGENA.JumlanBaris > 0 Then MsgBox("notrans sudah ada") Exit Sub End If
For Each x As DataRow In DILA.Rows FADILLAH = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & DILA1_059.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect) conect.Open() FADILLAH.ExecuteNonQuery() conect.Close() Next FADILLAH.Dispose()
DILA1_059.Text = "" DILA2_059.Text = ""
DILA.Rows.Clear() End Sub
Private Sub DILA1_059_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DILA1_059.TextChanged
Dim ayu As New OleDb.OleDbCommand Dim wandika As New ByIskandar.CariKeDataBaseByIskandar Dim putri As New DataTable Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=putri")
Private Sub TM46109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109017.Click If KB46109017.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UN46109017.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(HR46109017.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim utami As DataRow utami = putri.NewRow utami("KODEBARANG") = Val(KB46109017.Text) utami("UNIT") = Val(UN46109017.Text) utami("HARGA") = Val(HR46109017.Text)
Private Sub LATIHAN036_46109017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim idung As New OleDb.OleDbDataAdapter idung = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109017.Text & "'", conect) idung.Fill(putri) idung.Dispose()
DATA46109017.DataSource = putri
End Sub
Private Sub S46109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109017.Click If NT46109017.Text.Length = 0 Then MsgBox("isi rong No Transaksi na..") Exit Sub End If
If JT46109017.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") Exit Sub End If
If putri.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable na..") Exit Sub End If
wandika.AturPencarianDataBase("mastertransaksi", "notrans", NT46109017.Text, 1, conect) If wandika.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In putri.Rows ayu = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109017.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect) conect.Open() ayu.ExecuteNonQuery() conect.Close() Next ayu.Dispose()
LATIHAN 36 Public Class LATIHAN036_46109030 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=ainun") Dim DT As New DataTable Dim telusur As New ByIskandar.CariKeDataBaseByIskandar Private Sub LATIHAN036_46109030_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ainun As New OleDb.OleDbDataAdapter ainun = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & kb_46109030.Text & "'", CONECT) DT.Rows.Clear() ainun.Fill(DT) dg_46109030.DataSource = DT
ainun.Dispose()
Dim nun(1) As DataColumn nun(0) = DT.Columns("NOTRANS") DT.PrimaryKey = nun End Sub
Private Sub t_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t_46109030.Click If kb_46109030.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(un_46109030.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
kb_46109030.Text = "" un_46109030.Text = "" hr_46109030.Text = "" Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "KodeBarang", kb_46109030.Text, 1, CONECT) If pencari.JumlanBaris > 0 Then MsgBox("Data yang anda masukkan telah ada") Exit Sub End If End Sub
Private Sub s_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles s_46109030.Click If nt_46109030.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If If jt_46109030.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If telusur.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim cup As New OleDb.OleDbCommand cup = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_46109030.Text & "',#" & dtp_46109030.Value.Date & "#," & Val(jt_46109030.Text) & ")", CONECT) CONECT.Open() cup.ExecuteNonQuery() CONECT.Close()
For Each r As DataRow In DT.Rows
cup = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & nt_46109030.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;jet oledb:database Password=thepinkers29") Dim ERRY As New DataTable Dim ASYH As New OleDb.OleDbCommand Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN36_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim MURNI As New OleDb.OleDbDataAdapter MURNI = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & NOKB_056.Text & "'", CONECT) ERRY.Rows.Clear() MURNI.Fill(ERRY) MURNI.Dispose()
DGV1_056.DataSource = ERRY
Dim dc(1) As DataColumn dc(0) = ERRY.Columns("kodebarang") ERRY.PrimaryKey = dc
End Sub
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click If NOTRANS_056.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If NOJTRA_056.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
For Each x As DataRow In ERRY.Rows ASYH = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NOTRANS_056.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", CONECT) CONECT.Open() ASYH.ExecuteNonQuery() CONECT.Close() Next ASYH.Dispose()
NOTRANS_056.Text = "" NOJTRA_056.Text = ""
ERRY.Rows.Clear() End Sub
Private Sub TAMBAH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH.Click If NOKB_056.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(NOUNIT_056.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(NOHRGA_056.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
Dim DTR As DataRow DTR = ERRY.Rows.Find(NOKB_056.Text) If DTR Is Nothing Then DTR = ERRY.NewRow DTR("KODEBARANG") = NOKB_056.Text DTR("UNIT") = NOUNIT_056.Text DTR("HARGA") = NOHRGA_056.Text
Dim joice As New OleDb.OleDbCommand Dim natalina As New ByIskandar.CariKeDataBaseByIskandar Dim paginta As New DataTable Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=paginta")
Private Sub TB_041_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TB_041.Click If KB_041.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UN_041.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(H_041.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim parinding As DataRow parinding = paginta.NewRow parinding("KODEBARANG") = Val(KB_041.Text) parinding("UNIT") = Val(UN_041.Text) parinding("HARGA") = Val(H_041.Text)
Private Sub LATIHAN036_46109041_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim seunggi As New OleDb.OleDbDataAdapter seunggi = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT_041.Text & "'", conect) seunggi.Fill(paginta) seunggi.Dispose()
lee_041.DataSource = paginta
End Sub
Private Sub S_041_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S_041.Click If NT_041.Text.Length = 0 Then MsgBox("tolong diisi no transaksi") Exit Sub End If
If JT_041.Text.Length = 0 Then MsgBox("tolong diisi jenis transaksi") Exit Sub End If
If paginta.Rows.Count = 0 Then MsgBox("tolong diisi datatable") Exit Sub End If
natalina.AturPencarianDataBase("mastertransaksi", "notrans", NT_041.Text, 1, conect) If natalina.JumlanBaris > 0 Then MsgBox("sudah ada") Exit Sub End If
For Each x As DataRow In paginta.Rows joice = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT_041.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect) conect.Open() joice.ExecuteNonQuery() conect.Close() Next joice.Dispose()
Dim ismi As New OleDb.OleDbCommand Dim sri As New ByIskandar.CariKeDataBaseByIskandar Dim cimi As New DataTable Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub TM46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click If KB46109023.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UN46109023.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(HR46109023.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim cimot As DataRow cimot = cimi.NewRow cimot("KODEBARANG") = Val(KB46109023.Text) cimot("UNIT") = Val(UN46109023.Text) cimot("HARGA") = Val(HR46109023.Text)
Private Sub Form36_46109023_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cimcim As New OleDb.OleDbDataAdapter cimcim = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109023.Text & "'", conect) cimcim.Fill(cimi) cimcim.Dispose()
DATA46109023.DataSource = cimi
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click If NT46109023.Text.Length = 0 Then MsgBox("isi No Transaksi") Exit Sub End If
If JT46109023.Text.Length = 0 Then MsgBox("Isi Jenis Transaksi") Exit Sub End If
If cimi.Rows.Count = 0 Then MsgBox("Isi datatable") Exit Sub End If
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect) If sri.JumlanBaris > 0 Then MsgBox("notrans sudah ada") Exit Sub End If
For Each x As DataRow In cimi.Rows ismi = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect) conect.Open() ismi.ExecuteNonQuery() conect.Close() Next ismi.Dispose()
Public Class LATIHAN0360_054 Dim dwi As New OleDb.OleDbCommand Dim mustika As New ByIskandar.CariKeDataBaseByIskandar Dim chaerunnisa As New DataTable Dim mulyadi As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=wiwi")
Private Sub Dwi1_46109054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi1_46109054.Click If ww3_46109054.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(ww4_46109054.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(ww5_46109054.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim bahasa As DataRow bahasa = chaerunnisa.NewRow bahasa("KODEBARANG") = Val(ww3_46109054.Text) bahasa("UNIT") = Val(ww4_46109054.Text) bahasa("HARGA") = Val(ww5_46109054.Text)
Private Sub LATIHAN036_46109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim hma As New OleDb.OleDbDataAdapter hma = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & ww1_46109054.Text & "'", mulyadi) hma.Fill(chaerunnisa) hma.Dispose()
DGV_46109054.DataSource = chaerunnisa
End Sub
Private Sub Dwi2_46109054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi2_46109054.Click If ww1_46109054.Text.Length = 0 Then MsgBox("isi rong No Transaksi na..") Exit Sub End If
If ww2_46109054.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi na..") Exit Sub End If
If chaerunnisa.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable na..") Exit Sub End If
mustika.AturPencarianDataBase("mastertransaksi", "notrans", ww1_46109054.Text, 1, mulyadi) If mustika.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In chaerunnisa.Rows dwi = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & ww1_46109054.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", mulyadi) mulyadi.Open() dwi.ExecuteNonQuery() mulyadi.Close() Next dwi.Dispose()
Public Class LATIHAN036_46109027 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=feby") Dim DT As New DataTable Dim telusur As New ByIskandar.CariKeDataBaseByIskandar Private Sub LATIHAN036_46109027_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim feby As New OleDb.OleDbDataAdapter feby = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & kb_46109027.Text & "'", CONECT) DT.Rows.Clear() feby.Fill(DT) dg_46109027.DataSource = DT
feby.Dispose()
Dim bhe(1) As DataColumn bhe(0) = DT.Columns("NOTRANS") DT.PrimaryKey = bhe End Sub
Private Sub t_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t_46109027.Click If kb_46109027.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(un_46109027.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
kb_46109027.Text = "" un_46109027.Text = "" hr_46109027.Text = "" Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "KodeBarang", kb_46109027.Text, 1, CONECT) If pencari.JumlanBaris > 0 Then MsgBox("Data yang anda masukkan telah ada") Exit Sub End If End Sub
Private Sub s_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles s_46109027.Click If nt_46109027.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If If jt_46109027.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If telusur.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim cup As New OleDb.OleDbCommand cup = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_46109027.Text & "',#" & dtp_46109027.Value.Date & "#," & Val(jt_46109027.Text) & ")", CONECT) CONECT.Open() cup.ExecuteNonQuery() CONECT.Close()
For Each r As DataRow In DT.Rows
cup = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & nt_46109027.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
Public Class LATIHAN_036_46109053 Dim INDAH As New OleDb.OleDbCommand Dim YANI As New ByIskandar.CariKeDataBaseByIskandar Dim DT As New DataTable Dim KONEKSI As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=ngekngek")
Private Sub TAMBAH_053_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH_053.Click If KB_053.Text.Length = 0 Then MsgBox("Kode tsb sudah ada") Exit Sub End If
If Val(UNIT_053.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If
If Val(HRG_053.Text) = 0 Then MsgBox("Tolong di isi") Exit Sub End If Dim ENONG As DataRow ENONG = DT.NewRow ENONG("KODEBARANG") = Val(KB_053.Text) ENONG("UNIT") = Val(UNIT_053.Text) ENONG("HARGA") = Val(HRG_053.Text)
Private Sub LATIHAN036_053_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim SILVER As New OleDb.OleDbDataAdapter SILVER = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT_053.Text & "'", KONEKSI) SILVER.Fill(DT) SILVER.Dispose()
DATA_053.DataSource = DT End Sub
Private Sub SIMPAN_053_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN_053.Click If NT_053.Text.Length = 0 Then MsgBox("isi rong No Transaksi na..") Exit Sub End If
If JT_053.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
YANI.AturPencarianDataBase("mastertransaksi", "notrans", NT_053.Text, 1, KONEKSI) If YANI.JumlanBaris > 0 Then MsgBox("Adami notrans seperti itu") Exit Sub End If
For Each x As DataRow In DT.Rows INDAH = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT_053.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", KONEKSI) KONEKSI.Open() INDAH.ExecuteNonQuery() KONEKSI.Close() Next INDAH.Dispose()
ARYANDIRA(46109034) LATIHAN36_034 Public Class Latihan36_034 Dim dt As New DataTable Dim cm As New OleDb.OleDbCommand Dim dira As New ByIskandar.CariKeDataBaseByIskandar Dim satu As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Latihan36_034_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_034.Text & "'", satu) a.Fill(dt) a.Dispose()
dgv.DataSource = dt
Dim dc(1) As DataColumn dc(0) = dt.Columns("kodebarang") dt.PrimaryKey = dc End Sub
Private Sub gg_034_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gg_034.Click If dd_034.Text.Length = 0 Then MsgBox("Isi rong itu Kode Barang ") Exit Sub End If
If Val(ee_034.Text) = 0 Then MsgBox("Isi rong itu Unit ") Exit Sub End If
If Val(ff_034.Text) = 0 Then MsgBox("Isi rong itu Harga ") Exit Sub End If
Dim dr As DataRow dr = dt.Rows.Find(dd_034.Text) If dr Is Nothing Then dr = dt.NewRow dr("KODEBARANG") = dd_034.Text dr("UNIT") = ee_034.Text dr("HARGA") = ff_034.Text
Else MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain") End If End Sub
Private Sub hh_034_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hh_034.Click If aa_034.Text.Length = 0 Then MsgBox("Isi rong No Transaksi") Exit Sub End If
If cc_034.Text.Length = 0 Then MsgBox("Isi rong Jenis Transaksi") Exit Sub End If
If dt.Rows.Count = 0 Then MsgBox("Maaf...Isi rong itu datatable “) Exit Sub End If
dira.AturPencarianDataBase("mastertransaksi", "notrans", aa_034.Text, 1, satu) If dira.JumlanBaris > 0 Then MsgBox("Ada 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_034.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", satu) satu.Open() cm.ExecuteNonQuery() satu.Close() Next cm.Dispose()
Public Class LATIHAN036_46109001
BalasHapusDim dwitya As New OleDb.OleDbCommand
Dim saadah As New ByIskandar.CariKeDataBaseByIskandar
Dim wiwi As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=ngekngek")
Private Sub TM46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109001.Click
If KB46109001.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UN46109001.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(HR46109001.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim tingting As DataRow
tingting = wiwi.NewRow
tingting("KODEBARANG") = Val(KB46109001.Text)
tingting("UNIT") = Val(UN46109001.Text)
tingting("HARGA") = Val(HR46109001.Text)
wiwi.Rows.Add(tingting)
KB46109001.Text = ""
UN46109001.Text = ""
HR46109001.Text = ""
End Sub
Private Sub LATIHAN036_46109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ting As New OleDb.OleDbDataAdapter
ting = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109001.Text & "'", conect)
ting.Fill(wiwi)
ting.Dispose()
DATA46109001.DataSource = wiwi
End Sub
Private Sub S46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109001.Click
If NT46109001.Text.Length = 0 Then
MsgBox("isi rong No Transaksi na..")
Exit Sub
End If
If JT46109001.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
Exit Sub
End If
If wiwi.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable na..")
Exit Sub
End If
saadah.AturPencarianDataBase("mastertransaksi", "notrans", NT46109001.Text, 1, conect)
If saadah.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
dwitya = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109001.Text & "',#" & T46109001.Value.Month & "/" & T46109001.Value.Day & "/" & T46109001.Value.Year & "#,'" & JT46109001.Text & "')", conect)
conect.Open()
dwitya.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In wiwi.Rows
dwitya = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109001.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
dwitya.ExecuteNonQuery()
conect.Close()
Next
dwitya.Dispose()
NT46109001.Text = ""
JT46109001.Text = ""
wiwi.Rows.Clear()
End Sub
End Class
Public Class LATIHAN36_46109051
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;jet oledb:database Password=thepinkers29")
Dim WAHDA As New DataTable
Dim NIAH As New OleDb.OleDbCommand
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN36_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DANIAH As New OleDb.OleDbDataAdapter
DANIAH = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_46109051.Text & "'", CONECT)
WAHDA.Rows.Clear()
DANIAH.Fill(WAHDA)
DANIAH.Dispose()
DG_46109051.DataSource = WAHDA
Dim dc(1) As DataColumn
dc(0) = WAHDA.Columns("kodebarang")
WAHDA.PrimaryKey = dc
End Sub
Private Sub SAVE_46109051_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SAVE_46109051.Click
If NT_46109051.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If JT_46109051.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", NT_46109051.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
NIAH = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT_46109051.Text & "',#" & DT_46109051.Value.Month & "/" & DT_46109051.Value.Day & "/" & DT_46109051.Value.Year & "#,'" & JT_46109051.Text & "')", CONECT)
CONECT.Open()
NIAH.ExecuteNonQuery()
CONECT.Close()
For Each x As DataRow In WAHDA.Rows
NIAH = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT_46109051.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", CONECT)
CONECT.Open()
NIAH.ExecuteNonQuery()
CONECT.Close()
Next
NIAH.Dispose()
NT_46109051.Text = ""
JT_46109051.Text = ""
WAHDA.Rows.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB_46109051.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(U_46109051.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(H_46109051.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim MMM As DataRow
MMM = WAHDA.Rows.Find(KB_46109051.Text)
If MMM Is Nothing Then
MMM = WAHDA.NewRow
MMM("KODEBARANG") = KB_46109051.Text
MMM("UNIT") = U_46109051.Text
MMM("HARGA") = H_46109051.Text
WAHDA.Rows.Add(MMM)
KB_46109051.Text = ""
U_46109051.Text = ""
H_46109051.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain")
End If
End Sub
End Class
Public Class LATIHAN036_46109005
BalasHapusDim fahrul As New OleDb.OleDbCommand
Dim arul As New ByIskandar.CariKeDataBaseByIskandar
Dim april As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=arul")
Private Sub TM46109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109005.Click
If KB46109005.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UN46109005.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(HR46109005.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim barru As DataRow
barru = april.NewRow
barru("KODEBARANG") = Val(KB46109005.Text)
barru("UNIT") = Val(UN46109005.Text)
barru("HARGA") = Val(HR46109005.Text)
april.Rows.Add(barru)
KB46109005.Text = ""
UN46109005.Text = ""
HR46109005.Text = ""
End Sub
Private Sub LATIHAN036_46109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ting As New OleDb.OleDbDataAdapter
ting = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109005.Text & "'", conect)
ting.Fill(april)
ting.Dispose()
DATA46109005.DataSource = april
End Sub
Private Sub S46109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109005.Click
If NT46109005.Text.Length = 0 Then
MsgBox("isi rong No Transaksi na..")
Exit Sub
End If
If JT46109005.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
Exit Sub
End If
If april.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable na..")
Exit Sub
End If
arul.AturPencarianDataBase("mastertransaksi", "notrans", NT46109005.Text, 1, conect)
If arul.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
fahrul = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109005.Text & "',#" & T46109005.Value.Month & "/" & T46109005.Value.Day & "/" & T46109005.Value.Year & "#,'" & JT46109005.Text & "')", conect)
conect.Open()
fahrul.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In april.Rows
fahrul = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109005.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
fahrul.ExecuteNonQuery()
conect.Close()
Next
fahrul.Dispose()
NT46109005.Text = ""
JT46109005.Text = ""
april.Rows.Clear()
End Sub
End Class
Public Class Form36
BalasHapusDim FADILLAH As New OleDb.OleDbCommand
Dim SAGENA As New ByIskandar.CariKeDataBaseByIskandar
Dim DILA As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=240991")
Private Sub TAMBAH_059_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH_059.Click
If KODE_059.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UNIT_059.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(HARGA_059.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim UDHE As DataRow
UDHE = DILA.NewRow
UDHE("KODEBARANG") = Val(KODE_059.Text)
UDHE("UNIT") = Val(UNIT_059.Text)
UDHE("HARGA") = Val(HARGA_059.Text)
DILA.Rows.Add(UDHE)
KODE_059.Text = ""
UNIT_059.Text = ""
HARGA_059.Text = ""
End Sub
Private Sub Form36_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DAUDE As New OleDb.OleDbDataAdapter
DAUDE = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & DILA1_059.Text & "'", conect)
DAUDE.Fill(DILA)
DAUDE.Dispose()
DATA_059.DataSource = DILA
End Sub
Private Sub SIMPAN_059_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN_059.Click
If DILA1_059.Text.Length = 0 Then
MsgBox("isi No Transaksi")
Exit Sub
End If
If DILA2_059.Text.Length = 0 Then
MsgBox("Isi Jenis Transaksi")
Exit Sub
End If
If DILA.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
SAGENA.AturPencarianDataBase("mastertransaksi", "notrans", DILA1_059.Text, 1, conect)
If SAGENA.JumlanBaris > 0 Then
MsgBox("notrans sudah ada")
Exit Sub
End If
FADILLAH = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & DILA1_059.Text & "',#" & TGL_059.Value.Month & "/" & TGL_059.Value.Day & "/" & TGL_059.Value.Year & "#,'" & DILA2_059.Text & "')", conect)
conect.Open()
FADILLAH.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In DILA.Rows
FADILLAH = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & DILA1_059.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
FADILLAH.ExecuteNonQuery()
conect.Close()
Next
FADILLAH.Dispose()
DILA1_059.Text = ""
DILA2_059.Text = ""
DILA.Rows.Clear()
End Sub
Private Sub DILA1_059_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DILA1_059.TextChanged
End Sub
End Class
Public Class LATIHAN036_46109017
BalasHapusDim ayu As New OleDb.OleDbCommand
Dim wandika As New ByIskandar.CariKeDataBaseByIskandar
Dim putri As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=putri")
Private Sub TM46109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109017.Click
If KB46109017.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UN46109017.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(HR46109017.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim utami As DataRow
utami = putri.NewRow
utami("KODEBARANG") = Val(KB46109017.Text)
utami("UNIT") = Val(UN46109017.Text)
utami("HARGA") = Val(HR46109017.Text)
putri.Rows.Add(utami)
KB46109017.Text = ""
UN46109017.Text = ""
HR46109017.Text = ""
End Sub
Private Sub LATIHAN036_46109017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim idung As New OleDb.OleDbDataAdapter
idung = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109017.Text & "'", conect)
idung.Fill(putri)
idung.Dispose()
DATA46109017.DataSource = putri
End Sub
Private Sub S46109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109017.Click
If NT46109017.Text.Length = 0 Then
MsgBox("isi rong No Transaksi na..")
Exit Sub
End If
If JT46109017.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
Exit Sub
End If
If putri.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable na..")
Exit Sub
End If
wandika.AturPencarianDataBase("mastertransaksi", "notrans", NT46109017.Text, 1, conect)
If wandika.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
ayu = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109017.Text & "',#" & T46109017.Value.Month & "/" & T46109017.Value.Day & "/" & T46109017.Value.Year & "#,'" & JT46109017.Text & "')", conect)
conect.Open()
ayu.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In putri.Rows
ayu = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109017.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
ayu.ExecuteNonQuery()
conect.Close()
Next
ayu.Dispose()
NT46109017.Text = ""
JT46109017.Text = ""
putri.Rows.Clear()
End Sub
End Class
LATIHAN 36
BalasHapusPublic Class LATIHAN036_46109030
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=ainun")
Dim DT As New DataTable
Dim telusur As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN036_46109030_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ainun As New OleDb.OleDbDataAdapter
ainun = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & kb_46109030.Text & "'", CONECT)
DT.Rows.Clear()
ainun.Fill(DT)
dg_46109030.DataSource = DT
ainun.Dispose()
Dim nun(1) As DataColumn
nun(0) = DT.Columns("NOTRANS")
DT.PrimaryKey = nun
End Sub
Private Sub t_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t_46109030.Click
If kb_46109030.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(un_46109030.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
Dim abi As DataRow
abi = DT.NewRow
abi("KODEBARANG") = kb_46109030.Text
abi("UNIT") = un_46109030.Text
abi("HARGA") = hr_46109030.Text
DT.Rows.Add(abi)
kb_46109030.Text = ""
un_46109030.Text = ""
hr_46109030.Text = ""
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "KodeBarang", kb_46109030.Text, 1, CONECT)
If pencari.JumlanBaris > 0 Then
MsgBox("Data yang anda masukkan telah ada")
Exit Sub
End If
End Sub
Private Sub s_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles s_46109030.Click
If nt_46109030.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If jt_46109030.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
telusur.AturPencarianDataBase("mastertransaksi", "notrans", nt_46109030.Text, 1, CONECT)
If telusur.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim cup As New OleDb.OleDbCommand
cup = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_46109030.Text & "',#" & dtp_46109030.Value.Date & "#," & Val(jt_46109030.Text) & ")", CONECT)
CONECT.Open()
cup.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
cup = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & nt_46109030.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
cup.ExecuteNonQuery()
CONECT.Close()
cup.Dispose()
Next
DT.Rows.Clear()
nt_46109030.Text = ""
jt_46109030.Text = ""
End Sub
End Class
Public Class LATIHAN036_46109056
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;jet oledb:database Password=thepinkers29")
Dim ERRY As New DataTable
Dim ASYH As New OleDb.OleDbCommand
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN36_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MURNI As New OleDb.OleDbDataAdapter
MURNI = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & NOKB_056.Text & "'", CONECT)
ERRY.Rows.Clear()
MURNI.Fill(ERRY)
MURNI.Dispose()
DGV1_056.DataSource = ERRY
Dim dc(1) As DataColumn
dc(0) = ERRY.Columns("kodebarang")
ERRY.PrimaryKey = dc
End Sub
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click
If NOTRANS_056.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If NOJTRA_056.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", NOTRANS_056.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
ASYH = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NOTRANS_056.Text & "',#" & NOTGL_056.Value.Month & "/" & NOTGL_056.Value.Day & "/" & NOTGL_056.Value.Year & "#,'" & NOJTRA_056.Text & "')", CONECT)
CONECT.Open()
ASYH.ExecuteNonQuery()
CONECT.Close()
For Each x As DataRow In ERRY.Rows
ASYH = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NOTRANS_056.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", CONECT)
CONECT.Open()
ASYH.ExecuteNonQuery()
CONECT.Close()
Next
ASYH.Dispose()
NOTRANS_056.Text = ""
NOJTRA_056.Text = ""
ERRY.Rows.Clear()
End Sub
Private Sub TAMBAH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH.Click
If NOKB_056.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(NOUNIT_056.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(NOHRGA_056.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim DTR As DataRow
DTR = ERRY.Rows.Find(NOKB_056.Text)
If DTR Is Nothing Then
DTR = ERRY.NewRow
DTR("KODEBARANG") = NOKB_056.Text
DTR("UNIT") = NOUNIT_056.Text
DTR("HARGA") = NOHRGA_056.Text
ERRY.Rows.Add(DTR)
NOKB_056.Text = ""
NOUNIT_056.Text = ""
NOHRGA_056.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain")
End If
End Sub
End Class
Public Class LATIHAN036_46109041
BalasHapusDim joice As New OleDb.OleDbCommand
Dim natalina As New ByIskandar.CariKeDataBaseByIskandar
Dim paginta As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=paginta")
Private Sub TB_041_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TB_041.Click
If KB_041.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UN_041.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(H_041.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim parinding As DataRow
parinding = paginta.NewRow
parinding("KODEBARANG") = Val(KB_041.Text)
parinding("UNIT") = Val(UN_041.Text)
parinding("HARGA") = Val(H_041.Text)
paginta.Rows.Add(parinding)
KB_041.Text = ""
UN_041.Text = ""
H_041.Text = ""
End Sub
Private Sub LATIHAN036_46109041_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim seunggi As New OleDb.OleDbDataAdapter
seunggi = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT_041.Text & "'", conect)
seunggi.Fill(paginta)
seunggi.Dispose()
lee_041.DataSource = paginta
End Sub
Private Sub S_041_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S_041.Click
If NT_041.Text.Length = 0 Then
MsgBox("tolong diisi no transaksi")
Exit Sub
End If
If JT_041.Text.Length = 0 Then
MsgBox("tolong diisi jenis transaksi")
Exit Sub
End If
If paginta.Rows.Count = 0 Then
MsgBox("tolong diisi datatable")
Exit Sub
End If
natalina.AturPencarianDataBase("mastertransaksi", "notrans", NT_041.Text, 1, conect)
If natalina.JumlanBaris > 0 Then
MsgBox("sudah ada")
Exit Sub
End If
joice = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT_041.Text & "',#" & T_041.Value.Month & "/" & T_041.Value.Day & "/" & T_041.Value.Year & "#,'" & JT_041.Text & "')", conect)
conect.Open()
joice.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In paginta.Rows
joice = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT_041.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
joice.ExecuteNonQuery()
conect.Close()
Next
joice.Dispose()
NT_041.Text = ""
JT_041.Text = ""
paginta.Rows.Clear()
End Sub
End Class
Public Class Form36
BalasHapusDim ismi As New OleDb.OleDbCommand
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim cimi As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub TM46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If KB46109023.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UN46109023.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(HR46109023.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim cimot As DataRow
cimot = cimi.NewRow
cimot("KODEBARANG") = Val(KB46109023.Text)
cimot("UNIT") = Val(UN46109023.Text)
cimot("HARGA") = Val(HR46109023.Text)
cimi.Rows.Add(cimot)
KB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
End Sub
Private Sub Form36_46109023_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cimcim As New OleDb.OleDbDataAdapter
cimcim = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT46109023.Text & "'", conect)
cimcim.Fill(cimi)
cimcim.Dispose()
DATA46109023.DataSource = cimi
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("isi No Transaksi")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("Isi Jenis Transaksi")
Exit Sub
End If
If cimi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("notrans sudah ada")
Exit Sub
End If
ismi = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In cimi.Rows
ismi = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
Next
ismi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
cimi.Rows.Clear()
End Sub
End Class
Public Class LATIHAN0360_054
BalasHapusDim dwi As New OleDb.OleDbCommand
Dim mustika As New ByIskandar.CariKeDataBaseByIskandar
Dim chaerunnisa As New DataTable
Dim mulyadi As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=wiwi")
Private Sub Dwi1_46109054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi1_46109054.Click
If ww3_46109054.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(ww4_46109054.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(ww5_46109054.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim bahasa As DataRow
bahasa = chaerunnisa.NewRow
bahasa("KODEBARANG") = Val(ww3_46109054.Text)
bahasa("UNIT") = Val(ww4_46109054.Text)
bahasa("HARGA") = Val(ww5_46109054.Text)
chaerunnisa.Rows.Add(bahasa)
ww3_46109054.Text = ""
ww4_46109054.Text = ""
ww5_46109054.Text = ""
End Sub
Private Sub LATIHAN036_46109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hma As New OleDb.OleDbDataAdapter
hma = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & ww1_46109054.Text & "'", mulyadi)
hma.Fill(chaerunnisa)
hma.Dispose()
DGV_46109054.DataSource = chaerunnisa
End Sub
Private Sub Dwi2_46109054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi2_46109054.Click
If ww1_46109054.Text.Length = 0 Then
MsgBox("isi rong No Transaksi na..")
Exit Sub
End If
If ww2_46109054.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi na..")
Exit Sub
End If
If chaerunnisa.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable na..")
Exit Sub
End If
mustika.AturPencarianDataBase("mastertransaksi", "notrans", ww1_46109054.Text, 1, mulyadi)
If mustika.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
dwi = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & ww1_46109054.Text & "',#" & DTP_46109054.Value.Month & "/" & DTP_46109054.Value.Day & "/" & DTP_46109054.Value.Year & "#,'" & ww2_46109054.Text & "')", mulyadi)
mulyadi.Open()
dwi.ExecuteNonQuery()
mulyadi.Close()
For Each x As DataRow In chaerunnisa.Rows
dwi = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & ww1_46109054.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", mulyadi)
mulyadi.Open()
dwi.ExecuteNonQuery()
mulyadi.Close()
Next
dwi.Dispose()
ww1_46109054.Text = ""
ww2_46109054.Text = ""
chaerunnisa.Rows.Clear()
End Sub
End Class
Public Class LATIHAN036_46109027
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=feby")
Dim DT As New DataTable
Dim telusur As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN036_46109027_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim feby As New OleDb.OleDbDataAdapter
feby = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & kb_46109027.Text & "'", CONECT)
DT.Rows.Clear()
feby.Fill(DT)
dg_46109027.DataSource = DT
feby.Dispose()
Dim bhe(1) As DataColumn
bhe(0) = DT.Columns("NOTRANS")
DT.PrimaryKey = bhe
End Sub
Private Sub t_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t_46109027.Click
If kb_46109027.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(un_46109027.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
Dim bh As DataRow
bh = DT.NewRow
bh("KODEBARANG") = kb_46109027.Text
bh("UNIT") = un_46109027.Text
bh("HARGA") = hr_46109027.Text
DT.Rows.Add(bh)
kb_46109027.Text = ""
un_46109027.Text = ""
hr_46109027.Text = ""
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "KodeBarang", kb_46109027.Text, 1, CONECT)
If pencari.JumlanBaris > 0 Then
MsgBox("Data yang anda masukkan telah ada")
Exit Sub
End If
End Sub
Private Sub s_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles s_46109027.Click
If nt_46109027.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If jt_46109027.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
telusur.AturPencarianDataBase("mastertransaksi", "notrans", nt_46109027.Text, 1, CONECT)
If telusur.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim cup As New OleDb.OleDbCommand
cup = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_46109027.Text & "',#" & dtp_46109027.Value.Date & "#," & Val(jt_46109027.Text) & ")", CONECT)
CONECT.Open()
cup.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
cup = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & nt_46109027.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
cup.ExecuteNonQuery()
CONECT.Close()
cup.Dispose()
Next
DT.Rows.Clear()
nt_46109027.Text = ""
jt_46109027.Text = ""
End Sub
End Class
Public Class LATIHAN_036_46109053
BalasHapusDim INDAH As New OleDb.OleDbCommand
Dim YANI As New ByIskandar.CariKeDataBaseByIskandar
Dim DT As New DataTable
Dim KONEKSI As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=ngekngek")
Private Sub TAMBAH_053_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH_053.Click
If KB_053.Text.Length = 0 Then
MsgBox("Kode tsb sudah ada")
Exit Sub
End If
If Val(UNIT_053.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
If Val(HRG_053.Text) = 0 Then
MsgBox("Tolong di isi")
Exit Sub
End If
Dim ENONG As DataRow
ENONG = DT.NewRow
ENONG("KODEBARANG") = Val(KB_053.Text)
ENONG("UNIT") = Val(UNIT_053.Text)
ENONG("HARGA") = Val(HRG_053.Text)
DT.Rows.Add(ENONG)
KB_053.Text = ""
UNIT_053.Text = ""
HRG_053.Text = ""
End Sub
Private Sub LATIHAN036_053_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SILVER As New OleDb.OleDbDataAdapter
SILVER = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA from detailtransaksi where notrans = '" & NT_053.Text & "'", KONEKSI)
SILVER.Fill(DT)
SILVER.Dispose()
DATA_053.DataSource = DT
End Sub
Private Sub SIMPAN_053_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN_053.Click
If NT_053.Text.Length = 0 Then
MsgBox("isi rong No Transaksi na..")
Exit Sub
End If
If JT_053.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
YANI.AturPencarianDataBase("mastertransaksi", "notrans", NT_053.Text, 1, KONEKSI)
If YANI.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu")
Exit Sub
End If
INDAH = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT_053.Text & "',#" & TGL_053.Value.Month & "/" & TGL_053.Value.Day & "/" & TGL_053.Value.Year & "#,'" & JT_053.Text & "')", KONEKSI)
KONEKSI.Open()
INDAH.ExecuteNonQuery()
KONEKSI.Close()
For Each x As DataRow In DT.Rows
INDAH = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT_053.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", KONEKSI)
KONEKSI.Open()
INDAH.ExecuteNonQuery()
KONEKSI.Close()
Next
INDAH.Dispose()
NT_053.Text = ""
JT_053.Text = ""
DT.Rows.Clear()
End Sub
End Class
ARYANDIRA(46109034)
BalasHapusLATIHAN36_034
Public Class Latihan36_034
Dim dt As New DataTable
Dim cm As New OleDb.OleDbCommand
Dim dira As New ByIskandar.CariKeDataBaseByIskandar
Dim satu As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/datamajemuk.ACCDB")
Private Sub Latihan36_034_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_034.Text & "'", satu)
a.Fill(dt)
a.Dispose()
dgv.DataSource = dt
Dim dc(1) As DataColumn
dc(0) = dt.Columns("kodebarang")
dt.PrimaryKey = dc
End Sub
Private Sub gg_034_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gg_034.Click
If dd_034.Text.Length = 0 Then
MsgBox("Isi rong itu Kode Barang ")
Exit Sub
End If
If Val(ee_034.Text) = 0 Then
MsgBox("Isi rong itu Unit ")
Exit Sub
End If
If Val(ff_034.Text) = 0 Then
MsgBox("Isi rong itu Harga ")
Exit Sub
End If
Dim dr As DataRow
dr = dt.Rows.Find(dd_034.Text)
If dr Is Nothing Then
dr = dt.NewRow
dr("KODEBARANG") = dd_034.Text
dr("UNIT") = ee_034.Text
dr("HARGA") = ff_034.Text
dt.Rows.Add(dr)
dd_034.Text = ""
ee_034.Text = ""
ff_034.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain")
End If
End Sub
Private Sub hh_034_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hh_034.Click
If aa_034.Text.Length = 0 Then
MsgBox("Isi rong No Transaksi")
Exit Sub
End If
If cc_034.Text.Length = 0 Then
MsgBox("Isi rong Jenis Transaksi")
Exit Sub
End If
If dt.Rows.Count = 0 Then
MsgBox("Maaf...Isi rong itu datatable “)
Exit Sub
End If
dira.AturPencarianDataBase("mastertransaksi", "notrans", aa_034.Text, 1, satu)
If dira.JumlanBaris > 0 Then
MsgBox("Ada notrans seperti itu")
Exit Sub
End If
cm = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & aa_034.Text & "',#" & bb_034.Value.Month & "/" & bb_034.Value.Day & "/" & bb_034.Value.Year & "#,'" & cc_034.Text & "')", satu)
satu.Open()
cm.ExecuteNonQuery()
satu.Close()
For Each x As DataRow In dt.Rows
cm = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & aa_034.Text & "', '" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", satu)
satu.Open()
cm.ExecuteNonQuery()
satu.Close()
Next
cm.Dispose()
aa_034.Text = ""
cc_034.Text = ""
dt.Rows.Clear()
End Sub
End Class
http://cacalisa.blogspot.com/2012/11/latihan3646110038.html
BalasHapushttp://rafidashaleh.blogspot.com/2012/11/latihan3646110041.html
BalasHapushttp://mulyawarman039.blogspot.com/2012/11/latihan3646110039.html
BalasHapushttp://wahyunirachman.blogspot.com/2012/11/latihan3646110020.html
BalasHapushttp://srikartikafanty.blogspot.com/2012/11/latihan3646110007.html
BalasHapushttp://dianmegariski.blogspot.com/2012/11/latihan3646110023_2361.html
BalasHapushttp://bahrizj.blogspot.com/2012/11/latihan3646110001.html
BalasHapushttp://restyaccounting.blogspot.com/2012/11/latihan3646110027.html
BalasHapushttp://alfaega.blogspot.com/2012/11/latihan3646110022.html
BalasHapushttp://idhamsyaam.blogspot.com/2012/11/latihan3646110021.html
BalasHapushttp://sulhihusni.blogspot.com/2012/11/latihan3646110004.html
BalasHapushttp://fitrianihamka.blogspot.com/2012/11/latihan3646110006.html
BalasHapushttp://ildayani.blogspot.com/2012/11/latihan3646110002.html
BalasHapushttp://masdarwati.blogspot.com/2012/11/latihan3646110024.html
BalasHapushttp://hanihasan07.blogspot.com/2012/12/latihan3646110044.html
BalasHapushttp://bothbon.blogspot.com/2013/01/latihan3646110043.html
BalasHapushttp://muthmil8.blogspot.com/2012/11/latihan3646110037.html
BalasHapushttp://amalmaulana92.blogspot.com/2013/01/latihan3646110003.html
BalasHapushttp://feibyfrycilia.blogspot.com/2013/01/latihan3646110055.html
BalasHapushttp://diyanahdina.blogspot.com/2013/01/latihan3646110045.html
BalasHapus