Public Class Form34A Private Sub DAFTARBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG_076.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub INPUTBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG_076.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub Private Sub DAFTARBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub End Class
Public Class Form34B Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Dim datatabel1 As New DataTable
Public Sub PUTRA() Dim X As New OleDb.OleDbDataAdapter X = New OleDb.OleDbDataAdapter("Select * From BARANG", A) datatabel1.Rows.Clear() X.Fill(datatabel1) X.Dispose() End Sub
Private Sub Form34B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PUTRA() DGV_076.DataSource = datatabel1 End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click If Form34C.Visible = False Then Form34C.Show() Else Form34C.Activate() End If
Form34C.Show() Form34C.KBrg1.Text = "-" Form34C.KB_076.Text = "" Form34C.NB_076.Text = "" Form34C.HJ_076.Text = "" Form34C.JB_076.Text = "" End Sub
Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click If Form34C.Visible = False Then Form34C.Show() Else Form34C.Activate() End If
Form34C.Show() Form34C.KBrg1.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value Form34C.KB_076.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value Form34C.NB_076.Text = DGV_076.CurrentRow.Cells("Namabarang").Value Form34C.HJ_076.Text = DGV_076.CurrentRow.Cells("Hargajual").Value Form34C.JB_076.Text = DGV_076.CurrentRow.Cells("Jumlahbarang").Value End Sub
Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click Dim CM As New OleDb.OleDbCommand CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_076.CurrentRow.Cells("KODEBARANG").Value & "'", A) A.Open() CM.ExecuteNonQuery() A.Close() CM.Dispose()
Public Class Form34C Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT() If KBrg1.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If KB_076.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NB_076.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(HJ_076.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(JB_076.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1.Text <> KB_076.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_076.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CMT As New OleDb.OleDbCommand CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KB_076.Text & "', '" & NB_076.Text & "', " & Val(HJ_076.Text) & ", " & Val(JB_076.Text) & ")", A) A.Open() CMT.ExecuteNonQuery() A.Close() CMT.Dispose()
Private Sub SIMPAN_UPDATE() If KBrg1.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If KB_076.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NB_076.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(HJ_076.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(JB_076.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1.Text <> KB_076.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_076.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KB_076.Text & "', NAMABARANG= '" & NB_076.Text & "', HARGAJUAL= " & Val(HJ_076.Text) & ", JUMLAHBARANG= " & Val(JB_076.Text) & " WHERE KODEBARANG='" & KBrg1.Text & "'", A) A.Open() CME.ExecuteNonQuery() A.Close() CME.Dispose()
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click If KBrg1.Text = "-" Then SIMPAN_INSERT() Else SIMPAN_UPDATE() End If End Sub End Class
Public Class Form34A Private Sub DAFTARBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG_064.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub INPUTBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG_064.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub Private Sub DAFTARBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub
Public Class Form34C Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT() If KBrg1.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If KB_064.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NB_064.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(HJ_064.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(JB_064.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1.Text <> KB_064.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_064.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CMT As New OleDb.OleDbCommand CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KB_064.Text & "', '" & NB_064.Text & "', " & Val(HJ_064.Text) & ", " & Val(JB_064.Text) & ")", A) A.Open() CMT.ExecuteNonQuery() A.Close() CMT.Dispose()
Private Sub SIMPAN_UPDATE() If KBrg1.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If KB_064.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NB_064.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(HJ_064.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(JB_064.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1.Text <> KB_064.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_064.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KB_064.Text & "', NAMABARANG= '" & NB_064.Text & "', HARGAJUAL= " & Val(HJ_064.Text) & ", JUMLAHBARANG= " & Val(JB_064.Text) & " WHERE KODEBARANG='" & KBrg1.Text & "'", A) A.Open() CME.ExecuteNonQuery() A.Close() CME.Dispose()
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click If KBrg1.Text = "-" Then SIMPAN_INSERT() Else SIMPAN_UPDATE() End If End Sub
Private Sub DABA_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DABA_084.Click If LATIHAN034B084.Visible = False Then LATIHAN034B084.MdiParent = Me.MdiParent LATIHAN034B084.Show() Else LATIHAN034B084.Activate() End If
End Sub
Private Sub INBA_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INBA_084.Click If LATIHAN034C084.Visible = False Then LATIHAN034C084.MdiParent = Me.MdiParent LATIHAN034C084.Show() Else LATIHAN034C084.Activate() End If End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B084.Visible = False Then LATIHAN034B084.MdiParent = Me.MdiParent LATIHAN034B084.Show() Else LATIHAN034B084.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If LATIHAN034C084.Visible = False Then LATIHAN034C084.MdiParent = Me.MdiParent LATIHAN034C084.Show() Else LATIHAN034C084.Activate() End If End Sub End Class
Public Class LATIHAN034B084 Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Dim datatabel1 As New DataTable Public Sub Deriel() Dim X As New OleDb.OleDbDataAdapter X = New OleDb.OleDbDataAdapter("Select * From BARANG", A) datatabel1.Rows.Clear() X.Fill(datatabel1) X.Dispose() End Sub Private Sub LATIHAN034B084_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Deriel() dgv_084.DataSource = datatabel1 End Sub
Private Sub TAMBAH_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH_084.Click If LATIHAN034C084.Visible = False Then LATIHAN034C084.Show() Else LATIHAN034C084.Activate() End If
LATIHAN034C084.Show() LATIHAN034C084.kb1_084.Text = "-" LATIHAN034C084.kb_084.Text = "" LATIHAN034C084.nb_084.Text = "" LATIHAN034C084.hj_084.Text = "" LATIHAN034C084.jb_084.Text = "" End Sub
Private Sub EDIT_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT_084.Click If LATIHAN034C084.Visible = False Then LATIHAN034C084.Show() Else LATIHAN034C084.Activate() End If
LATIHAN034C084.Show() LATIHAN034C084.kb1_084.Text = dgv_084.CurrentRow.Cells("Kodebarang").Value LATIHAN034C084.kb_084 = dgv_084.CurrentRow.Cells("Kodebarang").Value LATIHAN034C084.nb_084.Text = dgv_084.CurrentRow.Cells("Namabarang").Value LATIHAN034C084.hj_084.Text = dgv_084.CurrentRow.Cells("Hargajual").Value LATIHAN034C084.jb_084.Text = dgv_084.CurrentRow.Cells("Jumlahbarang").Value End Sub
Private Sub HAPUS_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HAPUS_084.Click Dim CM As New OleDb.OleDbCommand CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & dgv_084.CurrentRow.Cells("KODEBARANG").Value & "'", A) A.Open() CM.ExecuteNonQuery() A.Close() CM.Dispose()
Public Class LATIHAN034C084 Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Private Sub SIMPAN_INSERT() If kb1_084.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If kb_084.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If nb_084.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(hj_084.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(jb_084.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If kb1_084.Text <> kb_084.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", kb_084.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If Dim CMT As New OleDb.OleDbCommand CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb_084.Text & "', '" & nb_084.Text & "', " & Val(hj_084.Text) & ", " & Val(jb_084.Text) & ")", A) A.Open() CMT.ExecuteNonQuery() A.Close() CMT.Dispose()
LATIHAN034B084.Deriel() End Sub Private Sub SIMPAN_UPDATE() If kb1_084.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If kb_084.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If nb_084.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(hj_084.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(jb_084.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If kb1_084.Text <> kb_084.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", kb_084.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb_084.Text & "', NAMABARANG= '" & nb_084.Text & "', HARGAJUAL= " & Val(hj_084.Text) & ", JUMLAHBARANG= " & Val(jb_084.Text) & " WHERE KODEBARANG='" & kb1_084.Text & "'", A) A.Open() CME.ExecuteNonQuery() A.Close() CME.Dispose()
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click If kb1_084.Text = "-" Then SIMPAN_INSERT() Else SIMPAN_UPDATE() End If End Sub End Class
Public Class LATIHAN034A068 Private Sub DAFTARBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG.Click If LATIHAN034B068.Visible = False Then LATIHAN034B068.MdiParent = Me.MdiParent LATIHAN034B068.Show() Else LATIHAN034B068.Activate() End If End Sub Private Sub INPUTBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG.Click If LATIHAN034C068.Visible = False Then LATIHAN034C068.MdiParent = Me.MdiParent LATIHAN034C068.Show() Else LATIHAN034C068.Activate() End If End Sub Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B068.Visible = False Then LATIHAN034B068.MdiParent = Me.MdiParent LATIHAN034B068.Show() Else LATIHAN034B068.Activate() End If End Sub Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If LATIHAN034C068.Visible = False Then LATIHAN034C068.MdiParent = Me.MdiParent LATIHAN034C068.Show() Else LATIHAN034C068.Activate() End If End Sub End Class
Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub smpn_INSERT() If kb1068.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If kb068.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If nb068.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(hj068.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(jb068.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If kb1068.Text <> kb068.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", kb068.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CMT As New OleDb.OleDbCommand CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb068.Text & "', '" & nb068.Text & "', " & Val(hj068.Text) & ", " & Val(jb068.Text) & ")", A) A.Open() CMT.ExecuteNonQuery() A.Close() CMT.Dispose()
Private Sub smpn_UPDATE() If kb1068.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If kb068.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If nb068.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(hj068.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(jb068.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If kb1068.Text <> kb068.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", kb068.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb068.Text & "', NAMABARANG= '" & nb068.Text & "', HARGAJUAL= " & Val(hj068.Text) & ", JUMLAHBARANG= " & Val(jb068.Text) & " WHERE KODEBARANG='" & kb1068.Text & "'", A) A.Open() CME.ExecuteNonQuery() A.Close() CME.Dispose()
Private Sub smpn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles smpn.Click If kb1068.Text = "-" Then smpn_INSERT() Else smpn_UPDATE() End If
Public Class Form34A Private Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel1.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub End Class
Public Class Latihan34A Private Sub DAFTARBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG_076.Click If Latihan34B.Visible = False Then Latihan34B.MdiParent = Me Latihan34B.Show() Else Latihan34B.Activate() End If End Sub
Private Sub INPUTBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG_076.Click If Latihan34C.Visible = False Then Latihan34C.MdiParent = Me.MdiParent Latihan34C.Show() Else Latihan34C.Activate() End If End Sub Private Sub DAFTARBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Latihan34B.Visible = False Then Latihan34B.MdiParent = Me Latihan34B.Show() Else Latihan34B.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Latihan34C.Visible = False Then Latihan34C.MdiParent = Me.MdiParent Latihan34C.Show() Else Latihan34C.Activate() End If End Sub End ClassPublic Class Latihan34A
Public Class Latihan34C Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT() If KBrg1.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If kb070.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If nb070.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(hj070.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(jb070.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1.Text <> kb070.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", kb070.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CMT As New OleDb.OleDbCommand CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb070.Text & "', '" & nb070.Text & "', " & Val(hj070.Text) & ", " & Val(jb070.Text) & ")", A) A.Open() CMT.ExecuteNonQuery() A.Close() CMT.Dispose()
Private Sub SIMPAN_UPDATE() If KBrg1.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If kb070.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If nb070.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(hj070.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(jb070.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1.Text <> kb070.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", kb070.Text, 1, A) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb070.Text & "', NAMABARANG= '" & nb070.Text & "', HARGAJUAL= " & Val(hj070.Text) & ", JUMLAHBARANG= " & Val(jb070.Text) & " WHERE KODEBARANG='" & KBrg1.Text & "'", A) A.Open() CME.ExecuteNonQuery() A.Close() CME.Dispose()
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click If KBrg1.Text = "-" Then SIMPAN_INSERT() Else SIMPAN_UPDATE() End If End Sub End Class
Public Class Form34A Private Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel1.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Form34B.Visible = False Then Form34B.MdiParent = Me Form34B.Show() Else Form34B.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Form34C.Visible = False Then Form34C.MdiParent = Me.MdiParent Form34C.Show() Else Form34C.Activate() End If End Sub End Class
Private Sub DAFTARBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG.Click If Latihan034B077.Visible = False Then Latihan034B077.MdiParent = Me Latihan034B077.Show() Else Latihan034B077.Activate() End If End Sub
Private Sub INPUTBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG.Click If Latihan034C077.Visible = False Then Latihan034C077.MdiParent = Me.MdiParent Latihan034C077.Show() Else Latihan034C077.Activate() End If End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Latihan034B077.Visible = False Then Latihan034B077.MdiParent = Me Latihan034B077.Show() Else Latihan034B077.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Latihan034C077.Visible = False Then Latihan034C077.MdiParent = Me.MdiParent Latihan034C077.Show() Else Latihan034C077.Activate() End If End Sub End Class
Public Class Latihan034B077 Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Dim datatabel1 As New DataTable
Public Sub ARHINA() Dim X As New OleDb.OleDbDataAdapter X = New OleDb.OleDbDataAdapter("Select * From BARANG", n) datatabel1.Rows.Clear() X.Fill(datatabel1) X.Dispose() End Sub
Private Sub Latihan034B077_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ARHINA() DGV34B.DataSource = datatabel1 End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click If Latihan034C077.Visible = False Then Latihan034C077.Show() Else Latihan034C077.Activate() End If
Latihan034C077.Show() Latihan034C077.KBrg1077.Text = "-" Latihan034C077.KBrg077.Text = "" Latihan034C077.NBrg077.Text = "" Latihan034C077.HJual077.Text = "" Latihan034C077.JBrg077.Text = "" End Sub
Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click If Latihan034C077.Visible = False Then Latihan034C077.Show() Else Latihan034C077.Activate() End If
Latihan034C077.Show() Latihan034C077.KBrg077.Text = DGV34B.CurrentRow.Cells("Kodebarang").Value Latihan034C077.NBrg077.Text = DGV34B.CurrentRow.Cells("Namabarang").Value Latihan034C077.HJual077.Text = DGV34B.CurrentRow.Cells("Hargajual").Value Latihan034C077.JBrg077.Text = DGV34B.CurrentRow.Cells("Jumlahbarang").Value End Sub
Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click Dim CM As New OleDb.OleDbCommand CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV34B.CurrentRow.Cells("KODEBARANG").Value & "'", n) n.Open() CM.ExecuteNonQuery() n.Close() CM.Dispose()
Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT() If KBrg1077.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If KBrg077.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NBrg077.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(HJual077.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(JBrg077.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1077.Text <> KBrg077.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", KBrg077.Text, 1, n) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CMT As New OleDb.OleDbCommand CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KBrg077.Text & "', '" & NBrg077.Text & "', " & Val(HJual077.Text) & ", " & Val(JBrg077.Text) & ")", n) n.Open() CMT.ExecuteNonQuery() n.Close() CMT.Dispose()
Private Sub SIMPAN_UPDATE() If KBrg1077.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If KBrg077.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If NBrg077.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(HJual077.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(JBrg077.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KBrg1077.Text <> KBrg077.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", KBrg077.Text, 1, n) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KBrg077.Text & "', NAMABARANG= '" & NBrg077.Text & "', HARGAJUAL= " & Val(HJual077.Text) & ", JUMLAHBARANG= " & Val(JBrg077.Text) & " WHERE KODEBARANG='" & KBrg1077.Text & "'", n) n.Open() CME.ExecuteNonQuery() n.Close() CME.Dispose()
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click If KBrg1077.Text = "-" Then SIMPAN_INSERT() Else SIMPAN_UPDATE() End If End Sub End Class
Public Class Form34B Dim Adhe As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Dim datatabel1 As New DataTable
Public Sub Rheza() Dim X As New OleDb.OleDbDataAdapter X = New OleDb.OleDbDataAdapter("Select * From BARANG", Adhe) datatabel1.Rows.Clear() X.Fill(datatabel1) X.Dispose() End Sub
Private Sub Form34B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Rheza() DGV_082.DataSource = datatabel1 End Sub
Private Sub Tambah_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah_082.Click If Form34C.Visible = False Then Form34C.Show() Else Form34C.Activate() End If
Form34C.Show() Form34C.KB_082.Text = "-" Form34C.Kode_Barang_082.Text = "" Form34C.Nama_Barang_082.Text = "" Form34C.Harga_Jual_082.Text = "" Form34C.Jumlah_Barang_082.Text = "" End Sub
Private Sub Edit_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit_082.Click If Form34C.Visible = False Then Form34C.Show() Else Form34C.Activate() End If
Form34C.Show() Form34C.KB_082.Text = DGV_082.CurrentRow.Cells("Kodebarang").Value Form34C.Kode_Barang_082.Text = DGV_082.CurrentRow.Cells("Kodebarang").Value Form34C.Nama_Barang_082.Text = DGV_082.CurrentRow.Cells("Namabarang").Value Form34C.Harga_Jual_082.Text = DGV_082.CurrentRow.Cells("Hargajual").Value Form34C.Jumlah_Barang_082.Text = DGV_082.CurrentRow.Cells("Jumlahbarang").Value End Sub
Private Sub Hapus_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus_082.Click Dim CM As New OleDb.OleDbCommand CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_082.CurrentRow.Cells("KODEBARANG").Value & "'", Adhe) Adhe.Open() CM.ExecuteNonQuery() Adhe.Close() CM.Dispose()
Private Sub Save_082_UPDATE() If KB_082.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If Kode_Barang_082.Text.Length = 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If
If Nama_Barang_082.Text.Length = 0 Then MsgBox("Nama barang sudah ada") Exit Sub End If
If Val(Harga_Jual_082.Text) = 0 Then MsgBox("Harga jual sudah ada") Exit Sub End If
If Val(Jumlah_Barang_082.Text) = 0 Then MsgBox("Jumlah barang sudah ada") Exit Sub End If
If KB_082.Text <> Kode_Barang_082.Text Then Dim pencari As New ByIskandar.CariKeDataBaseByIskandar pencari.AturPencarianDataBase("Barang", "Kodebarang", Kode_Barang_082.Text, 1, Adhe) If pencari.JumlanBaris > 0 Then MsgBox("Kode barang sudah ada") Exit Sub End If End If
Dim CME As New OleDb.OleDbCommand CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & Kode_Barang_082.Text & "', NAMABARANG= '" & Nama_Barang_082.Text & "', HARGAJUAL= " & Val(Harga_Jual_082.Text) & ", JUMLAHBARANG= " & Val(Jumlah_Barang_082.Text) & " WHERE KODEBARANG='" & KB_082.Text & "'", Adhe) Adhe.Open() CME.ExecuteNonQuery() Adhe.Close() CME.Dispose()
Private Sub Save_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save_082.Click If KB_082.Text = "-" Then Save_082_INSERT() Else Save_082_UPDATE() End If End Sub
Private Sub Form34C_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Public Class Latihan34B Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Dim datatabel1 As New DataTable
Public Sub by() Dim X As New OleDb.OleDbDataAdapter X = New OleDb.OleDbDataAdapter("Select * From BARANG", A) datatabel1.Rows.Clear() X.Fill(datatabel1) X.Dispose() End Sub
Private Sub Latihan34B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load by() DGV_076.DataSource = datatabel1 End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click If Latihan34C.Visible = False Then Latihan34C.Show() Else Latihan34C.Activate() End If
Latihan34C.Show() Latihan34C.KBrg1.Text = "-" Latihan34C.kb070.Text = "" Latihan34C.nb070.Text = "" Latihan34C.hj070.Text = "" Latihan34C.jb070.Text = "" End Sub
Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click If Latihan34C.Visible = False Then Latihan34C.Show() Else Latihan34C.Activate() End If
Latihan34C.Show() Latihan34C.KBrg1.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value Latihan34C.kb070.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value Latihan34C.nb070.Text = DGV_076.CurrentRow.Cells("Namabarang").Value Latihan34C.hj070.Text = DGV_076.CurrentRow.Cells("Hargajual").Value Latihan34C.jb070.Text = DGV_076.CurrentRow.Cells("Jumlahbarang").Value End Sub
Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click Dim CM As New OleDb.OleDbCommand CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_076.CurrentRow.Cells("KODEBARANG").Value & "'", A) A.Open() CM.ExecuteNonQuery() A.Close() CM.Dispose()
Private Sub TSL1_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL1_071.Click If Latihan34B_071.Visible = False Then Latihan34B_071.MdiParent = Me Latihan34B_071.Show() Else Latihan34B_071.Activate() End If
End Sub
Private Sub TSL2_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL2_071.Click If Latihan34C_071.Visible = False Then Latihan34C_071.MdiParent = Me Latihan34C_071.Show() Else Latihan34C_071.Activate() End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If Latihan34B_071.Visible = False Then Latihan34B_071.MdiParent = Me Latihan34B_071.Show() Else Latihan34B_071.Activate() End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If Latihan34C_071.Visible = False Then Latihan34C_071.MdiParent = Me Latihan34C_071.Show() Else Latihan34C_071.Activate() End If
Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB") Dim take As New DataTable Public Sub ambildata() 'mendeklarasikan adapter Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut data = New OleDb.OleDbDataAdapter("SELECT* from barang", go)
'bersihkan data sebelum mengisi data lain take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view data.Fill(take) data.Dispose() End Sub
Private Sub Latihan34B_071_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DGV_071.DataSource = take
End Sub
Private Sub Delete_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Delete_071.Click If MsgBox("are you serious??? do you want to delete the record???", MsgBoxStyle.YesNo) = MsgBoxResult.No Then Exit Sub End If
'deklarasi object command Dim cm As New OleDb.OleDbCommand cm = New OleDb.OleDbCommand("delete * from barang where kodebarang ='" & DGV_071.CurrentRow.Cells("kodebarang").Value & "'", go) go.Open() cm.ExecuteNonQuery() go.Close() cm.Dispose()
'mengambil data kembali ambildata()
End Sub
Private Sub Edit_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit_071.Click 'menampilkan form 34b If Latihan34C_071.Visible = False Then Latihan34C_071.MdiParent = Me.MdiParent Latihan34C_071.Show() Else Latihan34C_071.Activate() End If
'mengisi textbox yang ada pada 31b Latihan34C_071.Trio_071.Text = DGV_071.CurrentRow.Cells("kodebarang").Value Latihan34C_071.kb_071.Text = DGV_071.CurrentRow.Cells("kodebarang").Value Latihan34C_071.nb_071.Text = DGV_071.CurrentRow.Cells("namabarang").Value Latihan34C_071.hj_071.Text = DGV_071.CurrentRow.Cells("hargajual").Value Latihan34C_071.jb_071.Text = DGV_071.CurrentRow.Cells("jumlahbarang").Value
End Sub
Private Sub Add_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add_071.Click 'menampilkan form 33b If Latihan34C_071.Visible = False Then Latihan34C_071.MdiParent = Me.MdiParent Latihan34C_071.Show() Else Latihan34C_071.Activate() End If
'mengisi textbox yang ada pada 31b Latihan34C_071.Trio_071.Text = "-" Latihan34C_071.kb_071.Text = "" Latihan34C_071.nb_071.Text = "" Latihan34C_071.hj_071.Text = "" Latihan34C_071.jb_071.Text = ""
Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB") Private Sub tambah() 'deklarasi object command Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb_071.Text & "','" & nb_071.Text & "', " & Val(hj_071.Text) & "," & Val(jb_071.Text) & ")", go) go.Open() Cm.ExecuteNonQuery() go.Close() Cm.Dispose()
'mengambildata Latihan34B_071.ambildata() End Sub Private Sub ganti() 'deklarasi object command Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("Update BARANG set kodebarang ='" & kb_071.Text & "', namabarang = '" & nb_071.Text & "', hargajual=" & Val(hj_071.Text) & ", jumlahbarang=" & Val(jb_071.Text) & " where kodebarang='" & Trio_071.Text & "'", go) go.Open() Cm.ExecuteNonQuery() go.Close() Cm.Dispose()
'mengambildata Latihan34B_071.ambildata() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'perintah periksa data If kb_071.Text.Length = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
If nb_071.Text.Length = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
If Val(hj_071.Text) = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
If Val(jb_071.Text) = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
'perintah ambil data Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", kb_071.Text, 1, go)
If PENCARI.JumlanBaris > 0 Then MsgBox("The data has been exist please insert new data")
'mengosongkan text box kb_071.Text = "" nb_071.Text = "" hj_071.Text = "" jb_071.Text = "" Exit Sub End If
If Trio_071.Text = "-" Then tambah() Else ganti() End If
Komentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class Form34A
BalasHapusPrivate Sub DAFTARBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG_076.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub INPUTBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG_076.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
End Class
Public Class Form34B
BalasHapusDim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Dim datatabel1 As New DataTable
Public Sub PUTRA()
Dim X As New OleDb.OleDbDataAdapter
X = New OleDb.OleDbDataAdapter("Select * From BARANG", A)
datatabel1.Rows.Clear()
X.Fill(datatabel1)
X.Dispose()
End Sub
Private Sub Form34B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PUTRA()
DGV_076.DataSource = datatabel1
End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click
If Form34C.Visible = False Then
Form34C.Show()
Else
Form34C.Activate()
End If
Form34C.Show()
Form34C.KBrg1.Text = "-"
Form34C.KB_076.Text = ""
Form34C.NB_076.Text = ""
Form34C.HJ_076.Text = ""
Form34C.JB_076.Text = ""
End Sub
Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click
If Form34C.Visible = False Then
Form34C.Show()
Else
Form34C.Activate()
End If
Form34C.Show()
Form34C.KBrg1.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value
Form34C.KB_076.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value
Form34C.NB_076.Text = DGV_076.CurrentRow.Cells("Namabarang").Value
Form34C.HJ_076.Text = DGV_076.CurrentRow.Cells("Hargajual").Value
Form34C.JB_076.Text = DGV_076.CurrentRow.Cells("Jumlahbarang").Value
End Sub
Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click
Dim CM As New OleDb.OleDbCommand
CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_076.CurrentRow.Cells("KODEBARANG").Value & "'", A)
A.Open()
CM.ExecuteNonQuery()
A.Close()
CM.Dispose()
PUTRA()
End Sub
End Class
Public Class Form34C
BalasHapusDim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT()
If KBrg1.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If KB_076.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NB_076.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(HJ_076.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(JB_076.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1.Text <> KB_076.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_076.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CMT As New OleDb.OleDbCommand
CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KB_076.Text & "', '" & NB_076.Text & "', " & Val(HJ_076.Text) & ", " & Val(JB_076.Text) & ")", A)
A.Open()
CMT.ExecuteNonQuery()
A.Close()
CMT.Dispose()
KBrg1.Text = "-"
KB_076.Text = ""
NB_076.Text = ""
HJ_076.Text = ""
JB_076.Text = ""
Form34B.PUTRA()
End Sub
Private Sub SIMPAN_UPDATE()
If KBrg1.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If KB_076.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NB_076.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(HJ_076.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(JB_076.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1.Text <> KB_076.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_076.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KB_076.Text & "', NAMABARANG= '" & NB_076.Text & "', HARGAJUAL= " & Val(HJ_076.Text) & ", JUMLAHBARANG= " & Val(JB_076.Text) & " WHERE KODEBARANG='" & KBrg1.Text & "'", A)
A.Open()
CME.ExecuteNonQuery()
A.Close()
CME.Dispose()
KBrg1.Text = "-"
KB_076.Text = ""
NB_076.Text = ""
HJ_076.Text = ""
JB_076.Text = ""
Form34B.PUTRA()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
If KBrg1.Text = "-" Then
SIMPAN_INSERT()
Else
SIMPAN_UPDATE()
End If
End Sub
End Class
feby winriani syam
BalasHapusPublic Class Form34A
Private Sub DAFTARBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG_064.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub INPUTBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG_064.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
End Class
feby windriani syam
BalasHapusPublic Class Form34C
Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT()
If KBrg1.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If KB_064.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NB_064.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(HJ_064.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(JB_064.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1.Text <> KB_064.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_064.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CMT As New OleDb.OleDbCommand
CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KB_064.Text & "', '" & NB_064.Text & "', " & Val(HJ_064.Text) & ", " & Val(JB_064.Text) & ")", A)
A.Open()
CMT.ExecuteNonQuery()
A.Close()
CMT.Dispose()
KBrg1.Text = "-"
KB_064.Text = ""
NB_064.Text = ""
HJ_064.Text = ""
JB_064.Text = ""
Form34B.feby()
End Sub
Private Sub SIMPAN_UPDATE()
If KBrg1.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If KB_064.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NB_064.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(HJ_064.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(JB_064.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1.Text <> KB_064.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", KB_064.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KB_064.Text & "', NAMABARANG= '" & NB_064.Text & "', HARGAJUAL= " & Val(HJ_064.Text) & ", JUMLAHBARANG= " & Val(JB_064.Text) & " WHERE KODEBARANG='" & KBrg1.Text & "'", A)
A.Open()
CME.ExecuteNonQuery()
A.Close()
CME.Dispose()
KBrg1.Text = "-"
KB_064.Text = ""
NB_064.Text = ""
HJ_064.Text = ""
JB_064.Text = ""
Form34B.feby()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
If KBrg1.Text = "-" Then
SIMPAN_INSERT()
Else
SIMPAN_UPDATE()
End If
End Sub
End Class
FITRAH ADITYA H
BalasHapusPublic Class LATIHAN034A084
Private Sub DABA_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DABA_084.Click
If LATIHAN034B084.Visible = False Then
LATIHAN034B084.MdiParent = Me.MdiParent
LATIHAN034B084.Show()
Else
LATIHAN034B084.Activate()
End If
End Sub
Private Sub INBA_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INBA_084.Click
If LATIHAN034C084.Visible = False Then
LATIHAN034C084.MdiParent = Me.MdiParent
LATIHAN034C084.Show()
Else
LATIHAN034C084.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B084.Visible = False Then
LATIHAN034B084.MdiParent = Me.MdiParent
LATIHAN034B084.Show()
Else
LATIHAN034B084.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C084.Visible = False Then
LATIHAN034C084.MdiParent = Me.MdiParent
LATIHAN034C084.Show()
Else
LATIHAN034C084.Activate()
End If
End Sub
End Class
Public Class LATIHAN034B084
Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Dim datatabel1 As New DataTable
Public Sub Deriel()
Dim X As New OleDb.OleDbDataAdapter
X = New OleDb.OleDbDataAdapter("Select * From BARANG", A)
datatabel1.Rows.Clear()
X.Fill(datatabel1)
X.Dispose()
End Sub
Private Sub LATIHAN034B084_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Deriel()
dgv_084.DataSource = datatabel1
End Sub
Private Sub TAMBAH_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TAMBAH_084.Click
If LATIHAN034C084.Visible = False Then
LATIHAN034C084.Show()
Else
LATIHAN034C084.Activate()
End If
LATIHAN034C084.Show()
LATIHAN034C084.kb1_084.Text = "-"
LATIHAN034C084.kb_084.Text = ""
LATIHAN034C084.nb_084.Text = ""
LATIHAN034C084.hj_084.Text = ""
LATIHAN034C084.jb_084.Text = ""
End Sub
Private Sub EDIT_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT_084.Click
If LATIHAN034C084.Visible = False Then
LATIHAN034C084.Show()
Else
LATIHAN034C084.Activate()
End If
LATIHAN034C084.Show()
LATIHAN034C084.kb1_084.Text = dgv_084.CurrentRow.Cells("Kodebarang").Value
LATIHAN034C084.kb_084 = dgv_084.CurrentRow.Cells("Kodebarang").Value
LATIHAN034C084.nb_084.Text = dgv_084.CurrentRow.Cells("Namabarang").Value
LATIHAN034C084.hj_084.Text = dgv_084.CurrentRow.Cells("Hargajual").Value
LATIHAN034C084.jb_084.Text = dgv_084.CurrentRow.Cells("Jumlahbarang").Value
End Sub
Private Sub HAPUS_084_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HAPUS_084.Click
Dim CM As New OleDb.OleDbCommand
CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & dgv_084.CurrentRow.Cells("KODEBARANG").Value & "'", A)
A.Open()
CM.ExecuteNonQuery()
A.Close()
CM.Dispose()
Deriel()
End Sub
End Class
Public Class LATIHAN034C084
BalasHapusDim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT()
If kb1_084.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If kb_084.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If nb_084.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(hj_084.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(jb_084.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If kb1_084.Text <> kb_084.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", kb_084.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CMT As New OleDb.OleDbCommand
CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb_084.Text & "', '" & nb_084.Text & "', " & Val(hj_084.Text) & ", " & Val(jb_084.Text) & ")", A)
A.Open()
CMT.ExecuteNonQuery()
A.Close()
CMT.Dispose()
kb1_084.Text = "-"
kb_084.Text = ""
nb_084.Text = ""
hj_084.Text = ""
jb_084.Text = ""
LATIHAN034B084.Deriel()
End Sub
Private Sub SIMPAN_UPDATE()
If kb1_084.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If kb_084.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If nb_084.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(hj_084.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(jb_084.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If kb1_084.Text <> kb_084.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", kb_084.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb_084.Text & "', NAMABARANG= '" & nb_084.Text & "', HARGAJUAL= " & Val(hj_084.Text) & ", JUMLAHBARANG= " & Val(jb_084.Text) & " WHERE KODEBARANG='" & kb1_084.Text & "'", A)
A.Open()
CME.ExecuteNonQuery()
A.Close()
CME.Dispose()
kb1_084.Text = "-"
kb_084.Text = ""
nb_084.Text = ""
hj_084.Text = ""
jb_084.Text = ""
LATIHAN034B084.Deriel()
End Sub
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click
If kb1_084.Text = "-" Then
SIMPAN_INSERT()
Else
SIMPAN_UPDATE()
End If
End Sub
End Class
Public Class LATIHAN034A068
BalasHapusPrivate Sub DAFTARBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG.Click
If LATIHAN034B068.Visible = False Then
LATIHAN034B068.MdiParent = Me.MdiParent
LATIHAN034B068.Show()
Else
LATIHAN034B068.Activate()
End If
End Sub
Private Sub INPUTBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG.Click
If LATIHAN034C068.Visible = False Then
LATIHAN034C068.MdiParent = Me.MdiParent
LATIHAN034C068.Show()
Else
LATIHAN034C068.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B068.Visible = False Then
LATIHAN034B068.MdiParent = Me.MdiParent
LATIHAN034B068.Show()
Else
LATIHAN034B068.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C068.Visible = False Then
LATIHAN034C068.MdiParent = Me.MdiParent
LATIHAN034C068.Show()
Else
LATIHAN034C068.Activate()
End If
End Sub
End Class
Public Class LATIHAN034C068
BalasHapusDim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub smpn_INSERT()
If kb1068.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If kb068.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If nb068.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(hj068.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(jb068.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If kb1068.Text <> kb068.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", kb068.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CMT As New OleDb.OleDbCommand
CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb068.Text & "', '" & nb068.Text & "', " & Val(hj068.Text) & ", " & Val(jb068.Text) & ")", A)
A.Open()
CMT.ExecuteNonQuery()
A.Close()
CMT.Dispose()
kb1068.Text = "-"
kb068.Text = ""
nb068.Text = ""
hj068.Text = ""
jb068.Text = ""
LATIHAN034B068.asni()
End Sub
Private Sub smpn_UPDATE()
If kb1068.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If kb068.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If nb068.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(hj068.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(jb068.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If kb1068.Text <> kb068.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", kb068.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb068.Text & "', NAMABARANG= '" & nb068.Text & "', HARGAJUAL= " & Val(hj068.Text) & ", JUMLAHBARANG= " & Val(jb068.Text) & " WHERE KODEBARANG='" & kb1068.Text & "'", A)
A.Open()
CME.ExecuteNonQuery()
A.Close()
CME.Dispose()
kb1068.Text = "-"
kb068.Text = ""
nb068.Text = ""
hj068.Text = ""
jb068.Text = ""
LATIHAN034B068.asni()
End Sub
Private Sub smpn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles smpn.Click
If kb1068.Text = "-" Then
smpn_INSERT()
Else
smpn_UPDATE()
End If
End Sub
End Class
Public Class Form34A
BalasHapusPrivate Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel1.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class Latihan34A
BalasHapusPrivate Sub DAFTARBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG_076.Click
If Latihan34B.Visible = False Then
Latihan34B.MdiParent = Me
Latihan34B.Show()
Else
Latihan34B.Activate()
End If
End Sub
Private Sub INPUTBARANG_076_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG_076.Click
If Latihan34C.Visible = False Then
Latihan34C.MdiParent = Me.MdiParent
Latihan34C.Show()
Else
Latihan34C.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Latihan34B.Visible = False Then
Latihan34B.MdiParent = Me
Latihan34B.Show()
Else
Latihan34B.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Latihan34C.Visible = False Then
Latihan34C.MdiParent = Me.MdiParent
Latihan34C.Show()
Else
Latihan34C.Activate()
End If
End Sub
End ClassPublic Class Latihan34A
End Class
Public Class Latihan34C
BalasHapusDim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT()
If KBrg1.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If kb070.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If nb070.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(hj070.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(jb070.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1.Text <> kb070.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", kb070.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CMT As New OleDb.OleDbCommand
CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb070.Text & "', '" & nb070.Text & "', " & Val(hj070.Text) & ", " & Val(jb070.Text) & ")", A)
A.Open()
CMT.ExecuteNonQuery()
A.Close()
CMT.Dispose()
KBrg1.Text = "-"
kb070.Text = ""
nb070.Text = ""
hj070.Text = ""
jb070.Text = ""
Latihan34B.by()
End Sub
Private Sub SIMPAN_UPDATE()
If KBrg1.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If kb070.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If nb070.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(hj070.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(jb070.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1.Text <> kb070.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", kb070.Text, 1, A)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb070.Text & "', NAMABARANG= '" & nb070.Text & "', HARGAJUAL= " & Val(hj070.Text) & ", JUMLAHBARANG= " & Val(jb070.Text) & " WHERE KODEBARANG='" & KBrg1.Text & "'", A)
A.Open()
CME.ExecuteNonQuery()
A.Close()
CME.Dispose()
KBrg1.Text = "-"
kb070.Text = ""
nb070.Text = ""
hj070.Text = ""
jb070.Text = ""
Latihan34B.by()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
If KBrg1.Text = "-" Then
SIMPAN_INSERT()
Else
SIMPAN_UPDATE()
End If
End Sub
End Class
Public Class Form34A
BalasHapusPrivate Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel1.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Form34B.Visible = False Then
Form34B.MdiParent = Me
Form34B.Show()
Else
Form34B.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Form34C.Visible = False Then
Form34C.MdiParent = Me.MdiParent
Form34C.Show()
Else
Form34C.Activate()
End If
End Sub
End Class
Muhammad Nur
BalasHapusPublic Class Latihan034A077
Private Sub DAFTARBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANG.Click
If Latihan034B077.Visible = False Then
Latihan034B077.MdiParent = Me
Latihan034B077.Show()
Else
Latihan034B077.Activate()
End If
End Sub
Private Sub INPUTBARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANG.Click
If Latihan034C077.Visible = False Then
Latihan034C077.MdiParent = Me.MdiParent
Latihan034C077.Show()
Else
Latihan034C077.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Latihan034B077.Visible = False Then
Latihan034B077.MdiParent = Me
Latihan034B077.Show()
Else
Latihan034B077.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Latihan034C077.Visible = False Then
Latihan034C077.MdiParent = Me.MdiParent
Latihan034C077.Show()
Else
Latihan034C077.Activate()
End If
End Sub
End Class
Public Class Latihan034B077
Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Dim datatabel1 As New DataTable
Public Sub ARHINA()
Dim X As New OleDb.OleDbDataAdapter
X = New OleDb.OleDbDataAdapter("Select * From BARANG", n)
datatabel1.Rows.Clear()
X.Fill(datatabel1)
X.Dispose()
End Sub
Private Sub Latihan034B077_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ARHINA()
DGV34B.DataSource = datatabel1
End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click
If Latihan034C077.Visible = False Then
Latihan034C077.Show()
Else
Latihan034C077.Activate()
End If
Latihan034C077.Show()
Latihan034C077.KBrg1077.Text = "-"
Latihan034C077.KBrg077.Text = ""
Latihan034C077.NBrg077.Text = ""
Latihan034C077.HJual077.Text = ""
Latihan034C077.JBrg077.Text = ""
End Sub
Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click
If Latihan034C077.Visible = False Then
Latihan034C077.Show()
Else
Latihan034C077.Activate()
End If
Latihan034C077.Show()
Latihan034C077.KBrg077.Text = DGV34B.CurrentRow.Cells("Kodebarang").Value
Latihan034C077.NBrg077.Text = DGV34B.CurrentRow.Cells("Namabarang").Value
Latihan034C077.HJual077.Text = DGV34B.CurrentRow.Cells("Hargajual").Value
Latihan034C077.JBrg077.Text = DGV34B.CurrentRow.Cells("Jumlahbarang").Value
End Sub
Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click
Dim CM As New OleDb.OleDbCommand
CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV34B.CurrentRow.Cells("KODEBARANG").Value & "'", n)
n.Open()
CM.ExecuteNonQuery()
n.Close()
CM.Dispose()
ARHINA()
End Sub
End Class
Public Class Latihan034C077
BalasHapusDim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN_INSERT()
If KBrg1077.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If KBrg077.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NBrg077.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(HJual077.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(JBrg077.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1077.Text <> KBrg077.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", KBrg077.Text, 1, n)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CMT As New OleDb.OleDbCommand
CMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KBrg077.Text & "', '" & NBrg077.Text & "', " & Val(HJual077.Text) & ", " & Val(JBrg077.Text) & ")", n)
n.Open()
CMT.ExecuteNonQuery()
n.Close()
CMT.Dispose()
KBrg1077.Text = "-"
KBrg077.Text = ""
NBrg077.Text = ""
HJual077.Text = ""
JBrg077.Text = ""
Latihan034B077.ARHINA()
End Sub
Private Sub SIMPAN_UPDATE()
BalasHapusIf KBrg1077.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If KBrg077.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If NBrg077.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(HJual077.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(JBrg077.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KBrg1077.Text <> KBrg077.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", KBrg077.Text, 1, n)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KBrg077.Text & "', NAMABARANG= '" & NBrg077.Text & "', HARGAJUAL= " & Val(HJual077.Text) & ", JUMLAHBARANG= " & Val(JBrg077.Text) & " WHERE KODEBARANG='" & KBrg1077.Text & "'", n)
n.Open()
CME.ExecuteNonQuery()
n.Close()
CME.Dispose()
KBrg1077.Text = "-"
KBrg077.Text = ""
NBrg077.Text = ""
HJual077.Text = ""
JBrg077.Text = ""
Latihan034B077.ARHINA()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
If KBrg1077.Text = "-" Then
SIMPAN_INSERT()
Else
SIMPAN_UPDATE()
End If
End Sub
End Class
Public Class Form34B
BalasHapusDim Adhe As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Dim datatabel1 As New DataTable
Public Sub Rheza()
Dim X As New OleDb.OleDbDataAdapter
X = New OleDb.OleDbDataAdapter("Select * From BARANG", Adhe)
datatabel1.Rows.Clear()
X.Fill(datatabel1)
X.Dispose()
End Sub
Private Sub Form34B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Rheza()
DGV_082.DataSource = datatabel1
End Sub
Private Sub Tambah_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah_082.Click
If Form34C.Visible = False Then
Form34C.Show()
Else
Form34C.Activate()
End If
Form34C.Show()
Form34C.KB_082.Text = "-"
Form34C.Kode_Barang_082.Text = ""
Form34C.Nama_Barang_082.Text = ""
Form34C.Harga_Jual_082.Text = ""
Form34C.Jumlah_Barang_082.Text = ""
End Sub
Private Sub Edit_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit_082.Click
If Form34C.Visible = False Then
Form34C.Show()
Else
Form34C.Activate()
End If
Form34C.Show()
Form34C.KB_082.Text = DGV_082.CurrentRow.Cells("Kodebarang").Value
Form34C.Kode_Barang_082.Text = DGV_082.CurrentRow.Cells("Kodebarang").Value
Form34C.Nama_Barang_082.Text = DGV_082.CurrentRow.Cells("Namabarang").Value
Form34C.Harga_Jual_082.Text = DGV_082.CurrentRow.Cells("Hargajual").Value
Form34C.Jumlah_Barang_082.Text = DGV_082.CurrentRow.Cells("Jumlahbarang").Value
End Sub
Private Sub Hapus_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus_082.Click
Dim CM As New OleDb.OleDbCommand
CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_082.CurrentRow.Cells("KODEBARANG").Value & "'", Adhe)
Adhe.Open()
CM.ExecuteNonQuery()
Adhe.Close()
CM.Dispose()
Rheza()
End Sub
End Class
Dim CMT As New OleDb.OleDbCommand
BalasHapusCMT = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & Kode_barang_082.Text & "', '" & Nama_Barang_082.Text & "', " & Val(Harga_Jual_082.Text) & ", " & Val(Jumlah_Barang.Text) & ")", Adhe)
Adhe.Open()
CMT.ExecuteNonQuery()
Adhe.Close()
CMT.Dispose()
KB_082.Text = "-"
Kode_Barang_082.Text = ""
Nama_Barang_082.Text = ""
Harga_Jual_082.Text = ""
Jumlah_Barang_082.Text = ""
Form34B.Rheza()
End Sub
Private Sub Save_082_UPDATE()
If KB_082.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If Kode_Barang_082.Text.Length = 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
If Nama_Barang_082.Text.Length = 0 Then
MsgBox("Nama barang sudah ada")
Exit Sub
End If
If Val(Harga_Jual_082.Text) = 0 Then
MsgBox("Harga jual sudah ada")
Exit Sub
End If
If Val(Jumlah_Barang_082.Text) = 0 Then
MsgBox("Jumlah barang sudah ada")
Exit Sub
End If
If KB_082.Text <> Kode_Barang_082.Text Then
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
pencari.AturPencarianDataBase("Barang", "Kodebarang", Kode_Barang_082.Text, 1, Adhe)
If pencari.JumlanBaris > 0 Then
MsgBox("Kode barang sudah ada")
Exit Sub
End If
End If
Dim CME As New OleDb.OleDbCommand
CME = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & Kode_Barang_082.Text & "', NAMABARANG= '" & Nama_Barang_082.Text & "', HARGAJUAL= " & Val(Harga_Jual_082.Text) & ", JUMLAHBARANG= " & Val(Jumlah_Barang_082.Text) & " WHERE KODEBARANG='" & KB_082.Text & "'", Adhe)
Adhe.Open()
CME.ExecuteNonQuery()
Adhe.Close()
CME.Dispose()
KB_082.Text = "-"
Kode_Barang_082.Text = ""
Nama_Barang_082.Text = ""
Harga_Jual_082.Text = ""
Jumlah_Barang_082.Text = ""
Form34B.Rheza()
End Sub
Private Sub Save_082_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save_082.Click
If KB_082.Text = "-" Then
Save_082_INSERT()
Else
Save_082_UPDATE()
End If
End Sub
Private Sub Form34C_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Public Class Latihan34B
BalasHapusDim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Dim datatabel1 As New DataTable
Public Sub by()
Dim X As New OleDb.OleDbDataAdapter
X = New OleDb.OleDbDataAdapter("Select * From BARANG", A)
datatabel1.Rows.Clear()
X.Fill(datatabel1)
X.Dispose()
End Sub
Private Sub Latihan34B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
by()
DGV_076.DataSource = datatabel1
End Sub
Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click
If Latihan34C.Visible = False Then
Latihan34C.Show()
Else
Latihan34C.Activate()
End If
Latihan34C.Show()
Latihan34C.KBrg1.Text = "-"
Latihan34C.kb070.Text = ""
Latihan34C.nb070.Text = ""
Latihan34C.hj070.Text = ""
Latihan34C.jb070.Text = ""
End Sub
Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click
If Latihan34C.Visible = False Then
Latihan34C.Show()
Else
Latihan34C.Activate()
End If
Latihan34C.Show()
Latihan34C.KBrg1.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value
Latihan34C.kb070.Text = DGV_076.CurrentRow.Cells("Kodebarang").Value
Latihan34C.nb070.Text = DGV_076.CurrentRow.Cells("Namabarang").Value
Latihan34C.hj070.Text = DGV_076.CurrentRow.Cells("Hargajual").Value
Latihan34C.jb070.Text = DGV_076.CurrentRow.Cells("Jumlahbarang").Value
End Sub
Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click
Dim CM As New OleDb.OleDbCommand
CM = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_076.CurrentRow.Cells("KODEBARANG").Value & "'", A)
A.Open()
CM.ExecuteNonQuery()
A.Close()
CM.Dispose()
by()
End Sub
End Class
Public Class Latihan34A_071
BalasHapusPrivate Sub TSL1_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL1_071.Click
If Latihan34B_071.Visible = False Then
Latihan34B_071.MdiParent = Me
Latihan34B_071.Show()
Else
Latihan34B_071.Activate()
End If
End Sub
Private Sub TSL2_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL2_071.Click
If Latihan34C_071.Visible = False Then
Latihan34C_071.MdiParent = Me
Latihan34C_071.Show()
Else
Latihan34C_071.Activate()
End If
End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If Latihan34B_071.Visible = False Then
Latihan34B_071.MdiParent = Me
Latihan34B_071.Show()
Else
Latihan34B_071.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If Latihan34C_071.Visible = False Then
Latihan34C_071.MdiParent = Me
Latihan34C_071.Show()
Else
Latihan34C_071.Activate()
End If
End Sub
End Class
Public Class Latihan34B_071
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB")
Dim take As New DataTable
Public Sub ambildata()
'mendeklarasikan adapter
Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut
data = New OleDb.OleDbDataAdapter("SELECT* from barang", go)
'bersihkan data sebelum mengisi data lain
take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view
data.Fill(take)
data.Dispose()
End Sub
Private Sub Latihan34B_071_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DGV_071.DataSource = take
End Sub
Private Sub Delete_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Delete_071.Click
If MsgBox("are you serious??? do you want to delete the record???", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Exit Sub
End If
'deklarasi object command
Dim cm As New OleDb.OleDbCommand
cm = New OleDb.OleDbCommand("delete * from barang where kodebarang ='" & DGV_071.CurrentRow.Cells("kodebarang").Value & "'", go)
go.Open()
cm.ExecuteNonQuery()
go.Close()
cm.Dispose()
'mengambil data kembali
ambildata()
End Sub
Private Sub Edit_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit_071.Click
'menampilkan form 34b
If Latihan34C_071.Visible = False Then
Latihan34C_071.MdiParent = Me.MdiParent
Latihan34C_071.Show()
Else
Latihan34C_071.Activate()
End If
'mengisi textbox yang ada pada 31b
Latihan34C_071.Trio_071.Text = DGV_071.CurrentRow.Cells("kodebarang").Value
Latihan34C_071.kb_071.Text = DGV_071.CurrentRow.Cells("kodebarang").Value
Latihan34C_071.nb_071.Text = DGV_071.CurrentRow.Cells("namabarang").Value
Latihan34C_071.hj_071.Text = DGV_071.CurrentRow.Cells("hargajual").Value
Latihan34C_071.jb_071.Text = DGV_071.CurrentRow.Cells("jumlahbarang").Value
End Sub
Private Sub Add_071_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add_071.Click
'menampilkan form 33b
If Latihan34C_071.Visible = False Then
Latihan34C_071.MdiParent = Me.MdiParent
Latihan34C_071.Show()
Else
Latihan34C_071.Activate()
End If
'mengisi textbox yang ada pada 31b
Latihan34C_071.Trio_071.Text = "-"
Latihan34C_071.kb_071.Text = ""
Latihan34C_071.nb_071.Text = ""
Latihan34C_071.hj_071.Text = ""
Latihan34C_071.jb_071.Text = ""
End Sub
End Class
Public Class Latihan34C_071
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB")
Private Sub tambah()
'deklarasi object command
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & kb_071.Text & "','" & nb_071.Text & "', " & Val(hj_071.Text) & "," & Val(jb_071.Text) & ")", go)
go.Open()
Cm.ExecuteNonQuery()
go.Close()
Cm.Dispose()
'mengambildata
Latihan34B_071.ambildata()
End Sub
Private Sub ganti()
'deklarasi object command
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("Update BARANG set kodebarang ='" & kb_071.Text & "', namabarang = '" & nb_071.Text & "', hargajual=" & Val(hj_071.Text) & ", jumlahbarang=" & Val(jb_071.Text) & " where kodebarang='" & Trio_071.Text & "'", go)
go.Open()
Cm.ExecuteNonQuery()
go.Close()
Cm.Dispose()
'mengambildata
Latihan34B_071.ambildata()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'perintah periksa data
If kb_071.Text.Length = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
If nb_071.Text.Length = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
If Val(hj_071.Text) = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
If Val(jb_071.Text) = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
'perintah ambil data
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", kb_071.Text, 1, go)
If PENCARI.JumlanBaris > 0 Then
MsgBox("The data has been exist please insert new data")
'mengosongkan text box
kb_071.Text = ""
nb_071.Text = ""
hj_071.Text = ""
jb_071.Text = ""
Exit Sub
End If
If Trio_071.Text = "-" Then
tambah()
Else
ganti()
End If
'mengosongkan text box
kb_071.Text = ""
nb_071.Text = ""
hj_071.Text = ""
jb_071.Text = ""
'menutup form
Me.Close()
End Sub
End Class