Jumat, 04 November 2011

Latihan 28 Apkom 4 D3 A

Silahkan kumpul disini

13 komentar:

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

    Public Sub arman()
    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
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If form28b_36109003.Visible = False Then
    form28b_36109003.Show()
    Else
    form28b_36109003.Activate()
    End If
    End Sub

    Private Sub form28a_36109003_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    arman()
    dgv_36109003.DataSource = anto
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Close()
    End Sub
    End Class



    Public NotInheritable Class form28b_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 simpan_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109003.Click
    form28a_36109003.arman()
    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 = ""

    End Sub
    End Class

    BalasHapus
  2. RUSNANINGSI R
    36109010

    Public Class Form28A
    Dim dt As New DataTable
    Dim virgo As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub rusna()
    Dim fm As New OleDb.OleDbDataAdapter
    fm = New OleDb.OleDbDataAdapter("select * from barang", virgo)
    dt.Rows.Clear()
    fm.Fill(dt)
    fm.Dispose()
    End Sub
    Private Sub Form28A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    rusna()
    dgv_36109010.DataSource = dt
    End Sub

    Private Sub input_36109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles input_36109010.Click
    If Form28B.Visible = False Then
    Form28B.Show()
    Else
    Form28B.Activate()
    End If
    End Sub
    End Class
    ------------------------------------------------
    Public Class Form28B
    Dim rusna As New ByIskandar.CariKeDataBaseByIskandar
    Dim cm As New OleDb.OleDbCommand
    Dim hma As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")

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

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

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

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

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

    cm = New OleDb.OleDbCommand("insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & KB_36109010.Text & "','" & NB_36109010.Text & "'," & Val(HJ_36109010.Text) & "," & Val(JB_36109010.Text) & ")", hma)
    hma.Open()
    cm.ExecuteNonQuery()
    hma.Close()
    cm.Dispose()

    KB_36109010.Text = ""
    NB_36109010.Text = ""
    HJ_36109010.Text = ""
    JB_36109010.Text = ""

    Form28A.rusna()
    End Sub
    End Class

    BalasHapus
  3. Public Class Form28A
    Dim DIEGO As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.ACCDB")
    Dim SHARAPOVA As New DataTable
    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

    Private Sub Form28A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    XXX()
    DGV014.DataSource = SHARAPOVA
    End Sub

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

    End Sub

    Private Sub TUTUP014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TUTUP014.Click
    Me.Close()

    End Sub
    End Class

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

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

    If HJ014.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("INSERT INTO BARANG(KODEBARANG,NAMABARANG,HARGAJUAL,JUMLAHBARANG) VALUES('" & KB014.Text & "','" & NB014.Text & "'," & Val(HJ014.Text) & "," & Val(JB014.Text) & ")", DIEGO)

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

    KB014.Text = ""
    HJ014.Text = ""
    HJ014.Text = ""
    JB014.Text = ""

    Form28A.XXX()
    End Sub
    End Class

    BalasHapus
  4. amelia indahsari
    361 09 023

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

    BalasHapus
  5. iftah urfiana
    361 09 017

    http://uphy-iftah.blogspot.com/2011/11/apkom4-latihan-27-28.html

    BalasHapus
  6. Public Class Form28A_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 Form28A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    apreal()
    dgv1_36109001.DataSource = rr
    End Sub

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

    Private Sub btn1001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1001_36109001.Click
    Close()
    End Sub
    End Class


    Public Class Form28B_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 ee_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsmpn_36109001.Click
    If kb_001_36109001.Text.Length = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

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

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

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

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

    cm = New OleDb.OleDbCommand("insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_001_36109001.Text & "','" & nb_001_36109001.Text & "'," & Val(hj_001_36109001.Text) & "," & Val(jb_001_36109001.Text) & ")", imps)
    imps.Open()
    cm.ExecuteNonQuery()
    imps.Close()
    cm.Dispose()

    kb_001_36109001.Text = ""
    nb_001_36109001.Text = ""
    hj_001_36109001.Text = ""
    jb_001_36109001.Text = ""

    Form28A_36109001.apreal()
    End Sub

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

    End Sub
    End Class

    BalasHapus
  7. Public Class Form28A_36109006
    Dim DT_36109006 As New DataTable
    Dim HARUN As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub MHH()
    Dim IM As New OleDb.OleDbDataAdapter
    IM = New OleDb.OleDbDataAdapter("select * from barang", HARUN)
    DT_36109006.Rows.Clear()
    IM.Fill(DT_36109006)
    IM.Dispose()
    End Sub
    Private Sub Form28A_36109006_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    MHH()
    DGV1_36109006.DataSource = DT_36109006
    End Sub
    Private Sub INPUT_36109006_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUT_36109006.Click
    If Form28B_36109006.Visible = False Then
    Form28B_36109006.Show()
    Else
    Form28B_36109006.Activate()
    End If
    End Sub
    Private Sub TUTUP_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TUTUP_36109006.Click
    Close()
    End Sub

    End Class


    Public Class Form28B_36109006
    Dim MHH As New ByIskandar.CariKeDataBaseByIskandar
    Dim KendaraanSimpan As New OleDb.OleDbCommand
    Dim Jalan 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 KODEBARANG_36109006.Text.Length = 0 Then
    MsgBox("Masukkan teks")
    Exit Sub
    End If

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

    If Val(HARGAJUAL_36109006.Text) = 0 Then
    MsgBox("Masukkan Teks")
    Exit Sub
    End If

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

    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", KODEBARANG_36109006.Text, 1, Jalan)

    If PENCARI.JumlanBaris > 0 Then
    MsgBox("Data sudah dimasukkan")

    KODEBARANG_36109006.Text = " "
    NAMABARANG_36109006.Text = " "
    HARGAJUAL_36109006.Text = " "
    JUMLAHBARANG_36109006.Text = " "
    Exit Sub
    End If


    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & KODEBARANG_36109006.Text & "','" & NAMABARANG_36109006.Text & "', " & Val(HARGAJUAL_36109006.Text) & "," & Val(JUMLAHBARANG_36109006.Text) & ")", Jalan)
    Jalan.Open()
    Cm.ExecuteNonQuery()
    Jalan.Close()
    Cm.Dispose()


    KODEBARANG_36109006.Text = " "
    NAMABARANG_36109006.Text = " "
    HARGAJUAL_36109006.Text = " "
    JUMLAHBARANG_36109006.Text = " "

    End Sub

    End Class

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

    http://ismifebriani.blogspot.com/2011/11/apkom-4-latihan-27-28.html

    BalasHapus
  9. Latihan 28

    Public Class Latihan28B
    Dim nini As New ByIskandar.CariKeDataBaseByIskandar
    Dim rani As New OleDb.OleDbCommand
    Dim nisa As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")


    Private Sub simpan_008_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_008.Click
    If kb_008.Text.Length = 0 Then
    MsgBox("Isi dulue itu yang kosong")
    Exit Sub
    End If

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

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

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

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

    rani = New OleDb.OleDbCommand("insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_008.Text & "','" & nb_008.Text & "'," & Val(hj_008.Text) & "," & Val(jb_008.Text) & ")", nisa)
    nisa.Open()
    rani.ExecuteNonQuery()
    nisa.Close()
    rani.Dispose()

    kb_008.Text = ""
    nb_008.Text = ""
    hj_008.Text = ""
    jb_008.Text = ""
    End Sub

    End Class

    BalasHapus
  10. HASTUTI
    36109016


    FORM28-A
    Public Class Form28_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 uthi()
    Dim fm As New OleDb.OleDbDataAdapter
    fm = New OleDb.OleDbDataAdapter("select * from barang", ak)
    poltek.Rows.Clear()
    fm.Fill(poltek)
    fm.Dispose()
    End Sub
    Private Sub Form28_A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    uthi()
    dgv36109016.DataSource = poltek
    End Sub

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

    Private Sub tutup36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tutup36109016.Click
    Close()
    End Sub
    End Class










    FORM28-B
    Public Class Form28_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 = ""

    Form28_A.uthi()
    End Sub
    End Class

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

    BalasHapus
  12. iwan (361 09 026 / 3a-d3)

    http://iwandinejad.blogspot.com/#!/2012/01/latihan-28-apkom-4.html

    BalasHapus
  13. iwan
    361 09 026
    3A-D3


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

    BalasHapus