Jumat, 04 November 2011

Latihan 31 Apkom 4 D4 B

18 komentar:

  1. Public Class Latihan31B_46109050

    Dim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If QQ1_46109050.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If QQ2_46109050.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If Val(QQ3_46109050.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If Val(QQ4_46109050.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If KB_46109050.Text <> QQ1_46109050.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", QQ1_46109050.Text, 1, risky)
    If PENCARI.JumlanBaris > 0 Then
    MsgBox("the data has been exist please insert new data")
    QQ1_46109050.Text = ""
    QQ2_46109050.Text = ""
    QQ3_46109050.Text = ""
    QQ4_46109050.Text = ""
    Exit Sub
    End If
    End If

    Dim mahira As New OleDb.OleDbCommand
    mahira = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & QQ1_46109050.Text & "', NAMABARANG = '" & QQ2_46109050.Text & "', HARGAJUAL=" & Val(QQ3_46109050.Text) & ", JUMLAHBARANG=" & Val(QQ4_46109050.Text) & " where KODEBARANG='" & KB_46109050.Text & "'", risky)
    risky.Open()
    mahira.ExecuteNonQuery()
    risky.Close()
    mahira.Dispose()

    KB_46109050.Text = ""
    QQ1_46109050.Text = ""
    QQ2_46109050.Text = ""
    QQ3_46109050.Text = ""
    QQ4_46109050.Text = ""

    Latihan30A_46109050.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  2. Andi Muh. Yusri
    46109038

    Public Class Latihan31B_46109038

    Dim yusri As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;jet OleDb:database password=300591")

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

    End Sub

    Private Sub Simpan_46109038_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_46109038.Click

    If Val(Kobar_46109038.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If
    If NamBar_46109038.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(HarJu_46109038.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(JumBar_46109038.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    If KodeLama_46109038.Text <> Kobar_46109038.Text Then
    Dim Pencari As New ByIskandar.CariKeDataBaseByIskandar
    Pencari.AturPencarianDataBase("BARANG", "KODEBARANG", Kobar_46109038.Text, 1, yusri)

    If Pencari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Kobar_46109038.Text = ""
    KodeLama_46109038.Text = ""
    NamBar_46109038.Text = ""
    JumBar_46109038.Text = ""
    HarJu_46109038.Text = ""
    Exit Sub
    End If
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("update Barang set KODEBARANG='" & Kobar_46109038.Text & "',NAMABARANG='" & NamBar_46109038.Text & "',hargajual=" & Val(HarJu_46109038.Text) & ", JUMLAHBARANG=" & Val(JumBar_46109038.Text) & " where KODEBARANG='" & KodeLama_46109038.Text & "'", yusri)
    yusri.Open()
    com.ExecuteNonQuery()
    yusri.Close()
    com.Dispose()

    KoBar_46109038.Text = ""
    KodeLama_46109038.Text = ""
    NamBar_46109038.Text = ""
    JumBar_46109038.Text = ""
    HarJu_46109038.Text = ""

    Latihan30A_46109038.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  3. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  4. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  5. Public Class Latihan031B_46109006
    Dim SRY As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=10")
    Private Sub SIMPAN46109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan46109006.Click

    If KB.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If NB.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(HJ.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(JB.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If


    If KB006.Text <> KB.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", KB.Text, 1, SRY)

    If PENCARI.JumlanBaris > 0 Then
    MsgBox("data telah ada, silahkan masukkan data baru")


    KB.Text = " "
    NB.Text = " "
    HJ.Text = " "
    JB.Text = " "
    Exit Sub
    End If
    End If


    Dim KI2 As New OleDb.OleDbCommand
    KI2 = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & KB.Text & "', NAMABARANG = '" & NB.Text & "', HARGAJUAL=" & Val(HJ.Text) & ", JUMLAHBARANG=" & Val(JB.Text) & " where KODEBARANG='" & KB.Text & "'", SRY)

    SRY.Open()
    KI2.ExecuteNonQuery()
    SRY.Close()
    KI2.Dispose()


    KB.Text = "-"
    KB.Text = " "
    NB.Text = " "
    HJ.Text = " "
    JB.Text = " "

    Latihan031A_46109006.ambildata()

    Me.Close()
    End Sub
    End Class

    BalasHapus
  6. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  7. Public Class Latihan031B_46109015
    Dim saya As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=015")

    Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109015.Click
    'perintah periksa data
    If t1_46109015.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If t2_46109015.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t3_46109015.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t4_46109015.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If
    'perintah ambil data

    If KB46109015.Text <> t1_46109015.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1_46109015.Text, 1, saya)

    If PENCARI.JumlanBaris > 0 Then
    MsgBox("The data has been exist please insert new data")

    t1_46109015.Text = " "
    t2_46109015.Text = " "
    t3_46109015.Text = " "
    t4_46109015.Text = " "
    Exit Sub
    End If
    End If

    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t1_46109015.Text & "', NAMABARANG = '" & t2_46109015.Text & "', HARGAJUAL=" & Val(t3_46109015.Text) & ", JUMLAHBARANG=" & Val(t4_46109015.Text) & " where KODEBARANG='" & KB46109015.Text & "'", saya)
    saya.Open()
    Cm.ExecuteNonQuery()
    saya.Close()
    Cm.Dispose()

    KB46109015.Text = "-"
    t1_46109015.Text = " "
    t2_46109015.Text = " "
    t3_46109015.Text = " "
    t4_46109015.Text = " "

    Latihan031A_46109015.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  8. Public Class Latihan31A46109047


    Dim Way As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=979264")
    Dim ambil As New DataTable
    Public Sub ambildata()

    Dim data As New OleDb.OleDbDataAdapter

    data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", Way)

    ambil.Rows.Clear()

    data.Fill(ambil)
    data.Dispose()

    End Sub


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

    Latihan31B46109047.KB46109047.Text = DGV46109047.CurrentRow.Cells("KODEBARANG").Value
    Latihan31B46109047.t146109047.Text = DGV46109047.CurrentRow.Cells("KODEBARANG").Value
    Latihan31B46109047.t246109047.Text = DGV46109047.CurrentRow.Cells("NAMABARANG").Value
    Latihan31B46109047.t346109047.Text = DGV46109047.CurrentRow.Cells("HARGAJUAL").Value
    Latihan31B46109047.t446109047.Text = DGV46109047.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub

    Private Sub Latihan31A46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DGV46109047.DataSource = ambil
    End Sub
    End Class

    BalasHapus
  9. Public Class Latihan31B46109047
    Dim Way As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=979264")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If t146109047.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If t246109047.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t346109047.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t446109047.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If


    If KB46109047.Text <> t146109047.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t146109047.Text, 1, Way)

    If PENCARI.JumlanBaris > 0 Then
    MsgBox("The data has been exist please insert new data")


    t146109047.Text = " "
    t246109047.Text = " "
    t346109047.Text = " "
    t446109047.Text = " "
    Exit Sub
    End If
    End If


    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t146109047.Text & "', NAMABARANG = '" & t246109047.Text & "', HARGAJUAL=" & Val(t346109047.Text) & ", JUMLAHBARANG=" & Val(t446109047.Text) & " where KODEBARANG='" & KB46109047.Text & "'", Way)
    Way.Open()
    Cm.ExecuteNonQuery()
    Way.Close()
    Cm.Dispose()


    KB46109047.Text = "-"
    t146109047.Text = " "
    t246109047.Text = " "
    t346109047.Text = " "
    t446109047.Text = " "


    Latihan31A46109047.ambildata()


    Me.Close()
    End Sub
    End Class

    BalasHapus
  10. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  11. Public Class Latihan31_B_46109044
    Dim jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109044")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If tb146109044.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If tb246109044.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If Val(tb346109044.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If Val(tb446109044.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If KB.Text <> tb146109044.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", tb146109044.Text, 1, jalan)
    If PENCARI.JumlanBaris > 0 Then
    MsgBox("the data has been exist please insert new data")
    tb146109044.Text = ""
    tb246109044.Text = ""
    tb346109044.Text = ""
    tb446109044.Text = ""
    Exit Sub
    End If
    End If

    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & tb146109044.Text & "', NAMABARANG = '" & tb246109044.Text & "', HARGAJUAL=" & Val(tb346109044.Text) & ", JUMLAHBARANG=" & Val(tb446109044.Text) & " where KODEBARANG='" & KB.Text & "'", jalan)
    jalan.Open()
    Cm.ExecuteNonQuery()
    jalan.Close()
    Cm.Dispose()

    KB.Text = ""
    tb146109044.Text = ""
    tb246109044.Text = ""
    tb346109044.Text = ""
    tb446109044.Text = ""

    Latihan31_A_46109044.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  12. Public Class Latihan31A46109026
    Dim tinggal As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")
    Dim pergi As New DataTable
    Public Sub ambildata()
    Dim data As New OleDb.OleDbDataAdapter
    data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", tinggal)
    pergi.Rows.Clear()
    data.Fill(pergi)
    data.Dispose()
    End Sub

    Private Sub Latihan31A46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    dtg46109026.DataSource = pergi
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan31B46109026.Visible = False Then
    Latihan31B46109026.Show()
    Else
    Latihan31B46109026.Activate()
    End If
    Latihan31B46109026.KB.Text = dtg46109026.CurrentRow.Cells("KODEBARANG").Value
    Latihan31B46109026.kb46109026.Text = dtg46109026.CurrentRow.Cells("KODEBARANG").Value
    Latihan31B46109026.nb46109026.Text = dtg46109026.CurrentRow.Cells("NAMABARANG").Value
    Latihan31B46109026.hj46109026.Text = dtg46109026.CurrentRow.Cells("HARGAJUAL").Value
    Latihan31B46109026.jb46109026.Text = dtg46109026.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    End Class

    BalasHapus
  13. Public Class Latihan31B46109026
    Dim tinggal As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")

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

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If kb46109026.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If nb46109026.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If Val(hj46109026.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If Val(jb46109026.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If KB.Text <> kb46109026.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", kb46109026.Text, 1, tinggal)
    If PENCARI.JumlanBaris > 0 Then
    MsgBox("the data has been exist please insert new data")
    kb46109026.Text = ""
    nb46109026.Text = ""
    hj46109026.Text = ""
    jb46109026.Text = ""
    Exit Sub
    End If
    End If

    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & kb46109026.Text & "', NAMABARANG = '" & nb46109026.Text & "', HARGAJUAL=" & Val(hj46109026.Text) & ", JUMLAHBARANG=" & Val(jb46109026.Text) & " where KODEBARANG='" & KB.Text & "'", tinggal)
    tinggal.Open()
    Cm.ExecuteNonQuery()
    tinggal.Close()
    Cm.Dispose()

    KB.Text = ""
    kb46109026.Text = ""
    nb46109026.Text = ""
    hj46109026.Text = ""
    jb46109026.Text = ""

    Latihan31A46109026.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  14. Public Class Form31B
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=allah swt")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If vd1_052.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If vd2_052.Text.Length = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If Val(vd3_052.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If
    If Val(vd4_052.Text) = 0 Then
    MsgBox("Please insert your text")
    Exit Sub
    End If

    If KB.Text <> vd1_052.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", vd1_052.Text, 1, conect)
    If PENCARI.JumlanBaris > 0 Then
    MsgBox("the data has been exist please insert new data")
    vd1_052.Text = ""
    vd2_052.Text = ""
    vd3_052.Text = ""
    vd4_052.Text = ""
    Exit Sub
    End If
    End If

    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & vd1_052.Text & "', NAMABARANG = '" & vd2_052.Text & "', HARGAJUAL=" & Val(vd3_052.Text) & ", JUMLAHBARANG=" & Val(vd4_052.Text) & " where KODEBARANG='" & KB.Text & "'", conect)
    conect.Open()
    Cm.ExecuteNonQuery()
    conect.Close()
    Cm.Dispose()

    KB.Text = ""
    vd1_052.Text = ""
    vd2_052.Text = ""
    vd3_052.Text = ""
    vd4_052.Text = ""

    Form31A.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  15. http://kumpulanlatihan46109060.blogspot.com/2011/11/latihan-31.html

    BalasHapus
  16. http://taufiqgooners.blogspot.com/2011/11/latihan-31-apkom.html

    BalasHapus
  17. http://irvanbravely.blogspot.com/2011/11/latihan-31-apkom.html

    BalasHapus
  18. Public Class Latihan_31B_46109044
    Dim syahril As New ByIskandar.CariKeDataBaseByIskandar
    Dim cm As New OleDb.OleDbCommand
    Dim connect 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 S46109044.Click
    If KB46109044.Text.Length = 0 Then
    MsgBox("Isi rong itu yang kosong")
    Exit Sub
    End If

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

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

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

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

    cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB46109044.Text & "', namabarang = '" & NB46109044.Text & "', hargajual = " & Val(HJ46109044.Text) & ", jumlahbarang = " & Val(JB46109044.Text) & " where kodebarang = '" & ee.Text & "'", connect)

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

    KB46109044.Text = ""
    NB46109044.Text = ""
    HJ46109044.Text = ""
    JB46109044.Text = ""
    ee.Text = "-"

    Latihan_31A_46109044.syahril()
    End Sub

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

    End Sub
    End Class

    BalasHapus