SKRIPSI
SISTEM PENDUKUNG KEPUTUSAN PEMBERIAN BONUS BERDASARKAN PENILAIAN KERJA KARYAWAN PADA PT. ARIROS SEJAHTERA PERSADA DENGAN METODE AHP
Oleh:
NICO HORAS LEONARD MARBUN NIM. 1020000303
PROGRAM STUDI SISTEM INFORMASI FAKULTAS TEKNIK DAN ILMU KOMPUTER UNIVERSITAS POTENSI UTAMA MEDAN 2014
ABSTRAK Dalam proses pemilihan karyawan yang akan di berikan bonus (reward). HRD PT. Ariros Sejahtera Persada mengalami berbagai kendala yang dihadapi, diantaranya kesulitan dalam memilih karyawan-karyawan yang layak mendapat bonus dengan banyaknya kriteria sebagai penilaian. Untuk membantu pihak HRD PT. Ariros Sejahtera Persada dalam mengambil keputusan karyawan yang diprioritaskan mendapat bonus di perusahaan diperlukan suatu sistem pendukung keputusan. Sistem pendukung keputusan ini akan membantu pihak HRD dalam menganalisa karyawan yang diprioritaskan untuk mendapat bonus. Sistem Pendukung Keputusan Pemberian Bonus Berdasarkan Penilaian Kerja Karyawan Dengan Metode AHP adalah salah satu sistem yang digunakan oleh PT. Ariros Sejahtera Persada untuk menentukan bonus karyawan, serta menentukan beberapa kreteria yang akan dijadikan acuan untuk menentukan bonus karyawan yang akan diperoleh. sistem ini juga menghasilkan suatu informasi dalam hal ini adalah keputusan yang dapat membantu dalam menentukan pemberian bonus untuk karyawan. Dalam pembangunan sistem ini, ada beberapa tahap yang dilalui yaitu analisa sistem, perancangan sistem dan implementasi sistem. Pada tahap perancangan sistem yaitu menggunakan aplikasi visual basic. Dan konseptual database sistem ini menggunakan SQL Server. Pada implementasi dilakukan pembuatan sistem sesuai dengan rancangan yang telah dibuat. Dengan dibangunnya sistem ini, diharapkan dapat membantu HRD/Admin khususnya PT. Ariros Sejahtera Persada untuk mengambil keputusan yang tepat dan akurat agar nantinya tidak terjadi salah pilih dalam pemberian bonus karyawan.
Kata Kunci : SPK, Pemberian Bonus, Metode AHP. SQL Server, Visual Basic2010.
KATA PENGANTAR Segala puji dan syukur penulis panjatkan kepada Tuhan Yang Maha Esa atas Berkat, Perlindungan dan Karunia-Nya penulis dapat menyelesainkan skripsi ini hingga selesai. Skripsi ini disusun berdasarkan penelitian yang telah penulis lakukan dan merupakan syarat untuk menyelesaikan pendidikan program Strata I pada STMIK Potensi Utama. Adapun judul skripsi penulis adalah “Sistem Pendukung Keputusan Pemberian Bonus Berdasarkan Penilaian Kerja Karyawan pada PT.Ariros Sejahtera Persada Dengan Metode AHP”. Dalam penyusunan skripsi ini, penulis banyak memperoleh bimbingan dan bantuan dari berbagai pihak. Dan pada kesempatan ini penulis mengucapkan terimakasih kepada : 1. Bapak Iwan Fitrianto Rahmad, M.Kom, selaku Pembimbing I yang telah begitu banyak memberikan bimbingan dan petunjuk serta meluangkan waktunya dalam menyelesaikan penulisan skripsi. 2. Ibu Rika Rosnelly, S.H, M.Kom, selaku Pembimbing II sekaligus Ketua STMIK Potensi Utama yang telah begitu banyak memberikan bimbingan dan petunjuk serta meluangkan waktunya dalam menyelesaikan penulisan skripsi. 3. Ibu Hj. Nuriandy, B.A, selaku Pembina Yayasan Potensi Utama. 4. Bapak Bob Subhan Riza, ST, M.Kom selaku Ketua Yayasan Potensi Utama. 5. Ibu Lili Tanti, M.Kom, selaku Wakil Ketua I STMIK Potensi Utama. 6. Ibu Mas Ayoe Elhias, M.Kom, selaku Ketua Program Studi Sistem Informasi Potensi Utama. 7. Bapak Dedek Indra Gunawan, S.Kom, selaku Dosen Wali Program Studi Sistem Informasi STMIK Potensi Utama Kelas C Malam (2010).
8. Seluruh Dosen, Staff, Karyawan Dan Karyawati STMIK Potensi Utama. 9. Bapak David Pangaribuan dan Bapak Heron Pangaribuan selaku Pimpinan dan HRD PT.Ariros Sejahtera Persada, yang telah membimbing penulis selama menjalani pelaksanaan Riset. 10. Penghargaan teristimewa dan ucapan terimakasih sebesar – besarnya kepada kedua Orangtua Penulis yang sangat Penulis Cintai dan Sayangi, yang telah membantu dan mendukung penulis baik berupa Materi, Semangat, Dukungan, Nasehat dan Doa. 11. Saudara – saudara saya tersayang. Kakak, Abang dan Adik yang telah banyak membantu dan mendukung Penulis dalam menjalani proses perkuliahan. 12. Rekan - rekan seperjuangan, khususnya kelas Sistem Informasi C Malam yang selalu memberikan solusi-solusi bermanfaat disaat penulis butuhkan dan memberikan perhatian yang sangat besar kepada penulis dalam menyelesaikan skripsi ini. Penulis menyadari sepenuhnya bahwa skripsi ini jauh dari sempurna, baik dari penyusunan, estetika bahasa maupun data-data yang dilaporkan. Oleh karena itu, penulis mengharapkan saran dan kritik yang membangun guna melengkapi dan menyempurnakan skripsi ini. Atas semua perhatian dari semua pihak yang telah membantu penulis dalam menyusun laporan skripsi ini, penulis mengucapkan terima kasih. Demikian Penulisan skripsi ini, semoga dapat berguna bagi kita semua.
Medan, 23 Agustus 2014 Penulis,
Nico Horas Leonard Marbun 1020000303
DAFTAR ISI ABSTRAK KATA PENGANTAR ......................................................................................
i
DAFTAR ISI ..................................................................................................... iv DAFTAR GAMBAR ........................................................................................ vii DAFTAR TABEL ............................................................................................. ix DAFTAR LAMPIRAN ................................................................................... x BAB I
BAB II
: PENDAHULUAN ...........................................................................
1
I.1. Latar Belakang .........................................................................
1
I.2. Ruang Lingkup Permasalahan ..................................................
2
I.2.1. Identifikasi Masalah .......................................................
2
I.2.2. Perumusan Masalah ........................................................
2
I.2.3. Batasan Masalah .............................................................
3
I.3. Tujuan dan Manfaat ..................................................................
3
I.3.1. Tujuan .............................................................................
3
I.3.2. Manfaat ...........................................................................
4
I.4. Metodologi Penelitian ..............................................................
4
I.5. Lokasi Penelitian .....................................................................
8
I.6. Sistematika Penulisan ..............................................................
8
: TINJAUAN PUSTAKA ............................................................... 10 II.1. Sistem ....................................................................................... 10 II.2. Informasi .................................................................................. 10 II.3. Pengertian Sistem Informasi .................................................... 11 II.4. Sistem Pendukung Keputusan .................................................. 11 II.5. Metode Analytical Hierarchy Process(AHP) ........................... 11 II.5.1. Tahapan Analytical Hierarchy Proces .......................... 12 II.5.2. Langkah dan Prosedur Analytical Hierarchy Proces.... 15 II.6. Microsoft Visual Basic ............................................................ 17 II.7. Microsoft SQL Server ............................................................ 18 II.5. Database dan Entity Relationship Diagram(ERD) ................. 18 II.9. Data Dictionary(Kamus Data) ................................................. 19 II.10. Normalisasi ............................................................................ 20
II.11. Unified Modelling Language(UML) ..................................... 21 II.11.1. Use Case Diagram ...................................................... 22 II.11.2. Class Diagram ............................................................ 23 II.11.3. Activity Diagram ........................................................ 23 II.11.4. Sequence Diagram...................................................... 24 BAB III
: ANALISIS DAN DESAIN SISTEM ......................................... 25 III.1. Analisa Sistem Yang Berjalan ............................................... 25 III.1.1. Analisa Input .............................................................. 25 III.1.2. Analisa Proses ............................................................ 26 III.1.3. Analisa Output ........................................................... 27 III.2. Evaluasi Sistem Yang Berjalan ............................................... 30 III.3. Desain Sistem .......................................................................... 29 III.3.1. Desain Sistem secara Global ...................................... 30 III.3.1.1. Use Case Diagram ....................................... 30 III.3.1.2. Class Diagram ............................................. 31 III.3.1.3. Sequence Diagram ..................................... 32 III.3.1.4. Logika Program ......................................... 35 III.3.2. Desain Sistem Secara Detail ...................................... 38 III.3.2.1. Desain Output ............................................. 38 III.3.2.2. Desain Input ................................................ 40 III.3.2.3. Rancangan Database ................................... 44 III.3.2.4. Kamus data .................................................. 47 III.3.3. Rancangan ERD ......................................................... 47
BAB IV
: HASIL DAN PEMBAHASAN ..................................................... 49 IV.1. Tampilan Hasil ....................................................................... 49 IV.2. Desain Antarmuka ................................................................. 49 IV.2.1. Form Login ................................................................ 50 IV.2.2. Form Menu Utama...................................................... 50 IV.2.3. Form Data Karyawan .................................................. 51 IV.2.4. Form Penilaian ............................................................ 51 IV.2.5. Form Hasil Penilaian .................................................. 52 IV.2.6. Form Laporan ............................................................. 53 IV.3. Pembahasan ........................................................................... 54 IV.3.1. Teknik Pengujian Sistem ........................................... 54
IV.3.2. Hierarchy Pemberian Bonus Karyawan...................... 55 IV.4. Kelebihan Dan Kekurangan Sistem ....................................... 62 BAB V
: KESIMPULAN DAN SARAN .................................................... 63 V.1. Kesimpulan ............................................................................... 63 V.2. Saran ......................................................................................... 64
DAFTAR PUSTAKA LAMPIRAN
DAFTAR GAMBAR Gambar I.1. Prosedure Perancangan .................................................................... 5 Gambar II.1. Use Case Diagram ......................................................................... 22 Gambar II.2. Class Diagram .............................................................................. 23 Gambar II.3. Activity Diagram ............................................................................ 24 Gamabr II.4. Sequence Diagram ......................................................................... 24 Gambar III.1. Analisa Input Absensi Karyawan PT. Ariros Sejahtera Persada .. 26 Gambar III.2. FOD ( Flow Of Document ) .......................................................... 27 Gambar III.3. Analisa Input Absensi Karyawan PT. Ariros Sejahtera Persada .. 28 Gambar III.4. Use Case ........................................................................................ 31 Gambar III.5. Class Diagram ............................................................................... 32 Gambar III.6. Sequence Diagram Input Admin ................................................... 33 Gambar III.7. Sequence Diagram Proses Data Karyawan ................................... 34 Gambar III.8. Sequence Diagram Proses Data Penilaian .................................... 34 Gambar III.9. Sequence Diagram Proses Data Perhitungan Bonus ..................... 35 Gambar III.10. Activity Diagram Halaman Login Admin .................................. 36 Gambar III.11. Activity Diagram Halaman Data Karyawan ............................... 36 Gambar III.12. Activity Diagram Halaman Penilaian ......................................... 37 Gambar III.13. Activity Diagram Form Data Pemilihan Karyawan ................... 37 Gambar III.14. Activity Diagram Halaman Laporan ........................................... 38 Gambar III.15. Desain Output Data Karyawan .................................................. 39 Gambar III.16. Desain Output Data Penilaian .................................................... 39 Gambar III.17. Desain Output Data Perhitungan Bonus ..................................... 40 Gambar III.18. Desain Output Laporan .............................................................. 40
Gambar III.19. Rancangan Input Form Login ..................................................... 41 Gambar III.20. Rancangan Form Menu Utama ................................................... 41 Gambar III.21. Form Data Karyawan .................................................................. 42 Gambar III.22. Form Data Penilaian.................................................................... 43 Gambar III.23. Form Perhitungan Bonus ............................................................ 44 Gambar III.24. Entity Relationship Diagram ....................................................... 48 Gambar IV.1. Tampilan Form Login .................................................................. 50 Gambar IV.2. Tampilan Menu Utama ................................................................ 50 Gambar IV.3. Tampilan Form Data Kryawan .................................................... 51 Gambar IV.4. Tampila Form Penilaian................................................................ 52 Gambar IV.5. Tampilan Form Hasil Penilaian .................................................... 53 Gambar IV.6. Tampilan Form Laporan .............................................................. 54 Gambar IV.7. Hierarchy Bonus Karyawan .......................................................... 56 Gambar IV.8. Hierarchy Pemberian Bonus Karyawan Dengan Bobot Kriteria .. 59 Gambar IV.9. Hierarchy Pemberian Bonus Karyawan Dengan Bobot Kriteria dan Bobot Alternatif .................................................................... 61
DAFTAR TABEL
Tabel II.1. 3 NF / Third Normal Form ................................................................. 21 Tabel III.1.Data Karyawan ................................................................................. 45 Tabel III.2. Data Penilaian ................................................................................. 45 Tabel III.3. Kriteria ............................................................................................ 46 Tabel III.4. Laporan ........................................................................................... 46 Tabel III.5. Login ................................................................................................ 46 Tabel IV.1. Tabel Kriteria .................................................................................... 57 Tabel IV.2. Tabel SubKriteria Absensi................................................................ 57 Tabel IV.3. Tabel SubKriteria Kinerja Dan Etika ............................................... 57 Tabel IV.4. Tabel Matriks Perbandingan Berpasangan ....................................... 58 Tabel IV.5. Tabel Bobot Nilai Kriteria Absensi .................................................. 60 Tabel IV.6. Tabel Bobot Nilai Kriteria Kinerja ................................................... 60 Tabel VI.7. Tabel Bobot Nilai Kriteria Etika ...................................................... 60
DAFTAR LAMPIRAN
Lampiran-1
Listing Program
Lampiran-2
Surat Pengajuan Judul Skripsi
Lampiran-3
Formulir Pendaftaran Judul Skripsi
Lampiran-4
Surat Pernyataan Bersedia Membimbing Pembimbing I
Lampiran-5
Surat Pernyataan Bersedia Membimbing Pembimbing II
Lampiran-6
Surat Pernyataan Bersedia Membimbing Riset/Perusahaan
Lampiran-7
Formulir Pendaftaran Seminar Skripsi
Lampiran-8
Berita Acara Seminar Skripsi
Lampiran-9
Formulir Pendaftaran Sidang Skripsi
Lampiran-10 Surat Permohonan Izin melakukan Riset dari perusahaan Lampiran-11 Surat Keterangan selesai Riset dari perusahaan
DAFTAR PUSTAKA Kusrini. 2007. Konsep Dan Aplikasi Sistem Pendukung Keputusan. Yogyakarta: C.V Andi ofset. Monita, Dita. 2013. “Sistem Pendukung Keputusan Penerima Bantuan Langsung Tunai Dengan Menggunakan Metode Analytical Hierarcy Process”.
[email protected] (Vol : 111, No : 2, April 2013) Winarmo, Edy, dkk. 2009. Web Programming dengan Visual Basic 2010. Jakarta: PT Elex Media Komputindo.. Wahana Komputer, 2010,42. Pemograman Microsoft Visual Studio 2008, Client Server”. Andi Yogyakarta. Mulawarman, Haviluddin. 2011. ”Memahami Penggunaan UML (Unified Medelling Language)”.
[email protected] (Vol : 6, No : 1, Februari 2011).
LISTING PROGRAM Imports System.Data.SqlClient Public Class Formkaryawan Private Sub Formkaryawan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim da As New SqlDataAdapter("SELECT * FROM data_karyawan ORDER BY id_karyawan", cn) Dim tb As New DataTable da.Fill(tb) DGV.DataSource = tb End Sub Private Sub DGV_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV.CellClick txtNamaKaryawan.Text = DGV.Rows(e.RowIndex).Cells("nama_karyawan").Value.ToString ' txtbagian.Text = DGV.Rows(e.RowIndex).Cells("bagian").Value.ToString End Sub Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsert.Click Dim cn As New SqlConnection(strkoneksi) cn.Open() Dim cm As New SqlCommand("INSERT INTO data_karyawan(id_karyawan,nama_karyawan,jenis_kelamin,tgl_lahir,alamat) VALUES('" & Me.txtidkaryawan.Text & "','" & txtNamaKaryawan.Text & "', '" & Me.txtjeniskelamin.Text & "', '" & Me.txttgllahir.Value.ToString("MM/dd/yyyy") & "', '" & Me.txtalamat.Text & "')", cn) cm.ExecuteNonQuery() cm.Dispose() cn.Close() MsgBox("Data telah di input", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") Formkaryawan_Load(Me, e) 'btnClear_Click(Me, e) End Sub Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim cm As New SqlCommand("UPDATE data_karyawan SET nama_karyawan = '" & txtNamaKaryawan.Text & "', bagian = '" & txtBagian.Text & "' WHERE id_karyawan = " & DGV.SelectedRows(0).Cells("id_karyawan").Value.ToString, cn) cm.ExecuteNonQuery() cm.Dispose() cn.Close() MsgBox("Data sudah di perbaharui", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") Formkaryawan_Load(Me, e) 'btnClear_Click(Me, e) End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim cm As New SqlCommand("DELETE FROM data_karyawan WHERE id_karyawan = " & DGV.SelectedRows(0).Cells("id_karyawan").Value.ToString, cn) cm.ExecuteNonQuery() cm.Dispose() cn.Close() MsgBox("Data sudah dihapus", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") Formkaryawan_Load(Me, e) 'btnClear_Click(Me, e) End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ComboBox1.Text = "Nama" Then Dim cn As New SqlConnection(strkoneksi) cn.Open() Dim da As New SqlDataAdapter("SELECT * FROM data_karyawan where nama_karyawan = '" & Me.TextBox5.Text & "' ORDER BY id_karyawan", cn) Dim tb As New DataTable da.Fill(tb) DGV.DataSource = tb Else Dim cn As New SqlConnection(strkoneksi) cn.Open() Dim da As New SqlDataAdapter("SELECT * FROM data_karyawan where id_karyawan = '" & Me.TextBox5.Text & "' ORDER BY id_karyawan", cn) Dim tb As New DataTable da.Fill(tb) DGV.DataSource = tb End If
End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged End Sub End Class Imports System.Data.SqlClient Public Class FormDataPenilaian Dim tbalternatif As DataTable Dim tbkriteria As DataTable Private Sub FormAlternatifKriteria_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim daalternatif As New SqlDataAdapter("SELECT * FROM data_karyawan ORDER BY id_karyawan", cn) tbalternatif = New DataTable daalternatif.Fill(tbalternatif)
cmbAlternatif.DataSource = tbalternatif ' cmbAlternatif.DisplayMember = "nama_karyawan" 'cmbAlternatif.ValueMember = "id_karyawan" cmbAlternatif.DisplayMember = "nama_karyawan" cmbAlternatif.ValueMember = "id_karyawan" Dim dakriteria As New sqlDataAdapter("SELECT * FROM kriteria ORDER BY id_kriteria", cn) tbkriteria = New DataTable dakriteria.Fill(tbkriteria) cmbKriteria.DataSource = tbkriteria cmbKriteria.DisplayMember = "nama_kriteria" cmbKriteria.ValueMember = "id_kriteria" Dim da As New SqlDataAdapter("SELECT data_penilaian.id_data_penilaian, data_penilaian.id_karyawan, data_karyawan.nama_karyawan, data_penilaian.id_kriteria, kriteria.nama_kriteria, nilai FROM (data_penilaian LEFT JOIN data_karyawan ON data_penilaian.id_karyawan = data_karyawan.id_karyawan) LEFT JOIN kriteria ON data_penilaian.id_kriteria = kriteria.id_kriteria ORDER BY data_penilaian.id_karyawan, data_penilaian.id_kriteria", cn) ' Dim da As New SqlDataAdapter("SELECT data_penilaian.id_data_penilaian, data_karyawan.nama_karyawan, kriteria.nama_kriteria, nilai FROM (data_penilaian LEFT JOIN data_karyawan ON data_penilaian.id_karyawan = data_karyawan.id_karyawan) LEFT JOIN kriteria ON data_penilaian.id_kriteria = kriteria.id_kriteria ORDER BY data_penilaian.id_karyawan, data_penilaian.id_kriteria", cn) Dim tb As New DataTable da.Fill(tb) DGV.DataSource = tb 'btnClear_Click(Me, e) End Sub Private Sub DGV_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV.CellClick cmbAlternatif.SelectedValue = DGV.Rows(e.RowIndex).Cells("id_karyawan").Value.ToString cmbKriteria.SelectedValue = DGV.Rows(e.RowIndex).Cells("id_kriteria").Value.ToString txtNilai.Text = DGV.Rows(e.RowIndex).Cells("nilai").Value.ToString End Sub Private Sub DGV_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV.CellContentClick End Sub Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsert.Click Dim cn As New SqlConnection(strkoneksi) 'input nilai 1 cn.Open() Dim cm As New SqlCommand("INSERT INTO data_penilaian(id_karyawan, id_kriteria, nilai) VALUES('" & Me.cmbAlternatif.SelectedValue.ToString & "','1', " & Val(Me.TextBox2.Text) & ")", cn) cm.ExecuteNonQuery() cm.Dispose() cn.Close()
'MsgBox("Data sudah di input", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") 'FormAlternatifKriteria_Load(Me, e) 'input nilai2 cn.Open() Dim cm2 As New SqlCommand("INSERT INTO data_penilaian(id_karyawan, id_kriteria, nilai) VALUES('" & Me.cmbAlternatif.SelectedValue.ToString & "','2', " & Val(Me.TextBox3.Text) & ")", cn) cm2.ExecuteNonQuery() cm2.Dispose() cn.Close() ' MsgBox("Data sudah di input", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") ' FormAlternatifKriteria_Load(Me, e) 'input nilai3 cn.Open() Dim cm3 As New SqlCommand("INSERT INTO data_penilaian(id_karyawan, id_kriteria, nilai) VALUES('" & Me.cmbAlternatif.SelectedValue.ToString & "','3', " & Val(Me.TextBox4.Text) & ")", cn) cm3.ExecuteNonQuery() cm3.Dispose() cn.Close() MsgBox("Data sudah di input", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") FormAlternatifKriteria_Load(Me, e) End Sub Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim cm As New SqlCommand("UPDATE data_penilaian SET id_karyawan = '" & cmbAlternatif.SelectedValue.ToString & "',nilai = " & Val(Me.TextBox2.Text) & " WHERE id_karyawan = '" & Me.cmbAlternatif.SelectedValue.ToString & "' and id_kriteria = '1'", cn) cm.ExecuteNonQuery() cm.Dispose() cn.Close() cn.Open() Dim cm2 As New SqlCommand("UPDATE data_penilaian SET id_karyawan = '" & cmbAlternatif.SelectedValue.ToString & "',nilai = " & Val(Me.TextBox3.Text) & " WHERE id_karyawan = '" & Me.cmbAlternatif.SelectedValue.ToString & "' and id_kriteria = '2'", cn) cm2.ExecuteNonQuery() cm2.Dispose() cn.Close() cn.Open() Dim cm3 As New SqlCommand("UPDATE data_penilaian SET id_karyawan = '" & cmbAlternatif.SelectedValue.ToString & "',nilai = " & Val(Me.TextBox4.Text) & " WHERE id_karyawan = '" & Me.cmbAlternatif.SelectedValue.ToString & "' and id_kriteria = '3'", cn) cm3.ExecuteNonQuery() cm3.Dispose() cn.Close()
MsgBox("Data sudah diperbaharui", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") FormAlternatifKriteria_Load(Me, e) 'btnClear_Click(Me, e) End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim cm As New sqlCommand("DELETE FROM data_penilaian WHERE id_data_penilaian = " & DGV.SelectedRows(0).Cells("id_data_penilaian").Value.ToString, cn) cm.ExecuteNonQuery() cm.Dispose() cn.Close() MsgBox("Data sudah di hapus", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Sukses") FormAlternatifKriteria_Load(Me, e) 'btnClear_Click(Me, e) End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.Close() End Sub Private Sub cmbKriteria_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbKriteria.SelectedIndexChanged End Sub Private Sub cmbAlternatif_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbAlternatif.SelectedIndexChanged Me.TextBox1.Text = cmbAlternatif.SelectedValue.ToString End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.TextBox1.Text = cmbAlternatif.SelectedValue.ToString End Sub Private Sub TextBox2_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged End Sub Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim inilai As Integer inilai = Convert.ToInt16(Me.TextBox2.Text) If inilai >= 80 And inilai <= 100 Then Label8.Text = "Baik coy" ElseIf inilai <= 79 And inilai >= 60 Then Label8.Text = "Cukup coy" ElseIf inilai <= 59 Then Label8.Text = "Kurang coy"
End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ComboBox1.Text = "Nama" Then Dim cn As New SqlConnection(strkoneksi) cn.Open() Dim da As New SqlDataAdapter("SELECT data_penilaian.id_data_penilaian, data_penilaian.id_karyawan, data_karyawan.nama_karyawan, data_penilaian.id_kriteria, kriteria.nama_kriteria, nilai FROM (data_penilaian LEFT JOIN data_karyawan ON data_penilaian.id_karyawan = data_karyawan.id_karyawan) LEFT JOIN kriteria ON data_penilaian.id_kriteria = kriteria.id_kriteria where data_karyawan.nama_karyawan = '" & Me.TextBox5.Text & "' ORDER BY data_karyawan.nama_karyawan ", cn) ' Dim da As New SqlDataAdapter("SELECT * FROM data_karyawan where nama_karyawan = '" & Me.TextBox5.Text & "' ORDER BY id_karyawan", cn) Dim tb As New DataTable da.Fill(tb) DGV.DataSource = tb Else Dim cn As New SqlConnection(strkoneksi) cn.Open() Dim da As New SqlDataAdapter("SELECT data_penilaian.id_data_penilaian, data_penilaian.id_karyawan, data_karyawan.nama_karyawan, data_penilaian.id_kriteria, kriteria.nama_kriteria, nilai FROM (data_penilaian LEFT JOIN data_karyawan ON data_penilaian.id_karyawan = data_karyawan.id_karyawan) LEFT JOIN kriteria ON data_penilaian.id_kriteria = kriteria.id_kriteria where data_karyawan.id_karyawan = '" & Me.TextBox5.Text & "' ORDER BY data_karyawan.nama_karyawan ", cn) ' Dim da As New SqlDataAdapter("SELECT * FROM data_karyawan where id_karyawan = '" & Me.TextBox5.Text & "' ORDER BY id_karyawan", cn) Dim tb As New DataTable da.Fill(tb) DGV.DataSource = tb End If End Sub End Class Imports System.Data.SqlClient Public Class FormAnalisa Dim alternatif() As Object '= {"Galaxy", "Iphone", "BB", "Lumia"} Dim kriteria() As Object '= {"Harga", "Kualitas", "Fitur", "Populer", "Purna Jual", "Populer"} Dim costbenefit() As Object '= {"cost", "benefit", "benefit", "benefit", "benefit", "benefit"} Dim alternatifkriteria(,) As Object '= {{3500, 70, 10, 80, 3000, 36}, {4500, 90, 10, 60, 2500, 48}, {4000, 80, 9, 90, 2000, 48}, {4000, 70, 8, 50, 1500, 60}} Dim perbandingankriteria(,) As Object '= {{1, 5, 5, 5, 3, 3}, {0.2, 1, 1, 1, 0.333333333, 0.333333333}, {0.2, 1, 1, 1, 0.333333333, 0.333333333}, {0.2, 1, 1, 1, 0.333333333, 0.333333333}, {0.333333333, 3, 3, 3, 1, 1}, {0.333333333, 3, 3, 3, 1, 1}} Dim jk() As Object Dim nk(,) As Object Dim jnk() As Object Dim w() As Object Dim kw() As Object Dim t As Object Dim ri As Object Dim ci As Object Dim cr As Object Dim nilaimin() As Object Dim minkar(,) As Object Dim jmlmin()
Dim normmin(,) Dim hsl() Dim Dim Dim Dim
hasilranking() As Object alternatifranking() As Object cmb() As ComboBox lbl() As Label
Sub tampilLV(ByVal lv As ListView, ByVal arrdata(,) As Object) lv.Items.Clear() lv.Columns.Clear() Dim i As Integer Dim j As Integer For i = 0 To UBound(arrdata, 2) lv.Columns.Add("") Next For i = 0 To UBound(arrdata) Dim str(UBound(arrdata, 2)) As String For j = 0 To UBound(arrdata, 2) str(j) = arrdata(i, j).ToString Next lv.Items.Add(New ListViewItem(str)) Next End Sub Sub tampilLVbaris(ByVal lv As ListView, ByVal arrdata() As Object) lv.Items.Clear() lv.Columns.Clear() Dim i As Integer For i = 0 To UBound(arrdata) lv.Columns.Add("") Next Dim str(UBound(arrdata)) As String For i = 0 To UBound(arrdata) str(i) = arrdata(i).ToString Next lv.Items.Add(New ListViewItem(str)) End Sub Sub tampilLVkolom(ByVal lv As ListView, ByVal arrdata() As Object) lv.Items.Clear() lv.Columns.Clear() Dim i As Integer lv.Columns.Add("") For i = 0 To UBound(arrdata) Dim str(0) As String str(0) = arrdata(i).ToString lv.Items.Add(New ListViewItem(str)) Next End Sub Private Sub FormAnalisa_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer Dim j As Integer Dim k As Integer Dim cn As New sqlConnection(strkoneksi) cn.Open() Dim daalternatif As New SqlDataAdapter("SELECT * FROM data_karyawan ORDER BY id_karyawan", cn) Dim tbalternatif As New DataTable daalternatif.Fill(tbalternatif) ReDim alternatif(tbalternatif.Rows.Count - 1) For i = 0 To tbalternatif.Rows.Count - 1 alternatif(i) = tbalternatif.Rows(i)("nama_karyawan").ToString Next Dim dakriteria As New sqlDataAdapter("SELECT * FROM kriteria ORDER BY id_kriteria", cn) Dim tbkriteria As New DataTable dakriteria.Fill(tbkriteria) ReDim kriteria(tbkriteria.Rows.Count - 1) ReDim costbenefit(tbkriteria.Rows.Count - 1) For i = 0 To tbkriteria.Rows.Count - 1 kriteria(i) = tbkriteria.Rows(i)("nama_kriteria").ToString costbenefit(i) = tbkriteria.Rows(i)("costbenefit").ToString Next cn.Close() ReDim alternatifkriteria(tbalternatif.Rows.Count - 1, tbkriteria.Rows.Count 1) For i = 0 To tbalternatif.Rows.Count - 1 For j = 0 To tbkriteria.Rows.Count - 1 cn.Open() Dim cmalternatifkriteria As New SqlCommand("SELECT * FROM data_penilaian WHERE id_karyawan = " & Val(tbalternatif.Rows(i)("id_karyawan").ToString) & " AND id_kriteria = " & Val(tbkriteria.Rows(j)("id_kriteria").ToString), cn) Dim rdalternatifkriteria As SqlDataReader = cmalternatifkriteria.ExecuteReader If (rdalternatifkriteria.Read) Then alternatifkriteria(i, j) = rdalternatifkriteria.Item("nilai") cn.Close() Next Next k = -1 For i = 0 To UBound(kriteria) For j = 0 To UBound(kriteria) If (i < j) Then k = k + 1 ReDim Preserve lbl(k) lbl(k) = New Label lbl(k).Text = kriteria(i) & " - " & kriteria(j) lbl(k).Visible = True lbl(k).Top = 45 + (k * 30) lbl(k).Left = 10 lbl(k).Width = 120 Me.Controls.Add(lbl(k)) ReDim Preserve cmb(k) cmb(k) = New ComboBox cmb(k).Visible = True
kriteria(j) & " kriteria(j) & " kriteria(j) & " kriteria(j) & " kriteria(j) & " kriteria(j) & " kriteria(i) & " kriteria(i) & " kriteria(i) & " kriteria(i) & " kriteria(i) & "
cmb(k).Top = 45 + (k * 30) cmb(k).Left = 130 cmb(k).Width = 250 cmb(k).Items.Add(kriteria(i) (Nilai=1)") cmb(k).Items.Add(kriteria(i) (Nilai=3)") cmb(k).Items.Add(kriteria(i) (Nilai=5)") cmb(k).Items.Add(kriteria(i) (Nilai=7)") cmb(k).Items.Add(kriteria(i) (Nilai=9)") cmb(k).Items.Add(kriteria(i) (Nilai=2)") cmb(k).Items.Add(kriteria(j) (Nilai=1/3)") cmb(k).Items.Add(kriteria(j) (Nilai=1/5)") cmb(k).Items.Add(kriteria(j) (Nilai=1/7)") cmb(k).Items.Add(kriteria(j) (Nilai=1/9)") cmb(k).Items.Add(kriteria(j) (Nilai=1/2)") Me.Controls.Add(cmb(k)) End If
& " Sama Penting Dengan " & & " Sedikit Lebih Penting Dari " & & " Lebih Penting Dari " & & " Lebih Mutlak Penting Dari " & & " Mutlak Penting Dari " & & " Nilai Berdekatan Dengan " & & " Sama Penting Dengan " & & " Sedikit Lebih Penting Dari " & & " Lebih Penting Dari " & & " Mutlak Penting Dari " & & " Nilai Berdekatan Dengan " &
Next Next cmb(0).SelectedIndex = 2 cmb(1).SelectedIndex = 2 cmb(2).SelectedIndex = 2 ' cmb(3).SelectedIndex = 1 ' cmb(4).SelectedIndex = 1 ' cmb(5).SelectedIndex = 0 ' cmb(6).SelectedIndex = 0 ' cmb(7).SelectedIndex = 6 ' cmb(8).SelectedIndex = 6 ' cmb(9).SelectedIndex = 0 ' cmb(10).SelectedIndex = 6 ' cmb(11).SelectedIndex = 6 'cmb(12).SelectedIndex = 6 'cmb(13).SelectedIndex = 6 'cmb(14).SelectedIndex = 0 End Sub Private Sub btnPerhitungan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPerhitungan.Click Me.Height = 754 Me.Width = Screen.PrimaryScreen.WorkingArea.Width Me.Top = 0 Me.Left = 0 End Sub Private Sub btnHitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHitung.Click Dim i As Integer Dim j As Integer Dim k As Integer
k = -1 ReDim perbandingankriteria(UBound(kriteria), UBound(kriteria)) For i = 0 To UBound(kriteria) For j = 0 To UBound(kriteria) If (i < j) Then k = k + 1 Dim nilai As Object = 0 If (cmb(k).SelectedIndex = 0) Then nilai = 1 ElseIf (cmb(k).SelectedIndex = 1) Then nilai = 3 ElseIf (cmb(k).SelectedIndex = 2) Then nilai = 5 ElseIf (cmb(k).SelectedIndex = 3) Then nilai = 7 ElseIf (cmb(k).SelectedIndex = 4) Then nilai = 9 ElseIf (cmb(k).SelectedIndex = 5) Then nilai = 2 ElseIf (cmb(k).SelectedIndex = 6) Then nilai = 1 / 3 ElseIf (cmb(k).SelectedIndex = 7) Then nilai = 1 / 5 ElseIf (cmb(k).SelectedIndex = 8) Then nilai = 1 / 7 ElseIf (cmb(k).SelectedIndex = 9) Then nilai = 1 / 9 ElseIf (cmb(k).SelectedIndex = 10) Then nilai = 1 / 2 End If perbandingankriteria(i, perbandingankriteria(i, perbandingankriteria(j, perbandingankriteria(j,
j) i) j) i)
= = = =
nilai 1 1 1 / nilai
End If Next Next tampilLV(lvPerbandinganKriteria, perbandingankriteria) ReDim jk(UBound(kriteria)) For i = 0 To UBound(kriteria) jk(i) = 0 For j = 0 To UBound(kriteria) jk(i) += perbandingankriteria(j, i) Next Next ReDim nk(UBound(kriteria), UBound(kriteria)) For i = 0 To UBound(kriteria) For j = 0 To UBound(kriteria) nk(i, j) = perbandingankriteria(i, j) / jk(j) Next Next ReDim jnk(UBound(kriteria)) For i = 0 To UBound(kriteria) jnk(i) = 0 For j = 0 To UBound(kriteria) jnk(i) += nk(i, j)
Next Next ReDim w(UBound(kriteria)) For i = 0 To UBound(kriteria) w(i) = jnk(i) / kriteria.Length Next ReDim kw(UBound(kriteria)) For i = 0 To UBound(kriteria) kw(i) = 0 For j = 0 To UBound(kriteria) kw(i) += perbandingankriteria(i, j) * w(j) Next Next t = 0 For i = 0 To UBound(kriteria) t += kw(i) / w(i) Next t = t / kriteria.Length ci = (t - kriteria.Length) / (kriteria.Length - 1) If (kriteria.Length = 3) Then ri = 0.58 ElseIf (kriteria.Length = 4) Then ri = 0.9 ElseIf (kriteria.Length = 5) Then ri = 1.12 ElseIf (kriteria.Length = 6) Then ri = 1.24 ElseIf (kriteria.Length <= 2) Then ri = 0.01 ElseIf (kriteria.Length >= 3) Then ri = 1.32 End If cr = ci / ri ReDim nilaimin(UBound(kriteria)) For i = 0 To UBound(kriteria) nilaimin(i) = 1000000 If costbenefit(0) = "cost" Then For j = 0 To UBound(alternatif) If (nilaimin(i) > alternatifkriteria(j, nilaimin(i) = alternatifkriteria(j, End If Next Else nilaimin(i) = -1000000 For j = 0 To UBound(alternatif) If (nilaimin(i) < alternatifkriteria(j, nilaimin(i) = alternatifkriteria(j, End If Next End If Next ReDim minkar(UBound(alternatif), UBound(kriteria)) For i = 0 To UBound(alternatif)
i)) Then i)
i)) Then i)
For j = 0 To UBound(kriteria) If costbenefit(j) = "cost" Then minkar(i, j) = nilaimin(j) / alternatifkriteria(i, j) Else minkar(i, j) = alternatifkriteria(i, j) / nilaimin(j) End If Next Next ReDim jmlmin(UBound(kriteria)) For i = 0 To UBound(kriteria) jmlmin(i) = 0 For j = 0 To UBound(alternatif) jmlmin(i) += minkar(j, i) Next Next ReDim normmin(UBound(alternatif), UBound(kriteria)) For i = 0 To UBound(alternatif) For j = 0 To UBound(kriteria) normmin(i, j) = minkar(i, j) / jmlmin(j) Next Next ReDim hsl(UBound(alternatif)) For i = 0 To UBound(alternatif) hsl(i) = 0 For j = 0 To UBound(kriteria) hsl(i) += normmin(i, j) * w(j) Next Next ReDim alternatifranking(UBound(alternatif)) ReDim hasilranking(UBound(alternatif)) For i = 0 To UBound(alternatif) hasilranking(i) = hsl(i) alternatifranking(i) = alternatif(i) Next For i = 0 To UBound(alternatif) For j = i To UBound(alternatif) If (hasilranking(j) > hasilranking(i)) Then Dim tmphasil As Object = hasilranking(i) Dim tmpalternatif As Object = alternatifranking(i) hasilranking(i) = hasilranking(j) alternatifranking(i) = alternatifranking(j) hasilranking(j) = tmphasil alternatifranking(j) = tmpalternatif End If Next Next tampilLVbaris(lvAlternatif, alternatif) tampilLVbaris(lvKriteria, kriteria) tampilLVbaris(lvCostBenefit, costbenefit) tampilLV(lvAlternatifKriteria, alternatifkriteria) tampilLV(lvPerbandinganKriteria, perbandingankriteria) tampilLVbaris(lvJk, jk) tampilLV(lvNk, nk) tampilLVkolom(lvJnk, jnk)
tampilLVkolom(lvW, w) tampilLVkolom(lvKw, kw) lblT.Text = "t = " & t lblCi.Text = "ci = " & ci lblCr.Text = "cr = " & cr tampilLVkolom(lvNilaiMin, nilaimin) tampilLV(lvMinKar, minkar) tampilLVkolom(lvJmlMin, jmlmin) tampilLV(lvNormMin, normmin) tampilLVkolom(lvHasil, hsl) tampilLVkolom(lvHasilRanking, hasilranking) tampilLVkolom(lvAlternatifRanking, alternatifranking) lvHasilAnalisa.Items.Clear() lvHasilAnalisa.Columns.Clear() lvHasilAnalisa.Columns.Add("No. Urut") lvHasilAnalisa.Columns.Add("Nama Karyawan") lvHasilAnalisa.Columns.Add("Jumlah Nilai") For i = 0 To UBound(hasilranking) Dim str(2) As String str(0) = (i + 1).ToString str(1) = alternatifranking(i).ToString str(2) = hasilranking(i).ToString lvHasilAnalisa.Items.Add(New ListViewItem(str)) Next
lbHasil.Text = "Karyawan Terbaik = " & alternatifranking(0).ToString & " dengan Nilai Terbesar = " & hasilranking(0).ToString ' Me.Height = 754 'Me.Width = 410 End Sub End Class