Program Aplikasi Penilaian Karyawan Menggunakan VB.net

 

Secara garis besar tahapan pembuatan aplikasi ini adalah sebagai berikut:

 

  1. Membuat database
  2. Membuat tabel-tabel
  3. Membuat project
  4. Membuat module koneksi
  5. Membuat form-form master
  6. Membuat form transaksi
  7. Membuat reporting

 

 

 

 

 

 

 

 

 

 

Imports System.Data.OleDb

 

Public Class Indikator

 

    Sub Bersihkan()

        TextBox1.Clear()

        TextBox2.Clear()

        TextBox1.Focus()

    End Sub

 

    Sub TampilListbox()

        CMD = New OleDbCommand("select distinct kode_aspek,Nama_aspek  from indikator", CONN)

        DR = CMD.ExecuteReader

        ListBox1.Items.Clear()

        Do While DR.Read

            ListBox1.Items.Add(DR.Item(0) & Space(2) & DR.Item(1))

        Loop

    End Sub

 

    Sub CariKodeAspek()

        CMD = New OleDbCommand("select * from indikator where kode_aspek='" & TextBox1.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Sub BuatKolom()

        DA = New OleDbDataAdapter("select Nama_Indikator from indikatordetail where kode_aspek='sembarang'", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.Columns(0).Width = 600

    End Sub

 

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

        Call Koneksi()

        Call Bersihkan()

        Call TampilListbox()

        Call BuatKolom()

    End Sub

 

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Me.Close()

    End Sub

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Call Bersihkan()

        DGV.Columns.Clear()

    End Sub

 

    Sub CaridetailIndikator()

        DA = New OleDbDataAdapter("select Nomor,Nama_Indikator from indikator where kode_aspek='" & TextBox1.Text & "'", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.Columns(1).Width = 500

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

 

        TextBox1.MaxLength = 2

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

 

        Call CariKodeAspek()

        If e.KeyChar = Chr(13) Then

            If DR.HasRows Then

                TextBox2.Text = DR.Item(1)

                DGV.Columns.Clear()

                Call CaridetailIndikator()

            Else

                Call BuatKolom()

                TextBox2.Clear()

                TextBox2.Focus()

            End If

        End If

    End Sub

 

    Private Sub DGV_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DGV.KeyPress

        On Error Resume Next

        If e.KeyChar = Chr(27) Then

            DGV.Rows.Remove(DGV.CurrentRow)

        End If

    End Sub

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If TextBox1.Text = "" Or TextBox2.Text = "" Or DGV.RowCount - 1 = 0 Then

            MsgBox("data belum lengkap")

            Exit Sub

        End If

 

        Call CariKodeAspek()

        If Not DR.HasRows Then

            Try

                For baris As Integer = 0 To DGV.RowCount - 2

                    Dim simpandetail As String = "insert into indikator values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & Microsoft.VisualBasic.Str(TextBox1.Text) + baris.ToString & "','" & DGV.Rows(baris).Cells(0).Value & "')"

                    CMD = New OleDbCommand(simpandetail, CONN)

                    CMD.ExecuteNonQuery()

                Next

                Call Bersihkan()

                DGV.Columns.Clear()

            Catch ex As Exception

                MsgBox(ex.Message)

                MsgBox("entrian belum lengkap")

                Exit Sub

            End Try

        Else

            Try

                For baris As Integer = 0 To DGV.RowCount - 2

                    Dim editdetail As String = "update indikator set nama_ASPEK='" & TextBox2.Text & "',NAMA_INDIKATOR='" & DGV.Rows(baris).Cells(1).Value & "' where nomor='" & DGV.Rows(baris).Cells(0).Value & "' and kode_aspek='" & TextBox1.Text & "'"

                    CMD = New OleDbCommand(editdetail, CONN)

                    CMD.ExecuteNonQuery()

                Next

                Call Bersihkan()

                DGV.Columns.Clear()

            Catch ex As Exception

                MsgBox(ex.Message)

                MsgBox("entrian belum lengkap")

                Exit Sub

            End Try

        End If

        Call TampilListbox()

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        If e.KeyChar = Chr(13) Then

            DGV.Focus()

        End If

 

        If (e.KeyChar >= "0" And e.KeyChar <= "9" And e.KeyChar <> vbBack) Then

            e.Handled = True

        End If

    End Sub

End Class

 

 

 

Imports System.Data.OleDb

 

 

Public Class Evaluasi

    Dim ColType(,) As Integer

 

    Sub Bersihkan()

        cbonamadosen.Text = ""

        cbomatakuliah.Text = ""

        lblkodedosen.Text = ""

        lblkodematakuliah.Text = ""

        txtsaran.Clear()

    End Sub

 

    Sub TampilGrid()

        'On Error Resume Next

        DGV.Columns.Clear()

        DA = New OleDbDataAdapter("select * from indikator", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.Columns(2).Width = 400

        DGV.Columns(2).HeaderText = "Indikator"

 

        Dim Kolom1 As New DataGridViewCheckBoxColumn

        DGV.Columns.Add(Kolom1)

        Kolom1.HeaderText = "Sangat Kurang"

 

        Dim Kolom2 As New DataGridViewCheckBoxColumn

        DGV.Columns.Add(Kolom2)

        Kolom2.HeaderText = "Kurang"

 

        Dim Kolom3 As New DataGridViewCheckBoxColumn

        DGV.Columns.Add(Kolom3)

        Kolom3.HeaderText = "Cukup"

 

        Dim Kolom4 As New DataGridViewCheckBoxColumn

        DGV.Columns.Add(Kolom4)

        Kolom4.HeaderText = "Baik"

 

        Dim Kolom5 As New DataGridViewCheckBoxColumn

        DGV.Columns.Add(Kolom5)

        Kolom5.HeaderText = "Sangat Baik"

 

        DGV.Columns.Add("1", "1")

        DGV.Columns.Add("2", "2")

        DGV.Columns.Add("3", "3")

        DGV.Columns.Add("4", "4")

        DGV.Columns.Add("5", "5")

 

        For baris1 As Integer = 0 To DGV.RowCount - 1

            For kolom As Integer = 9 To DGV.ColumnCount - 1

                DGV.Columns(kolom).ReadOnly = True

            Next

        Next

 

        DGV.Columns(0).ReadOnly = True

        DGV.Columns(1).ReadOnly = True

        DGV.Columns(2).ReadOnly = True

        DGV.DefaultCellStyle.Font = New Font("Microsoft Sans Serif", 10)

        For kolom As Integer = 3 To DGV.ColumnCount - 1

            DGV.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter

        Next

        DGV.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells

    End Sub

 

    Sub Tampilmatakuliah()

        CMD = New OleDbCommand("select nama_matakuliah from matakuliah", CONN)

        DR = CMD.ExecuteReader

        cbomatakuliah.Items.Clear()

        Do While DR.Read

            cbomatakuliah.Items.Add(DR.Item(0))

        Loop

    End Sub

 

    Sub TampilKelas()

        CMD = New OleDbCommand("select distinct kelas from mahasiswa", CONN)

        DR = CMD.ExecuteReader

        cbokelas.Items.Clear()

        Do While DR.Read

            cbokelas.Items.Add(DR.Item(0))

        Loop

    End Sub

 

    Sub Tampildosen()

        CMD = New OleDbCommand("select nama_dosen from dosen", CONN)

        DR = CMD.ExecuteReader

        cbonamadosen.Items.Clear()

        Do While DR.Read

            cbonamadosen.Items.Add(DR.Item(0))

        Loop

    End Sub

 

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

        Call Koneksi()

        Call Tampildosen()

        Call Tampilmatakuliah()

        Call TampilGrid()

 

        If MenuUtama.Panel3.Text <> "MAHASISWA" Then

            lblnim.Text = MenuUtama.Panel1.Text

            lblnamaresponden.Text = MenuUtama.Panel2.Text

            Call TampilKelas()

            cbokelas.Enabled = True

        End If

 

    End Sub

 

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

        CMD = New OleDbCommand("select * from dosen where nama_dosen='" & cbonamadosen.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            lblkodedosen.Text = DR.Item("kode_dosen")

        End If

    End Sub

 

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

        CMD = New OleDbCommand("select * from matakuliah where nama_matakuliah='" & cbomatakuliah.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            lblkodematakuliah.Text = DR.Item("kode_matakuliah")

        End If

    End Sub

 

    Private Sub DGV_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV.CellEndEdit

        If e.ColumnIndex = 4 Then

            DGV.Rows(e.RowIndex).Cells(9).Value = 1

            DGV.Rows(e.RowIndex).Cells(10).Value = 0

            DGV.Rows(e.RowIndex).Cells(11).Value = 0

            DGV.Rows(e.RowIndex).Cells(12).Value = 0

            DGV.Rows(e.RowIndex).Cells(13).Value = 0

        End If

 

        If e.ColumnIndex = 5 Then

            DGV.Rows(e.RowIndex).Cells(9).Value = 0

            DGV.Rows(e.RowIndex).Cells(10).Value = 1

            DGV.Rows(e.RowIndex).Cells(11).Value = 0

            DGV.Rows(e.RowIndex).Cells(12).Value = 0

            DGV.Rows(e.RowIndex).Cells(13).Value = 0

        End If

 

        If e.ColumnIndex = 6 Then

            DGV.Rows(e.RowIndex).Cells(9).Value = 0

            DGV.Rows(e.RowIndex).Cells(10).Value = 0

            DGV.Rows(e.RowIndex).Cells(11).Value = 1

            DGV.Rows(e.RowIndex).Cells(12).Value = 0

            DGV.Rows(e.RowIndex).Cells(13).Value = 0

        End If

 

        If e.ColumnIndex = 7 Then

            DGV.Rows(e.RowIndex).Cells(9).Value = 0

            DGV.Rows(e.RowIndex).Cells(10).Value = 0

            DGV.Rows(e.RowIndex).Cells(11).Value = 0

            DGV.Rows(e.RowIndex).Cells(12).Value = 1

            DGV.Rows(e.RowIndex).Cells(13).Value = 0

        End If

 

        If e.ColumnIndex = 8 Then

            DGV.Rows(e.RowIndex).Cells(9).Value = 0

            DGV.Rows(e.RowIndex).Cells(10).Value = 0

            DGV.Rows(e.RowIndex).Cells(11).Value = 0

            DGV.Rows(e.RowIndex).Cells(12).Value = 0

            DGV.Rows(e.RowIndex).Cells(13).Value = 1

        End If

    End Sub

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        For kolom As Integer = 4 To DGV.Columns.Count - 1

            If DGV.Rows(e.RowIndex).Cells(3).Value <> "" Then

                DGV.Rows(e.RowIndex).Cells(4).Value = False

                DGV.Rows(e.RowIndex).Cells(5).Value = False

                DGV.Rows(e.RowIndex).Cells(6).Value = False

                DGV.Rows(e.RowIndex).Cells(7).Value = False

                DGV.Rows(e.RowIndex).Cells(8).Value = False

            End If

        Next

    End Sub

 

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

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

    End Sub

 

    Sub CariDataEvaluasi()

        CMD = New OleDbCommand("select * from evaluasi where nim='" & lblnim.Text & "' AND kode_dosen='" & lblkodedosen.Text & "' AND kelas='" & cbokelas.Text & "' AND kode_matakuliah='" & lblkodematakuliah.Text & "' AND cdate(tanggal)='" & DateTimePicker1.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Call TampilGrid()

    End Sub

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

 

        If MenuUtama.Panel3.Text <> "MAHASISWA" Then

            Me.Close()

        Else

            MsgBox("terima kasih atas partisipasi anda..")

            End

        End If

    End Sub

 

    Private Sub cbonamadosen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbonamadosen.SelectedIndexChanged

        CMD = New OleDbCommand("select kode_dosen from dosen where nama_dosen='" & cbonamadosen.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            lblkodedosen.Text = DR.Item(0)

        End If

    End Sub

 

    Private Sub cbomatakuliah_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbomatakuliah.SelectedIndexChanged

        CMD = New OleDbCommand("select kode_matakuliah from matakuliah where nama_matakuliah ='" & cbomatakuliah.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            lblkodematakuliah.Text = DR.Item(0)

        End If

    End Sub

End Class

 

 

 

 

Imports System.Data.OleDb

 

Public Class Laporan

 

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

 

        Call Koneksi()

        CMD = New OleDbCommand("select distinct nama_dosen from dosen,evaluasi where dosen.kode_dosen=evaluasi.kode_dosen", CONN)

        DR = CMD.ExecuteReader

        ListBox1.Items.Clear()

        Do While DR.Read

            ListBox1.Items.Add(DR.Item(0))

        Loop

    End Sub

 

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

        CMD = New OleDbCommand("select distinct nama_matakuliah from matakuliah,evaluasi,dosen where nama_dosen='" & ListBox1.Text & "' and dosen.kode_dosen=evaluasi.kode_dosen and evaluasi.kode_matakuliah=matakuliah.kode_matakuliah", CONN)

        DR = CMD.ExecuteReader

        ListBox2.Items.Clear()

        ListBox3.Items.Clear()

        Do While DR.Read

            ListBox2.Items.Add(DR.Item(0))

        Loop

    End Sub

 

    Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged

        CMD = New OleDbCommand("select distinct kelas from evaluasi,dosen,matakuliah where nama_dosen='" & ListBox1.Text & "' and nama_matakuliah='" & ListBox2.Text & "' and dosen.kode_dosen=evaluasi.kode_dosen and matakuliah.kode_matakuliah=evaluasi.kode_matakuliah", CONN)

 

        DR = CMD.ExecuteReader

        ListBox3.Items.Clear()

        Do While DR.Read

            ListBox3.Items.Add(DR.Item(0))

        Loop

    End Sub

 

    Private Sub ListBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox3.SelectedIndexChanged

        CRV.SelectionFormula = "{dosen.nama_dosen}='" & ListBox1.Text & "' and {matakuliah.nama_matakuliah}='" & ListBox2.Text & "' and {evaluasi.kelas}='" & ListBox3.Text & "'"

 

        newlaporan.Load("lap evaluasi ok2.rpt")

        Call SetingLaporan()

        CRV.ReportSource = newlaporan

        CRV.RefreshReport()

    End Sub

End Class