Sistem Informasi perekrutan Karyawan pada PT. WIRASTAMA ABADI

Standar

Nama database     :rekrut

Nama tabel        :jabatan

field

type

width

description

kode

text

5

Kode jabatan

Nama jabatan

text

30

Nama jabatan

bagian

text

20

bagian

Image

Imports System.Data.OleDb

Public Class Form1

    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:\vb2\rekrut1.mdb”

        DB = New OleDbConnection(LOKASI)

        If DB.State = ConnectionState.Closed Then

            DB.Open()

        End If

    End Sub

    Sub Recordanggota()

        ADP = New OleDbDataAdapter(“SELECT * FROM jabatan”, DB)

        DS = New DataSet

        ADP.Fill(DS, “jabatan”)

        DataGridView1.DataSource = DS.Tables(“jabatan”)

    End Sub

    Sub butoonbaru()

        btn_baru.Enabled = True

        btn_simpan.Enabled = False

        btn_edit.Enabled = False

        btn_hapus.Enabled = False

        btn_batal.Enabled = False

        btn_keluar.Enabled = True

    End Sub

    Sub butoonedit()

        btn_baru.Enabled = False

        btn_simpan.Enabled = False

        btn_edit.Enabled = True

        btn_hapus.Enabled = True

        btn_batal.Enabled = True

        btn_keluar.Enabled = False

    End Sub

    Sub butoonsimpan()

        btn_baru.Enabled = False

        btn_simpan.Enabled = True

        btn_edit.Enabled = False

        btn_hapus.Enabled = False

        btn_batal.Enabled = True

        btn_keluar.Enabled = False

    End Sub

    Sub hapustext()

        kode_jabatan.Text = “”

        nama_jabatan.Text = “”

        bagian.Text = “”

        Call butoonbaru()

    End Sub

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

        Call OPENDB()

        Call hapustext()

        Call Recordanggota()

        Call butoonsimpan()

        kode_jabatan.Items.Add(“001”)

        nama_jabatan.Items.Add(“karyawan”)

        bagian.Items.Add(“sekretaris”)

    End Sub

    Private Sub HPS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_hapus.Click

        SQL = “DELETE FROM LATIHAN Where NOANGGOTA='” & kode_jabatan.Text & “‘”

        CMD = New OleDbCommand(SQL, DB)

        CMD.ExecuteNonQuery()

        Call BR_Click(sender, e)

        Call Recordanggota()

    End Sub

    Private Sub BR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_baru.Click

        Call hapustext()

        kode_jabatan.Focus()

    End Sub

    Private Sub KLR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_keluar.Click

        Me.Close()

    End Sub

    Private Sub NO_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)

        Dim tombol As Integer = Asc(e.KeyChar)

        Dim xkode As String

        If tombol = 13 Then

            SQL = “SELECT * FROM LATIHAN Where NOANGGOTA='” & kode_jabatan.Text & “‘”

            CMD = New OleDbCommand(SQL, DB)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows = True Then

                nama_jabatan.Text = DR.Item(1)

                Call butoonedit()

                MsgBox(“DATA DITEMUKAN!”)

            Else

                xkode = kode_jabatan.Text

                Call hapustext()

                kode_jabatan.Text = xkode

                Call butoonsimpan()

            End If

            nama_jabatan.Focus()

        End If

    End Sub

    Private Sub BTL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_batal.Click

        Call hapustext()

        kode_jabatan.Focus()

    End Sub

    Private Sub DIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_edit.Click

        SQL = “UPDATE LATIHAN SET NAMA='” & nama_jabatan.Text & “‘,” & _

                                        “JENJANG='” & nama_jabatan.Text & “‘,” & _

                                        “JURUSAN='” & bagian.Text & “‘ ” & _

                                        “Where NOANGGOTA='” & kode_jabatan.Text & “‘”

        CMD = New OleDbCommand(SQL, DB)

        CMD.ExecuteNonQuery()

        Call BR_Click(sender, e)

        Call Recordanggota()

    End Sub

    Private Sub SMPN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_simpan.Click

        SQL = “INSERT INTO LATIHAN (NOANGGOTA, NAMA, JURUSAN, JENJANG)” & _

                                “Values (‘” & kode_jabatan.Text & “‘,'” & _

                                                nama_jabatan.Text & “‘,'” & _

                                                bagian.Text & “‘,'”

        CMD = New OleDbCommand(SQL, DB)

        CMD.ExecuteNonQuery()

        Call BR_Click(sender, e)

        Call Recordanggota()

    End Sub

    Private Sub JNJNG_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bagian.SelectedIndexChanged

        bagian.Items.Clear()

        If bagian.Text = “sekretaris” Then

            bagian.Items.Add(“karyawan”)

        End If

        If bagian.Text = “keuangan” Then

            bagian.Items.Add(“manajer”)

        End If

    End Sub

End Class

hasil program

Image

 

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s