Jumat, 04 November 2011

Latihan 29 Apkom 4 D3 A

Silahkan kumpul disini

10 komentar:

  1. RUSNANINGSI R
    36109010

    Public Class Form29
    Dim cm As New OleDb.OleDbCommand
    Dim rusna As New ByIskandar.CariKeDataBaseByIskandar
    Dim virgo 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

    If AA_36109010.Text <> KB_36109010.Text Then

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

    cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB_36109010.Text & "', namabarang = '" & NB_36109010.Text & "', hargajual = " & Val(HJ_36109010.Text) & ", jumlahbarang = " & Val(JB_36109010.Text) & " where kodebarang = '" & AA_36109010.Text & "'", virgo)
    virgo.Open()
    cm.ExecuteNonQuery()
    virgo.Close()
    cm.Dispose()

    AA_36109010.Text = ""
    KB_36109010.Text = ""
    NB_36109010.Text = ""
    HJ_36109010.Text = ""
    JB_36109010.Text = ""
    End Sub
    End Class

    BalasHapus
  2. Public NotInheritable Class form29_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
    If ganti_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 = '" & kb_36109003.Text & "'"
    anto = New OleDb.OleDbCommand(soe, ndut)
    ndut.Open()
    anto.ExecuteNonQuery()
    ndut.Close()
    anto.Dispose()
    ganti_36109003.Text = ""
    kb_36109003.Text = ""
    nb_36109003.Text = ""
    hj_36109003.Text = ""
    jb_36109003.Text = ""
    End Sub
    End Class

    BalasHapus
  3. Public Class Form29
    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 YANG AKAN DIGANTI")
    Exit Sub
    End If

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

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

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

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

    Dim XXX As New OleDb.OleDbCommand
    XXX = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG = '" & KB014.Text & "', NAMABARANG = '" & NB0141.Text & "', HARGAJUAL = " & Val(HJ0141.Text) & ", JUMLAHBARANG = " & Val(JB0141.Text) & " WHERE KODEBARANG = '" & KB014.Text & "'", DIEGO)

    DIEGO.Open()
    XXX.ExecuteNonQuery()
    DIEGO.Close()

    KB014.Text = ""
    KB0141.Text = ""
    NB0141.Text = ""
    HJ0141.Text = ""
    JB0141.Text = ""


    End Sub
    End Class

    BalasHapus
  4. amelia indahsari
    361 09 023

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

    BalasHapus
  5. Public Class Form29_36109006
    Dim HARUN_36109006 As New OleDb.OleDbCommand
    Dim HARUN As New ByIskandar.CariKeDataBaseByIskandar
    Dim MUHHARUN 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 KODEBARANG2_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

    If KODEBARANG1_36109006.Text <> KODEBARANG2_36109006.Text Then

    HARUN.AturPencarianDataBase("Barang", "KodeBarang", KODEBARANG2_36109006.Text, 1, MUHHARUN)
    If HARUN.JumlanBaris > 0 Then
    MsgBox("Kode Barang Sudah Ada")
    Exit Sub
    End If
    End If

    HARUN_36109006 = New OleDb.OleDbCommand("update barang set kodebarang = '" & KODEBARANG2_36109006.Text & "', namabarang = '" & NAMABARANG_36109006.Text & "', hargajual = " & Val(HARGAJUAL_36109006.Text) & ", jumlahbarang = " & Val(JUMLAHBARANG_36109006.Text) & " where kodebarang = '" & KODEBARANG1_36109006.Text & "'", MUHHARUN)
    MUHHARUN.Open()
    HARUN_36109006.ExecuteNonQuery()
    MUHHARUN.Close()
    HARUN_36109006.Dispose()

    KODEBARANG1_36109006.Text = ""
    KODEBARANG2_36109006.Text = ""
    NAMABARANG_36109006.Text = ""
    HARGAJUAL_36109006.Text = ""
    JUMLAHBARANG_36109006.Text = ""
    End Sub

    End Class

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

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

    If kb1_36109001.Text <> kb_001_36109001.Text Then

    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
    End If

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

    kb1_36109001.Text = ""
    kb_001_36109001.Text = ""
    nb_001_36109001.Text = ""
    hj_001_36109001.Text = ""
    jb_001_36109001.Text = ""
    End Sub

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

    End Sub
    End Class

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


    http://ismifebriani.blogspot.com/2011/11/apkom-4-latihan-29-30.html

    BalasHapus
  8. HASTUTI
    36109016


    FORM29
    Public Class Form29
    Dim poltek As New OleDb.OleDbCommand
    Dim uthi As New ByIskandar.CariKeDataBaseByIskandar
    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 kode2_36109016.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

    If kode1_36109016.Text <> kode2_36109016.Text Then

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

    poltek = New OleDb.OleDbCommand("update barang set kodebarang = '" & kode2_36109016.Text & "', namabarang = '" & nama36109016.Text & "', hargajual = " & Val(harga36109016.Text) & ", jumlahbarang = " & Val(jumlah36109016.Text) & " where kodebarang = '" & kode1_36109016.Text & "'", ak)
    ak.Open()
    poltek.ExecuteNonQuery()
    ak.Close()
    poltek.Dispose()

    kode1_36109016.Text = ""
    kode2_36109016.Text = ""
    nama36109016.Text = ""
    harga36109016.Text = ""
    jumlah36109016.Text = ""
    End Sub
    End Class

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

    BalasHapus
  10. iwan
    361 09 026
    1A-D3

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

    BalasHapus