Jumat, 04 November 2011

Latihan 34 Apkom 4 D3 A

19 komentar:

  1. maaf Pak script ku yang tidak ada di blog Bapak,lebih lanjutnya ada di blog ridhacayoo-ridhaahmad.blogspot.com
    terima Kasih Pak...^_^

    BalasHapus
  2. Public Class form34a_36109003

    Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If form34b_36109003.Visible = False Then
    form34b_36109003.MdiParent = Me
    form34b_36109003.Show()
    Else
    form34b_36109003.Activate()
    End If
    End Sub

    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If form34c_36109003.Visible = False Then
    form34c_36109003.MdiParent = Me
    form34c_36109003.Show()
    Else
    form34c_36109003.Activate()
    End If
    End Sub

    Private Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel1.Click
    If form34b_36109003.Visible = False Then
    form34b_36109003.MdiParent = Me
    form34b_36109003.Show()
    Else
    form34b_36109003.Activate()
    End If
    End Sub

    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If form34c_36109003.Visible = False Then
    form34c_36109003.MdiParent = Me
    form34c_36109003.Show()
    Else
    form34c_36109003.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  3. Public NotInheritable Class form34c_36109003
    Dim arman As New ByIskandar.CariKeDataBaseByIskandar
    Dim anto As New OleDb.OleDbCommand
    Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If kbl_36109003.Text = "" Then
    arman.AturPencarianDataBase("Barang", "KodeBarang", kb_36109003.Text, 1, ndut)
    If arman.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    kb_36109003.Text = ""
    Exit Sub
    ElseIf kb_36109003.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_36109003.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_36109003.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_36109003.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim soe As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_36109003.Text & "','" & nb_36109003.Text & "'," & Val(hj_36109003.Text) & "," & Val(jb_36109003.Text) & ")"
    anto = New OleDb.OleDbCommand(soe, ndut)
    ndut.Open()
    anto.ExecuteNonQuery()
    ndut.Close()
    anto.Dispose()
    kb_36109003.Text = ""
    nb_36109003.Text = ""
    hj_36109003.Text = ""
    jb_36109003.Text = ""
    Else
    If kbl_36109003.Text <> kb_36109003.Text Then
    arman.AturPencarianDataBase("Barang", "KodeBarang", kb_36109003.Text, 1, ndut)
    If arman.JumlanBaris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If kb_36109003.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_36109003.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_36109003.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_36109003.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim soe As String = "update barang set kodebarang = '" & kb_36109003.Text & "', namabarang = '" & nb_36109003.Text & "', hargajual = " & Val(hj_36109003.Text) & ", jumlahbarang = " & Val(jb_36109003.Text) & " where kodebarang = '" & kbl_36109003.Text & "'"
    anto = New OleDb.OleDbCommand(soe, ndut)
    ndut.Open()
    anto.ExecuteNonQuery()
    ndut.Close()
    anto.Dispose()
    kbl_36109003.Text = "-"
    kb_36109003.Text = ""
    nb_36109003.Text = ""
    hj_36109003.Text = ""
    jb_36109003.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  4. RUSNANINGSI R
    36109010

    http://rusnaningsi.blogspot.com/2011/11/latihan-31-33-apkom-4.html

    BalasHapus
  5. Ismi Febriani Asyikin
    3a D3
    361 09 005

    Public Class Latihan34A_36109005
    Private Sub DATABARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If Latihan34B_36109005.Visible = False Then
    Latihan34B_36109005.MdiParent = Me
    Latihan34B_36109005.Show()
    Else
    Latihan34B_36109005.Activate()
    End If
    End Sub
    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If Latihan34C_36109005.Visible = False Then
    Latihan34C_36109005.MdiParent = Me
    Latihan34C_36109005.Show()
    Else
    Latihan34C_36109005.Activate()
    End If

    End Sub
    Private Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel1.Click
    If Latihan34B_36109005.Visible = False Then
    Latihan34B_36109005.MdiParent = Me
    Latihan34B_36109005.Show()
    Else
    Latihan34B_36109005.Activate()
    End If

    End Sub
    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If Latihan34C_36109005.Visible = False Then
    Latihan34C_36109005.MdiParent = Me
    Latihan34C_36109005.Show()
    Else
    Latihan34C_36109005.Activate()
    End If
    End Sub
    End Class
    ................................
    Public Class Latihan34B_36109005
    Dim DT As New DataTable
    Dim CM As New OleDb.OleDbCommand
    Dim MM As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Private Sub T_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T_36109005.Click
    If Latihan34C_36109005.Visible = False Then
    Latihan34C_36109005.Show()
    Else
    Latihan34C_36109005.Activate()
    End If
    End Sub
    Private Sub E_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E_36109005.Click
    If Latihan34C_36109005.Visible = False Then
    Latihan34C_36109005.Show()
    Else
    Latihan34C_36109005.Activate()
    End If
    Latihan34C_36109005.t1_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
    Latihan34C_36109005.t2_36109005.Text = DGV_36109005.CurrentRow.Cells("namabarang").Value
    Latihan34C_36109005.t3_36109005.Text = DGV_36109005.CurrentRow.Cells("hargajual").Value
    Latihan34C_36109005.t4_36109005.Text = DGV_36109005.CurrentRow.Cells("jumlahbarang").Value
    Latihan34C_36109005.KB_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
    End Sub
    Private Sub H_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles H_36109005.Click
    Dim ICHMI As String = "delete * from barang where kodebarang = '" & DGV_36109005.CurrentRow.Cells("kodebarang").Value & "'"
    CM = New OleDb.OleDbCommand(ICHMI, MM)
    MM.Open()
    CM.ExecuteNonQuery()
    MM.Close()
    CM.Dispose()

    Dim MILK As New OleDb.OleDbDataAdapter
    MILK = New OleDb.OleDbDataAdapter("select * from barang", MM)
    DT.Rows.Clear()
    MILK.Fill(DT)
    MILK.Dispose()
    DGV_36109005.DataSource = DT
    End Sub
    Private Sub Latihan34B_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim MILK As New OleDb.OleDbDataAdapter
    MILK = New OleDb.OleDbDataAdapter("Select * from barang", MM)
    DT.Rows.Clear()
    MILK.Fill(DT)
    MILK.Dispose()
    DGV_36109005.DataSource = DT
    End Sub
    End Class

    BalasHapus
  6. Ismi Febriani Asyikin
    3a D3
    361 09 005

    Public Class Latihan34C_36109005
    Dim ISMI As New ByIskandar.CariKeDataBaseByIskandar
    Dim OD As New OleDb.OleDbCommand
    Dim DB As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
    If KB_36109005.Text = "" Then
    ISMI.AturPencarianDataBase("Barang", "KodeBArang", t1_36109005.Text, 1, DB)
    If ISMI.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    t1_36109005.Text = ""
    Exit Sub
    ElseIf t1_36109005.Text.Length = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    ElseIf t2_36109005.Text.Length = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    ElseIf t3_36109005.Text.Length = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    ElseIf t4_36109005.Text.Length = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    End If

    Dim ICHMI As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1_36109005.Text & "','" & t2_36109005.Text & "'," & Val(t3_36109005.Text) & "," & Val(t4_36109005.Text) & ")"
    OD = New OleDb.OleDbCommand(ICHMI, DB)
    DB.Open()
    OD.ExecuteNonQuery()
    DB.Close()
    OD.Dispose()
    t1_36109005.Text = ""
    t2_36109005.Text = ""
    t3_36109005.Text = ""
    t4_36109005.Text = ""
    Else
    If KB_36109005.Text <> t1_36109005.Text Then
    ISMI.AturPencarianDataBase("Barang", "KodeBarang", t1_36109005.Text, 1, DB)
    If ISMI.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If
    If t1_36109005.Text.Length = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    ElseIf t2_36109005.Text.Length = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    ElseIf Val(t3_36109005.Text) = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    ElseIf Val(t4_36109005.Text) = 0 Then
    MsgBox("Kode barang harus ada")
    Exit Sub
    End If

    Dim ICHMI As String = "update barang set kodebarang = '" & t1_36109005.Text & "', namabarang = '" & t2_36109005.Text & "', hargajual = " & Val(t3_36109005.Text) & ", jumlahbarang = " & Val(t4_36109005.Text) & " where kodebarang = '" & KB_36109005.Text & "'"
    OD = New OleDb.OleDbCommand(ICHMI, DB)
    DB.Open()
    OD.ExecuteNonQuery()
    DB.Close()
    OD.Dispose()
    KB_36109005.Text = "-"
    t1_36109005.Text = ""
    t2_36109005.Text = ""
    t3_36109005.Text = ""
    t4_36109005.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  7. ALWIYAH
    3A-D3 / 36109009

    http://alwiyah-chucha.blogspot.com/2011/11/latihanform34.html

    Terima Kasih Pak

    BalasHapus
  8. Amelia Indahsari
    361 09 023

    http://heiamee.blogspot.com/2011/12/form-34.html

    BalasHapus
  9. http://vievhy.blogspot.com/2011/12/form-31-34.html

    BalasHapus
  10. HASTUTI
    36109016


    FORM34-C
    Public Class Form34_C
    Dim uthi As New ByIskandar.CariKeDataBaseByIskandar
    Dim cm As New OleDb.OleDbCommand
    Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

    Private Sub simpan36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan36109016.Click
    If KB36109016.Text = "" Then
    uthi.AturPencarianDataBase("Barang", "KodeBarang", kode36109016.Text, 1, ak)
    If uthi.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    kode36109016.Text = ""
    Exit Sub
    ElseIf kode36109016.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nama36109016.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf harga36109016.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jumlah36109016.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim soe As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kode36109016.Text & "','" & nama36109016.Text & "'," & Val(harga36109016.Text) & "," & Val(jumlah36109016.Text) & ")"
    cm = New OleDb.OleDbCommand(soe, ak)
    ak.Open()
    cm.ExecuteNonQuery()
    ak.Close()
    cm.Dispose()
    kode36109016.Text = "-"
    nama36109016.Text = ""
    harga36109016.Text = ""
    jumlah36109016.Text = ""
    Else
    If KB36109016.Text <> kode36109016.Text Then
    uthi.AturPencarianDataBase("Barang", "KodeBarang", kode36109016.Text, 1, ak)
    If uthi.JumlanBaris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If kode36109016.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nama36109016.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf harga36109016.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jumlah36109016.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim edir As String = "update barang set kodebarang = '" & kode36109016.Text & "', namabarang = '" & nama36109016.Text & "', hargajual = " & Val(harga36109016.Text) & ", jumlahbarang = " & Val(jumlah36109016.Text) & " where kodebarang = '" & KB36109016.Text & "'"
    cm = New OleDb.OleDbCommand(edir, ak)
    ak.Open()
    cm.ExecuteNonQuery()
    ak.Close()
    cm.Dispose()
    KB36109016.Text = "-"
    kode36109016.Text = ""
    nama36109016.Text = ""
    harga36109016.Text = ""
    jumlah36109016.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  11. Public Class Form34A_36109001

    Private Sub DaftarBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If Form34B_36109001.Visible = False Then
    Form34B_36109001.MdiParent = Me
    Form34B_36109001.Show()
    Else
    Form34B_36109001.Activate()
    End If
    End Sub
    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
    If Form34B_36109001.Visible = False Then
    Form34B_36109001.MdiParent = Me
    Form34B_36109001.Show()
    Else
    Form34B_36109001.Activate()
    End If
    End Sub

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
    If Form34C_36109001.Visible = False Then
    Form34C_36109001.MdiParent = Me
    Form34C_36109001.Show()
    Else
    Form34C_36109001.Activate()
    End If
    End Sub
    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If Form34C_36109001.Visible = False Then
    Form34C_36109001.MdiParent = Me
    Form34C_36109001.Show()
    Else
    Form34C_36109001.Activate()
    End If
    End Sub

    Private Sub Form34A_36109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
    End Class

    BalasHapus
  12. Public Class Form34B_36109001
    Dim dt As New DataTable
    Dim rr As New OleDb.OleDbCommand
    Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ABUTTON1_36109001DB")

    Public Sub apreal()
    Dim apr As New OleDb.OleDbDataAdapter
    apr = New OleDb.OleDbDataAdapter("select * from barang", imps)
    dt.Rows.Clear()
    apr.Fill(dt)
    apr.Dispose()
    End Sub

    Private Sub Form34B_36109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    apreal()
    dgv.DataSource = dt
    End Sub

    Private Sub Button2_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2_36109001.Click
    If Form34C_36109001.Visible = False Then
    Form34C_36109001.MdiParent = Me.MdiParent
    Form34C_36109001.Show()
    Else
    Form34C_36109001.Activate()
    End If

    Form34C_36109001.kb_36109001.Text = ""
    Form34C_36109001.nb_36109001.Text = ""
    Form34C_36109001.hj_36109001.Text = ""
    Form34C_36109001.jb_36109001.Text = ""
    Form34C_36109001.Button1.Text = "-"
    End Sub

    Private Sub Button1_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_36109001.Click
    If Form34C_36109001.Visible = False Then
    Form34C_36109001.MdiParent = Me.MdiParent
    Form34C_36109001.Show()
    Else
    Form34C_36109001.Activate()
    End If

    Form34C_36109001.kb_36109001.Text = dgv.CurrentRow.Cells("kodebarang").Value
    Form34C_36109001.nb_36109001.Text = dgv.CurrentRow.Cells("namabarang").Value
    Form34C_36109001.hj_36109001.Text = dgv.CurrentRow.Cells("hargajual").Value
    Form34C_36109001.jb_36109001.Text = dgv.CurrentRow.Cells("jumlahbarang").Value
    Form34C_36109001.kbl_36109001.Text = dgv.CurrentRow.Cells("kodebarang").Value

    Form34C_36109001.Show()
    End Sub

    Private Sub Button3_36109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3_36109001.Click
    rr = New OleDb.OleDbCommand("delete * from barang where kodebarang = '" & dgv.CurrentRow.Cells("kodebarang").Value & "'", imps)
    imps.Open()
    rr.ExecuteNonQuery()
    imps.Close()
    rr.Dispose()

    apreal()
    End Sub
    End Class

    BalasHapus
  13. ANDI WAHYUNI
    361 09 019
    http://wahyunistrongggg.blogspot.com/2011/11/latihan-33-34.html

    BalasHapus
  14. http://febriantysuryaningtyas.blogspot.com/2011/12/latihan-34.html

    BalasHapus
  15. Public Class Form34C_36109001
    Dim apreal As New ByIskandar.CariKeDataBaseByIskandar
    Dim rr As New OleDb.OleDbCommand
    Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.AHJ_36109001DB")

    Private Sub indonesia()
    If kb_36109001.Text.Length = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

    If nb_36109001.Text.Length = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

    If Val(hj_36109001.Text) = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

    If Val(jb_36109001.Text) = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If
    End Sub

    Private Sub tambah()
    indonesia()
    apreal.AturPencarianDataBase("Barang", "KodeBarang", kb_36109001.Text, 1, imps)
    If apreal.JumlanBaris > 0 Then
    MsgBox("Adami kode barang seperti itu")
    Exit Sub
    End If

    rr = New OleDb.OleDbCommand("insert into barang(kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_36109001.Text & "','" & nb_36109001.Text & "'," & Val(hj_36109001.Text) & "," & Val(jb_36109001.Text) & ")", imps)
    imps.Open()
    rr.ExecuteNonQuery()
    imps.Close()
    rr.Dispose()

    kb_36109001.Text = ""
    nb_36109001.Text = ""
    hj_36109001.Text = ""
    jb_36109001.Text = ""

    Form34B_36109001.apreal()
    End Sub

    Private Sub edit()
    indonesia()
    If kb_36109001.Text <> kbl_36109001.Text Then
    apreal.AturPencarianDataBase("Barang", "KodeBarang", kb_36109001.Text, 1, imps)
    If apreal.JumlanBaris > 0 Then
    MsgBox("Adami kode barang seperti itu")
    Exit Sub
    End If
    End If

    rr = New OleDb.OleDbCommand("update barang set kodebarang = '" & kb_36109001.Text & "', namabarang = '" & nb_36109001.Text & "', hargajual = " & Val(hj_36109001.Text) & ", jumlahbarang = " & Val(jb_36109001.Text) & " where kodebarang = '" & kbl_36109001.Text & "'", imps)
    imps.Open()
    rr.ExecuteNonQuery()
    imps.Close()
    rr.Dispose()

    kb_36109001.Text = ""
    nb_36109001.Text = ""
    hj_36109001.Text = ""
    jb_36109001.Text = ""
    kbl_36109001.Text = "-"

    Form34B_36109001.apreal()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If kbl_36109001.Text = "-" Then
    tambah()
    Else
    edit()
    End If
    End Sub

    Private Sub Form34C_36109001_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
    End Class

    BalasHapus
  16. iwan
    361 09 026
    3A-D3


    http://iwandinejad.blogspot.com/#!/2012/01/latihan34a34b34c.html

    BalasHapus
  17. Muhammad Harun Hamid
    361 09 006

    Public Class Form34A_36109006
    Private Sub DaftarBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If Form34B_36109006.Visible = False Then
    Form34B_36109006.MdiParent = Me
    Form34B_36109006.Show()
    Else
    Form34B_36109006.Activate()
    End If
    End Sub
    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
    If Form34B_36109006.Visible = False Then
    Form34B_36109006.MdiParent = Me
    Form34B_36109006.Show()
    Else
    Form34B_36109006.Activate()
    End If
    End Sub

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
    If Form34C_36109006.Visible = False Then
    Form34C_36109006.MdiParent = Me
    Form34C_36109006.Show()
    Else
    Form34C_36109006.Activate()
    End If
    End Sub
    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If Form34C_36109006.Visible = False Then
    Form34C_36109006.MdiParent = Me
    Form34C_36109006.Show()
    Else
    Form34C_36109006.Activate()
    End If
    End Sub

    Private Sub Form34A_36109006_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub


    End Class

    BalasHapus
  18. Public Class Form34B_36109006
    Dim sekum006 As New DataTable
    Dim rr As New OleDb.OleDbCommand
    Dim mhh As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ABUTTON1_36109006DB")

    Public Sub harun006()
    Dim muhharun As New OleDb.OleDbDataAdapter
    muhharun = New OleDb.OleDbDataAdapter("select * from barang", mhh)
    sekum006.Rows.Clear()
    muhharun.Fill(sekum006)
    muhharun.Dispose()
    End Sub

    Private Sub Form34B_36109006_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    harun006()
    dgv.DataSource = sekum006
    End Sub

    Private Sub Button2_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2_36109006.Click
    If Form34C_36109006.Visible = False Then
    Form34C_36109006.MdiParent = Me.MdiParent
    Form34C_36109006.Show()
    Else
    Form34C_36109006.Activate()
    End If

    Form34C_36109006.kb_36109006.Text = ""
    Form34C_36109006.nb_36109006.Text = ""
    Form34C_36109006.hj_36109006.Text = ""
    Form34C_36109006.jb_36109006.Text = ""
    Form34C_36109006.Button1.Text = "-"
    End Sub

    Private Sub Button1_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_36109006.Click
    If Form34C_36109006.Visible = False Then
    Form34C_36109006.MdiParent = Me.MdiParent
    Form34C_36109006.Show()
    Else
    Form34C_36109006.Activate()
    End If

    Form34C_36109006.kb_36109006.Text = dgv.CurrentRow.Cells("kodebarang").Value
    Form34C_36109006.nb_36109006.Text = dgv.CurrentRow.Cells("namabarang").Value
    Form34C_36109006.hj_36109006.Text = dgv.CurrentRow.Cells("hargajual").Value
    Form34C_36109006.jb_36109006.Text = dgv.CurrentRow.Cells("jumlahbarang").Value
    Form34C_36109006.kbl_36109006.Text = dgv.CurrentRow.Cells("kodebarang").Value

    Form34C_36109006.Show()
    End Sub

    Private Sub Button3_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3_36109006.Click
    rr = New OleDb.OleDbCommand("delete * from barang where kodebarang = '" & dgv.CurrentRow.Cells("kodebarang").Value & "'", mhh)
    mhh.Open()
    rr.ExecuteNonQuery()
    mhh.Close()
    rr.Dispose()

    harun006()
    End Sub

    End Class

    BalasHapus
  19. Public Class Form34C_36109006
    Dim harun As New ByIskandar.CariKeDataBaseByIskandar
    Dim rr As New OleDb.OleDbCommand
    Dim hma006 As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.AHJ_36109006DB")

    Private Sub indonesia()
    If kb_36109006.Text.Length = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If

    If nb_36109006.Text.Length = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If

    If Val(hj_36109006.Text) = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If

    If Val(jb_36109006.Text) = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If
    End Sub

    Private Sub tambah()
    indonesia()
    harun.AturPencarianDataBase("Barang", "KodeBarang", kb_36109006.Text, 1, hma006)
    If harun.JumlanBaris > 0 Then
    MsgBox("Adami kode barang seperti itu")
    Exit Sub
    End If

    rr = New OleDb.OleDbCommand("insert into barang(kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_36109006.Text & "','" & nb_36109006.Text & "'," & Val(hj_36109006.Text) & "," & Val(jb_36109006.Text) & ")", hma006)
    hma006.Open()
    rr.ExecuteNonQuery()
    hma006.Close()
    rr.Dispose()

    kb_36109006.Text = ""
    nb_36109006.Text = ""
    hj_36109006.Text = ""
    jb_36109006.Text = ""

    Form34B_36109006.harun006()
    End Sub

    Private Sub edit()
    indonesia()
    If kb_36109006.Text <> kbl_36109006.Text Then
    harun.AturPencarianDataBase("Barang", "KodeBarang", kb_36109006.Text, 1, hma006)
    If harun.JumlanBaris > 0 Then
    MsgBox("Adami kode barang seperti itu")
    Exit Sub
    End If
    End If

    rr = New OleDb.OleDbCommand("update barang set kodebarang = '" & kb_36109006.Text & "', namabarang = '" & nb_36109006.Text & "', hargajual = " & Val(hj_36109006.Text) & ", jumlahbarang = " & Val(jb_36109006.Text) & " where kodebarang = '" & kbl_36109006.Text & "'", hma006)
    hma006.Open()
    rr.ExecuteNonQuery()
    hma006.Close()
    rr.Dispose()

    kb_36109006.Text = ""
    nb_36109006.Text = ""
    hj_36109006.Text = ""
    jb_36109006.Text = ""
    kbl_36109006.Text = "-"

    Form34B_36109006.harun006()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If kbl_36109006.Text = "-" Then
    tambah()
    Else
    edit()
    End If
    End Sub

    Private Sub Form34C_36109006_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
    End Class

    BalasHapus