Jumat, 04 November 2011

Latihan 31 Apkom 4 D3 A

13 komentar:

  1. Public NotInheritable Class form31a_36109003
    Dim anto As New DataTable
    Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub edit_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109003.Click
    If form31b_36109003.Visible = False Then
    form31b_36109003.Show()
    Else
    form31b_36109003.Activate()
    End If
    form31b_36109003.kbl_36109003.Text = dgv_36109003.CurrentRow.Cells("kodebarang").Value
    form31b_36109003.kb_36109003.Text = dgv_36109003.CurrentRow.Cells("kodebarang").Value
    form31b_36109003.nb_36109003.Text = dgv_36109003.CurrentRow.Cells("namabarang").Value
    form31b_36109003.jb_36109003.Text = dgv_36109003.CurrentRow.Cells("jumlahbarang").Value
    form31b_36109003.hj_36109003.Text = dgv_36109003.CurrentRow.Cells("hargajual").Value
    End Sub

    Private Sub form31a_36109003_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select * from barang", ndut)
    anto.Rows.Clear()
    adapter.Fill(anto)
    adapter.Dispose()
    dgv_36109003.DataSource = anto
    End Sub
    End Class


    Public NotInheritable Class form31b_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 <> 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 Sub

    BalasHapus
  2. RUSNANINGSI R
    36109010

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

    BalasHapus
  3. amelia indahsari
    361 09 023

    http://heiamee.blogspot.com/2011/11/form-31.html

    BalasHapus
  4. Ismi Febriani Ayikin
    361 09 005
    3a D3

    Latihan 31A

    Public Class Latihan31A_36109005
    Dim DT As New DataTable
    Dim HP As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub ISMI()
    Dim AD As New OleDb.OleDbDataAdapter
    AD = New OleDb.OleDbDataAdapter("select * from barang", HP)
    DT.Rows.Clear()
    AD.Fill(DT)
    AD.Dispose()
    End Sub
    Private Sub Latihan31A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ISMI()
    DGV_36109005.DataSource = DT
    End Sub
    Private Sub EDIT_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT_36109005.Click
    If Latihan31B_36109005.Visible = False Then
    Latihan31B_36109005.Show()
    Else
    Latihan31B_36109005.Activate()
    End If

    Latihan31B_36109005.KB_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
    Latihan31B_36109005.t1_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
    Latihan31B_36109005.t2_36109005.Text = DGV_36109005.CurrentRow.Cells("namabarang").Value
    Latihan31B_36109005.t3_36109005.Text = DGV_36109005.CurrentRow.Cells("hargajual").Value
    Latihan31B_36109005.t4_36109005.Text = DGV_36109005.CurrentRow.Cells("jumlahbarang").Value

    Latihan31B_36109005.Show()
    End Sub
    End Class
    Latihan 31B
    Public Class Latihan31B_36109005
    Dim ISMI As New ByIskandar.CariKeDataBaseByIskandar
    Dim CM As New OleDb.OleDbCommand
    Dim MISCOL 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 t1_36109005.Text.Length = 0 Then
    MsgBox("Masukkan teks")
    Exit Sub
    End If

    If t2_36109005.Text.Length = 0 Then
    MsgBox("Masukkan teks")
    Exit Sub
    End If

    If Val(t3_36109005.Text) = 0 Then
    MsgBox("Masukkan teks")
    Exit Sub
    End If

    If Val(t4_36109005.Text) = 0 Then
    MsgBox("Masukkan teks")
    Exit Sub
    End If

    If t1_36109005.Text <> KB_36109005.Text Then
    ISMI.AturPencarianDataBase("Barang", "KodeBarang", t1_36109005.Text, 1, MISCOL)
    If ISMI.JumlanBaris > 0 Then
    MsgBox("Kode Barang Sudah Ada")
    Exit Sub
    End If
    End If

    CM = New OleDb.OleDbCommand("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 & "'", MISCOL)

    MISCOL.Open()
    CM.ExecuteNonQuery()
    MISCOL.Close()
    CM.Dispose()

    t1_36109005.Text = ""
    t2_36109005.Text = ""
    t3_36109005.Text = ""
    t4_36109005.Text = ""
    KB_36109005.Text = "-"

    Latihan31A_36109005.ISMI()
    End Sub
    End Class

    BalasHapus
  5. Public Class Form31A
    Dim DIEGO As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.ACCDB")
    Dim SHARAPOVA As New DataTable

    Private Sub EDIT014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT014.Click
    If Form31B.Visible = False Then
    Form31B.Show()
    Else
    Form31B.Activate()
    End If

    Form31B.KBL014.Text = DGV014.CurrentRow.Cells("KODEBARANG").Value
    Form31B.KB014.Text = DGV014.CurrentRow.Cells("KODEBARANG").Value
    Form31B.NB014.Text = DGV014.CurrentRow.Cells("NAMABARANG").Value
    Form31B.HJ014.Text = DGV014.CurrentRow.Cells("HARGAJUAL").Value
    Form31B.JB014.Text = DGV014.CurrentRow.Cells("JUMLAHBARANG").Value

    End Sub

    Private Sub Form31A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    XXX()
    DGV014.DataSource = SHARAPOVA
    End Sub
    Public Sub XXX()
    Dim ADAPTER As New OleDb.OleDbDataAdapter
    ADAPTER = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", DIEGO)
    SHARAPOVA.Rows.Clear()

    ADAPTER.Fill(SHARAPOVA)
    ADAPTER.Dispose()
    End Sub
    End Class

    BalasHapus
  6. Public Class Form31B
    Dim DIEGO As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.ACCDB")


    Private Sub SIMPAN014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN014.Click
    If KB014.Text.Length = 0 Then
    MsgBox("MASUKKAN KODE BARANG")
    Exit Sub
    End If

    If NB014.Text.Length = 0 Then
    MsgBox("MASUKKAN NAMA BARANG")
    Exit Sub
    End If

    If Val(HJ014.Text) = 0 Then
    MsgBox("MASUKKAN HARGA JUAL")
    Exit Sub
    End If

    If Val(JB014.Text) = 0 Then
    MsgBox("MASUKKAN JUMLAH BARANG")
    Exit Sub
    End If

    Dim XXX As New ByIskandar.CariKeDataBaseByIskandar
    XXX.AturPencarianDataBase("BARANG", "KODEBARANG", KB014.Text, 1, DIEGO)
    If XXX.JumlanBaris > 0 Then
    MsgBox(" KODE BARANG SUDAH ADA")
    Exit Sub
    End If

    Dim ABC As New OleDb.OleDbCommand
    ABC = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG = '" & KB014.Text & "', NAMABARANG = '" & NB014.Text & "', HARGAJUAL = " & Val(HJ014.Text) & ", JUMLAHBARANG = " & Val(JB014.Text) & " WHERE KODEBARANG = '" & KBL014.Text & "'", DIEGO)

    DIEGO.Open()
    ABC.ExecuteNonQuery()
    DIEGO.Close()

    KBL014.Text = "-"
    KB014.Text = ""
    NB014.Text = ""
    HJ014.Text = ""
    JB014.Text = ""

    Form31A.XXX()
    End Sub
    End Class

    BalasHapus
  7. http://uphy-iftah.blogspot.com/search/label/apkom4

    BalasHapus
  8. HASTUTI
    36109016


    FORM31-A
    Public Class Form31_A
    Dim poltek As New DataTable
    Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

    Public Sub faisal()
    Dim a As New OleDb.OleDbDataAdapter
    a = New OleDb.OleDbDataAdapter("select * from barang", ak)
    poltek.Rows.Clear()
    a.Fill(poltek)
    a.Dispose()
    End Sub
    Private Sub Form31_A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    faisal()
    dgv36109016.DataSource = poltek
    End Sub

    Private Sub edit36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit36109016.Click
    If Form31_B.Visible = False Then
    Form31_B.Show()
    Else
    Form31_B.Activate()
    End If

    Form31_B.kode36109016.Text = dgv36109016.CurrentRow.Cells("kodebarang").Value
    Form31_B.nama36109016.Text = dgv36109016.CurrentRow.Cells("namabarang").Value
    Form31_B.harga36109016.Text = dgv36109016.CurrentRow.Cells("hargajual").Value
    Form31_B.jumlah36109016.Text = dgv36109016.CurrentRow.Cells("jumlahbarang").Value
    Form31_B.KB36109016.Text = dgv36109016.CurrentRow.Cells("kodebarang").Value

    Form31_B.Show()
    End Sub
    End Class





    FORM31-B
    Public Class Form31_B
    Dim uthi As New ByIskandar.CariKeDataBaseByIskandar
    Dim poltek 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 kode36109016.Text.Length = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

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

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

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

    uthi.AturPencarianDataBase("Barang", "KodeBarang", kode36109016.Text, 1, ak)
    If uthi.JumlanBaris > 0 Then
    MsgBox("Adami kode barang seperti itu")
    Exit Sub
    End If

    poltek = New OleDb.OleDbCommand("insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kode36109016.Text & "','" & nama36109016.Text & "'," & Val(harga36109016.Text) & "," & Val(jumlah36109016.Text) & ")", ak)
    ak.Open()
    poltek.ExecuteNonQuery()
    ak.Close()
    poltek.Dispose()

    kode36109016.Text = ""
    nama36109016.Text = ""
    harga36109016.Text = ""
    jumlah36109016.Text = ""


    End Sub
    End Class

    BalasHapus
  9. Public Class Form31A_36109001
    Dim rr As New DataTable
    Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

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

    Private Sub Form_31A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    apreal()
    dgv_36109001.DataSource = rr
    End Sub

    Private Sub aa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles aa_36109001.Click
    If Form31B_36109001.Visible = False Then
    Form31B_36109001.Show()
    Else
    Form31B_36109001.Activate()
    End If

    Form31B_36109001.aa_36109001.Text = dgv_36109001.CurrentRow.Cells("kodebarang").Value
    Form31B_36109001.bb_36109001.Text = dgv_36109001.CurrentRow.Cells("namabarang").Value
    Form31B_36109001.cc_36109001.Text = dgv_36109001.CurrentRow.Cells("hargajual").Value
    Form31B_36109001.dd_36109001.Text = dgv_36109001.CurrentRow.Cells("jumlahbarang").Value
    Form31B_36109001.ee.Text = dgv_36109001.CurrentRow.Cells("kodebarang").Value

    Form31B_36109001.Show()
    End Sub
    End Class

    Public Class Form31B_36109001
    Dim apreal As New ByIskandar.CariKeDataBaseByIskandar
    Dim cm As New OleDb.OleDbCommand
    Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

    Private Sub ff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ff_36109001.Click
    If aa_36109001.Text.Length = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

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

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

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

    If aa_36109001.Text <> ee.Text Then
    apreal.AturPencarianDataBase("Barang", "KodeBarang", aa_36109001.Text, 1, imps)
    If apreal.JumlanBaris > 0 Then
    MsgBox("Adami kode barang seperti itu")
    Exit Sub
    End If
    End If

    cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & aa_36109001.Text & "', namabarang = '" & bb_36109001.Text & "', hargajual = " & Val(cc_36109001.Text) & ", jumlahbarang = " & Val(dd_36109001.Text) & " where kodebarang = '" & ee.Text & "'", imps)

    imps.Open()
    cm.ExecuteNonQuery()
    imps.Close()
    cm.Dispose()

    aa_36109001.Text = ""
    bb_36109001.Text = ""
    cc_36109001.Text = ""
    dd_36109001.Text = ""
    ee.Text = "-"

    Form31A_36109001.apreal()
    End Sub

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

    End Sub
    End Class

    BalasHapus
  10. Public Class Form31A_36109006
    Dim rr As New DataTable
    Dim harun36109006 As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

    Public Sub muhharun()
    Dim hrun As New OleDb.OleDbDataAdapter
    hrun = New OleDb.OleDbDataAdapter("select * from barang", harun36109006)
    rr.Rows.Clear()
    hrun.Fill(rr)
    hrun.Dispose()
    End Sub

    Private Sub Form_31A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    muhharun()
    dgv_36109006.DataSource = rr
    End Sub

    Private Sub edit_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109006.Click
    If Form31B_36109006.Visible = False Then
    Form31B_36109006.Show()
    Else
    Form31B_36109006.Activate()
    End If

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

    Form31B_36109006.Show()
    End Sub
    End Class

    BalasHapus
  11. Public Class Form31B_36109006
    Dim muhharun36109006 As New ByIskandar.CariKeDataBaseByIskandar
    Dim cm As New OleDb.OleDbCommand
    Dim hrun36109006 As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

    Private Sub simpan_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109006.Click
    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

    If kb_36109006.Text <> kbl_36109006.Text Then
    muhharun36109006.AturPencarianDataBase("Barang", "KodeBarang", kb_36109006.Text, 1, hrun36109006)
    If muhharun36109006.JumlanBaris > 0 Then
    MsgBox("kode barang sudah ada")
    Exit Sub
    End If
    End If

    cm = 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 & "'", hrun36109006)

    hrun36109006.Open()
    cm.ExecuteNonQuery()
    hrun36109006.Close()
    cm.Dispose()

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

    Form31A_36109006.muhharun()
    End Sub

    End Class

    BalasHapus
  12. ANDI WAHYUNI
    361 09 019
    http://wahyunistrongggg.blogspot.com/2011/11/latihan-27-32.html

    BalasHapus
  13. iwan
    361 09 026
    3a-d3

    http://iwandinejad.blogspot.com/#!/2012/01/latihan-31a-dan-31b-apkom4.html

    BalasHapus