Jumat, 04 November 2011

Latihan 29 Apkom 4 D3 C

Silahkan kumpul disini

9 komentar:

  1. Public Class Form29
    Dim A 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 KB1_076.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If KB2_076.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If NB_076.Text.Length = 0 Then
    MsgBox("Nama barang sudah ada")
    Exit Sub
    End If

    If Val(HJ_076.Text) = 0 Then
    MsgBox("Harga jual sudah ada")
    Exit Sub
    End If

    If Val(JB_076.Text) = 0 Then
    MsgBox("Jumlah barang sudah ada")
    Exit Sub
    End If

    If KB1_076.Text <> KB2_076.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("Barang", "Kodebarang", KB2_076.Text, 1, A)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KB2_076.Text & "', NAMABARANG= '" & NB_076.Text & "', HARGAJUAL= " & Val(HJ_076.Text) & ", JUMLAHBARANG= " & Val(JB_076.Text) & " WHERE KODEBARANG= '" & KB1_076.Text & "'", A)
    A.Open()
    CM.ExecuteNonQuery()
    A.Close()
    CM.Dispose()

    KB1_076.Text = ""
    KB2_076.Text = ""
    NB_076.Text = ""
    HJ_076.Text = ""
    JB_076.Text = ""
    End Sub
    End Class

    BalasHapus
  2. FITRAH ADITYA

    Public Class LATIHAN029084

    Dim A As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb")


    Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click
    If kb_084.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If kb1_084.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If nb_084.Text.Length = 0 Then
    MsgBox("Nama barang sudah ada")
    Exit Sub
    End If

    If Val(hj_084.Text) = 0 Then
    MsgBox("Harga jual sudah ada")
    Exit Sub
    End If

    If Val(jb_084.Text) = 0 Then
    MsgBox("Jumlah barang sudah ada")
    Exit Sub
    End If

    If kb_084.Text <> kb1_084.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("Barang", "Kodebarang", kb1_084.Text, 1, A)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb1_084.Text & "', NAMABARANG= '" & nb_084.Text & "', HARGAJUAL= " & Val(hj_084.Text) & ", JUMLAHBARANG= " & Val(jb_084.Text) & " WHERE KODEBARANG= '" & kb_084.Text & "'", A)
    A.Open()
    CM.ExecuteNonQuery()
    A.Close()
    CM.Dispose()

    kb_084.Text = ""
    kb1_084.Text = ""
    nb_084.Text = ""
    hj_084.Text = ""
    jb_084.Text = ""
    End Sub
    End Class

    BalasHapus
  3. Public Class Latihan29
    Dim A 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 kb1070.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If kb2070.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If nb070.Text.Length = 0 Then
    MsgBox("Nama barang sudah ada")
    Exit Sub
    End If

    If Val(hj070.Text) = 0 Then
    MsgBox("Harga jual sudah ada")
    Exit Sub
    End If

    If Val(jb070.Text) = 0 Then
    MsgBox("Jumlah barang sudah ada")
    Exit Sub
    End If

    If kb1070.Text <> kb2070.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("Barang", "Kodebarang", kb2070.Text, 1, A)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & kb2070.Text & "', NAMABARANG= '" & nb070.Text & "', HARGAJUAL= " & Val(hj070.Text) & ", JUMLAHBARANG= " & Val(jb070.Text) & " WHERE KODEBARANG= '" & kb1070.Text & "'", A)
    A.Open()
    CM.ExecuteNonQuery()
    A.Close()
    CM.Dispose()

    kb1070.Text = ""
    kb2070.Text = ""
    nb070.Text = ""
    hj070.Text = ""
    jb070.Text = ""
    End Sub
    End Class

    BalasHapus
  4. feby winriani syam

    Public Class Form29
    Dim A 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 SAVE.Click
    If KB1_064.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If KB2_064.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If NB_064.Text.Length = 0 Then
    MsgBox("Nama barang sudah ada")
    Exit Sub
    End If

    If Val(HJ_064.Text) = 0 Then
    MsgBox("Harga jual sudah ada")
    Exit Sub
    End If

    If Val(JB_064.Text) = 0 Then
    MsgBox("Jumlah barang sudah ada")
    Exit Sub
    End If

    If KB1_064.Text <> KB2_064.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("Barang", "Kodebarang", KB2_064.Text, 1, A)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KB2_064.Text & "', NAMABARANG= '" & NB_064.Text & "', HARGAJUAL= " & Val(HJ_064.Text) & ", JUMLAHBARANG= " & Val(JB_064.Text) & " WHERE KODEBARANG= '" & KB1_064.Text & "'", A)
    A.Open()
    CM.ExecuteNonQuery()
    A.Close()
    CM.Dispose()

    KB1_064.Text = ""
    KB2_064.Text = ""
    NB_064.Text = ""
    HJ_064.Text = ""
    JB_064.Text = ""
    End Sub

    End Class

    BalasHapus
  5. Muhammad Nur

    Public Class Latihan029077

    Dim n 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 KBrg1.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If KBrg.Text.Length = 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If

    If NBrg.Text.Length = 0 Then
    MsgBox("Nama barang sudah ada")
    Exit Sub
    End If

    If Val(HJual.Text) = 0 Then
    MsgBox("Harga jual sudah ada")
    Exit Sub
    End If

    If Val(JBrg.Text) = 0 Then
    MsgBox("Jumlah barang sudah ada")
    Exit Sub
    End If

    If KBrg1.Text <> KBrg.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("Barang", "Kodebarang", KBrg.Text, 1, n)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & KBrg.Text & "', NAMABARANG= '" & NBrg.Text & "', HARGAJUAL= " & Val(Hjual.Text) & ", JUMLAHBARANG= " & Val(Jbrg.Text) & " WHERE KODEBARANG= '" & KBrg1.Text & "'", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()
    CM.Dispose()

    KBrg1.Text = ""
    KBrg.Text = ""
    NBrg.Text = ""
    HJual.Text = ""
    JBrg.Text = ""

    End Sub
    End Class

    BalasHapus
  6. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  7. Public Class Form29

    Dim I 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 kb.Text.Length = 0 Then
    MsgBox("kode barang sudah ada")
    Exit Sub
    End If
    If c1.Text.Length = 0 Then
    MsgBox("kode baang sudah ada")
    Exit Sub
    End If

    If c2.Text.Length = 0 Then
    MsgBox("nama barang sudah ada")
    Exit Sub
    End If

    If Val(c3.Text) = 0 Then
    MsgBox("harga jual sudah ada")
    Exit Sub
    End If

    If Val(c4.Text) = 0 Then
    MsgBox("jumlah barang sudah ada")
    Exit Sub
    End If


    If kb.Text <> c1.Text Then
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    cari.AturPencarianDataBase("Barang", "KodeBarang", c1.Text, 1, I)
    If cari.JumlanBaris > 0 Then
    MsgBox("Kode barang sudah ada")
    Exit Sub
    End If
    End If

    Dim CI As New OleDb.OleDbCommand
    CI = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG= '" & c1.Text & "', NAMABARANG='" & c2.Text & "', HARGAJUAL= " & Val(c3.Text) & ", JUMLAHBARANG= " & Val(c4.Text) & "WHERE KODEBARANG= '" & kb.Text & "'", I)
    I.Open()
    CI.ExecuteNonQuery()
    I.Close()
    CI.Dispose()

    kb.Text = ""
    c1.Text = ""
    c2.Text = ""
    c3.Text = ""
    c4.Text = ""

    End Sub

    End Class

    BalasHapus
  8. Public Class latihan_29
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=dannagprayudha")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
    If Val(kobar2069.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If nabar069.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

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

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

    cari.AturPencarianDataBase("BARANG", "KODEBARANG", kobar069.Text, 1, CONECT)

    If cari.JumlanBaris = False Then
    MsgBox("kode tidak ada")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & kobar2069.Text & "', namabarang = '" & nabar069.Text & "', hargajual = " & Val(harju069.Text) & ", jumlahbarang = " & Val(jubar069.Text) & " where kodebarang ='" & kobar069.Text & "'", CONECT)

    CONECT.Open()
    com.ExecuteNonQuery()
    CONECT.Close()
    com.Dispose()

    kobar069.Text = ""
    kobar2069.Text = ""
    nabar069.Text = ""
    harju069.Text = ""
    jubar069.Text = ""

    End Sub


    End Class

    BalasHapus
  9. http://gunawanmustari.blogspot.com/2011/12/latihan-29.html

    BalasHapus