Pages

Diberdayakan oleh Blogger.

Minggu, 30 Juni 2013

SISTEM INFORMASI PEMESANAN DAN PENJUALAN SUKU CADANG MOBIL PADA UD.STAR DIESEL



SISTEM INFORMASI PEMESANAN DAN PENJUALAN SUKU CADANG MOBIL PADA UD.STAR DIESEL

Desaign form Menu Utama


Listing program menu utama


Public Class MENU

    Private Sub DATABARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DATABARANGToolStripMenuItem.Click
        BARANG.Show()

    End Sub

    Private Sub DATASUPLIERToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DATASUPLIERToolStripMenuItem.Click
        FORM_SUPLIER.Show()

    End Sub

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

    End Sub

    Private Sub DATAPEMESANANToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DATAPEMESANANToolStripMenuItem.Click
        PEMESANAN.Show()

    End Sub

    Private Sub DATAPENJUALANToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DATAPENJUALANToolStripMenuItem.Click
        PENJUALAN.Show()

    End Sub

    Private Sub BARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BARANGToolStripMenuItem.Click
        Dim laporan As New brng
        LAPBRNG.CRV.ReportSource = laporan
        LAPBRNG.Show()
    End Sub

    Private Sub SUPLIERToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SUPLIERToolStripMenuItem.Click
        Dim laporan As New splr
        LAPSUP.CRV.ReportSource = laporan
        LAPSUP.Show()
    End Sub

    Private Sub PEMESANANToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PEMESANANToolStripMenuItem.Click
        Dim laporan As New pesan
        LAPPSN.CRV.ReportSource = laporan
        LAPPSN.Show()
    End Sub

    Private Sub PENJUALANToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PENJUALANToolStripMenuItem.Click
        Dim laporan As New jual
        LAPJUAL.CRV.ReportSource = laporan
        LAPJUAL.Show()
    End Sub
End Class

Desaign form Barang


Desaign database


 Listing Program Barang


Imports System.Data.OleDb

Public Class BARANG
    Public DB As OleDbConnection
    Public CMD As OleDbCommand
    Public ADP As OleDbDataAdapter
    Public DR As OleDbDataReader
    Public DS As New DataSet
    Dim SQL As String

    Public Sub OpenDB()
        Dim LOKASI = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =C:\JUAL\BARANG.mdb"
        DB = New OleDbConnection(LOKASI)
        If DB.State = ConnectionState.Closed Then
            DB.Open()
        End If
    End Sub
    Sub TampilRecordBarang()
        ADP = New OleDbDataAdapter("SELECT * FROM BARANG", DB)
        DS = New DataSet
        ADP.Fill(DS, "BARANG")
        DataGridView1.DataSource = DS.Tables("BARANG")
    End Sub
    Sub ButtonBaru()
        br.Enabled = True
        smpn.Enabled = False
        edit.Enabled = False
        hps.Enabled = False
        btl.Enabled = False
        klr.Enabled = True
    End Sub
    Sub ButtonEdit()
        br.Enabled = False
        smpn.Enabled = False
        edit.Enabled = True
        hps.Enabled = True
        btl.Enabled = True
        klr.Enabled = False
    End Sub
    Sub ButtonSimpan()
        br.Enabled = False
        smpn.Enabled = True
        edit.Enabled = False
        hps.Enabled = False
        btl.Enabled = True
        klr.Enabled = False
    End Sub
    Sub HapusText()
        KD.Text = ""
        JNS.Text = ""
        SATUAN.Text = ""
        HRG.Text = ""
        JMLH.Text = ""
        Call ButtonBaru()
    End Sub

    Private Sub BARANG_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Call OpenDB()
        Call HapusText()
        Call TampilRecordBarang()
    End Sub

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

    End Sub

    Private Sub br_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles br.Click
        Call HapusText()
        KD.Focus()

    End Sub

    Private Sub btl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btl.Click
        Call HapusText()
        KD.Focus()

    End Sub

    Private Sub smpn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles smpn.Click
        SQL = "INSERT INTO BARANG(KODE_BARANG, JENIS_BARANG, SATUAN, HARGA, JUMLAH) " & _
                        " values('" & KD.Text & "','" & _
                                      JNS.Text & "','" & _
                                      SATUAN.Text & "','" & _
                                      HRG.Text & "','" & _
                                      JMLH.Text & "')"


        CMD = New OleDbCommand(SQL, DB)
        CMD.ExecuteNonQuery()
        Call br_Click(sender, e)
        Call TampilRecordBarang()
    End Sub

    Private Sub edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit.Click
        SQL = "UPDATE BARANG SET JENIS_BARANG='" & JNS.Text & "'," & _
                   " SATUAN='" & SATUAN.Text & "'," & _
                   " HARGA='" & HRG.Text & "'," & _
                   " JUMLAH='" & JMLH.Text & "' " & _
                   " Where KODE_BARANG='" & KD.Text & "'"

        CMD = New OleDbCommand(SQL, DB)
        CMD.ExecuteNonQuery()
        Call br_Click(sender, e)
        Call TampilRecordBarang()
    End Sub

    Private Sub hps_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hps.Click
        SQL = "DELETE FROM BARANG Where KODE_BARANG='" & KD.Text & "'"
        CMD = New OleDbCommand(SQL, DB)
        CMD.ExecuteNonQuery()
        Call br_Click(sender, e)
        Call TampilRecordBarang()
    End Sub

    Private Sub KD_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles KD.KeyPress
        Dim tombol As Integer = Asc(e.KeyChar)
        Dim xkode As String
        If tombol = 13 Then

            SQL = "select *from BARANG Where KODE_BARANG='" & KD.Text & "'"
            CMD = New OleDbCommand(SQL, DB)
            DR = CMD.ExecuteReader
            DR.Read()
            If DR.HasRows = True Then
                JNS.Text = DR.Item(1)
                SATUAN.Text = DR.Item(2)
                HRG.Text = DR.Item(3)
                JMLH.Text = DR.Item(4)
                Call ButtonEdit()
                MsgBox("Data ditemukan !")
            Else
                xkode = KD.Text
                Call HapusText()
                KD.Text = xkode
                Call ButtonSimpan()
            End If
            JNS.Focus()
        End If
    End Sub
   
End Class

Cetak Barang 

 
















0 komentar:

Posting Komentar