Deskripsi Latihan_14_36110038
Form Latihan_14 terdapat tujuh
object yaitu Label, Textbox, Button, DateTimePicker, DataGridView, RadioButton dan
GroupBox:
Object Label
Terdapat empat belas label (yang
bertuliskan Gaji Orang Tua Lebih Dari, Bukan Kelas, Tanggal Lahir sebelum, nama
memiliki unsur dari masing-masing GroupBox filter berdasarkan dan Filter dengan
menggabungkan, Gaji Ortu>=6000000, Gaji Ortu>=5000000, Gaji
Ortu>=4000000, Gaji Ortu>=3000000, Gaji Ortu>=2000000 dan selain itu)
Object Text Box
Terdapat enam textbox status input
digunakan untuk memasukkan nilai/text yang bertuliskan Gaji Orang Tua Lebih
Dari, Bukan Kelas, nama memiliki unsur dari masing-masing GroupBox filter
berdasarkan dan Filter dengan menggabungkan.
Object Button
Terdapat dua object button (filter
dan atur warna). Tombol filter digunakan untuk melakukan filter pada data yang
ada di dalam object DataGridView berdasarkan Gaji Orang Tua Lebih Dari, Bukan
Kelas, Tanggal Lahir sebelum dan nama memiliki unsur sesuai yang diinput. Tombol
atur warna digunakan untuk menampilkan menampilkan warna yang sesuai menurut
perintah/rumus berdasarkan Gaji Ortu>=6000000, Gaji Ortu>=5000000, Gaji
Ortu>=4000000, Gaji Ortu>=3000000, Gaji Ortu>=2000000 dan selain itu
yang diinginkan.
Object Date TimePicker
Terdapat
dua datetimepicker yang digunakan untuk memasukkan date/tanggal.
Object Data GridView
Terdapat satu data gridview yang
digunakan untuk menampilkan data mahasiswa baru Politeknik Negeri Ujung Pandang
Tahun Ajaran 2012-2013.
Object RadioButton
Terdapat empat object RadioButton
(stambuk, kelas(besar->kecil), kelas(kecil->besar) tanggal
lahir(kecil->besar) dan gaji orang tua (besar->kecil)). Object
RadioButton digunakan untuk mengurutkan dara berdasarkan yang diberi tanda pada
RadioButtonnya.
Object GroupBoxt
Terdapat empat GroupBox (urutkan
berdasarkan, filter berdasarkan, filter dengan menggabungkan dan pengaturan
warna) digunakan untuk mengelompokkan object-object yang lain.
Script Unique
Button "filter" (filter_36110038)
view.RowFilter = "[GAJI ORTU]>" & Val(gj2_36110038.Text) & " AND [KELAS]<>'" & kls2_36110038.Text & "'" & " AND [TANGGAL LAHIR]<#" & tgl2_36110038.Value.Month & "/" & tgl2_36110038.Value.Day & "/" & tgl2_36110038.Value.Year & "#" & " AND NAMA LIKE '%" & nm2_36110038.Text & "%'"
view.RowFilter = "[GAJI ORTU]>" & Val(gj2_36110038.Text) & " AND [KELAS]<>'" & kls2_36110038.Text & "'" & " AND [TANGGAL LAHIR]<#" & tgl2_36110038.Value.Month & "/" & tgl2_36110038.Value.Day & "/" & tgl2_36110038.Value.Year & "#" & " AND NAMA LIKE '%" & nm2_36110038.Text & "%'"
Button "atur warna" (aturwarna_36110038)
For Each dgv As
DataGridViewRow In dgv_36110038.Rows
If
dgv.Cells("Gaji Ortu").Value >
6000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Red
ElseIf
dgv.Cells("Gaji Ortu").Value >
5000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Crimson
ElseIf
dgv.Cells("Gaji Ortu").Value >
4000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Bisque
ElseIf
dgv.Cells("Gaji Ortu").Value >
3000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Brown
ElseIf
dgv.Cells("Gaji Ortu").Value >
2000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Chocolate
Else
dgv.DefaultCellStyle.BackColor
= Color.CornflowerBlue
End
If
Next
Even
filter_36110038.Click
aturwarna_36110038.Click
Prosedur penyelesaian
1.
Buka Project_36110038 yang telah
dibuat sebelumnya.
2.
Buka visual basic Kumpulan_Latihan_36110038
yang telah dibuat sebelumnya.
3.
Buat form baru dengan nama
Latihan_14_36110038 sesuai form dibawah ini.
4. Ganti
semua nama objek yang ada selain label menggunakan "Properties
Window" sesuai dengan yang diinginkan dengan menambahkan stambuk
dibelakang nama obyek.
5.
Klik 2x pada kotak design untuk
membuka lembar VB untuk menuliskan rumusnya. Masukkan rumus berikut untuk
menyelesaikan Latihan_14
Public Class Latihan_14_36110038
Dim table As New DataTable
Dim view As New DataView
Private Sub Latihan_14_36110038_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
table.Columns.Add(New DataColumn("Stambuk",
GetType(String)))
table.Columns.Add(New DataColumn("Nama",
GetType(String)))
table.Columns.Add(New DataColumn("Jenis
Kelamin", GetType(String)))
table.Columns.Add(New DataColumn("Tanggal
Lahir", GetType(Date)))
table.Columns.Add(New DataColumn("Gaji
OrTu", GetType(Integer)))
table.Columns.Add(New DataColumn("Kelas",
GetType(String)))
table.Rows.Add("46112003",
"Nurawalia M.", "P", "12/04/1994",
3000000, "1AD4")
table.Rows.Add("46112023",
"Puspita Susilawati Ridjal", "P", "01/01/1994",
4000000, "1AD4")
table.Rows.Add("46112018",
"Rose Anne Tarida Situmorang", "P", "12/14/1994",
5000000, "1AD4")
table.Rows.Add("46112004",
"Siti Khaerunnisa", "P", "03/28/1994",
1000000, "1AD4")
table.Rows.Add("46112015",
"Irmayanti", "P", "09/23/1994",
1000000, "1AD4")
table.Rows.Add("46112011",
"Delsi Tifani Lan", "P", "12/24/1994",
2000000, "1AD4")
table.Rows.Add("46112027",
"Reny Rita Waty Djafar", "P", "07/26/1993",
3000000, "1AD4")
table.Rows.Add("46112002",
"Dewi Sartika", "P", "02/10/1994",
1000000, "1AD4")
table.Rows.Add("46112019",
"Anita Rahmah Muhtadin", "P", "12/07/1994",
5000000, "1AD4")
table.Rows.Add("46112021",
"Rafidah", "P", "6 / 5 /
1994", 500000, "1AD4")
table.Rows.Add("46112009",
"Eka Yuli Astuti", "P", "08/07/1994",
2000000, "1AD4")
table.Rows.Add("46112025",
"Fitri Amalia Islamiati", "P", "03/26/1995",
4000000, "1AD4")
table.Rows.Add("46112014",
"Mariana.", "P", "06/22/1994",
1000000, "1AD4")
table.Rows.Add("46112013",
"A. Muh. Lutfi Ahmad", "L", "10/10/1993",
4000000, "1AD4")
table.Rows.Add("46112008",
"Nanda Ardilia Pratama", "L", "08/01/1994",
1000000, "1AD4")
table.Rows.Add("46112022",
"Liliani Paelongan", "P", "05/25/1994",
3000000, "1AD4")
table.Rows.Add("46112007",
"Andi Rabiah", "L", "09/07/1994",
1000000, "1AD4")
table.Rows.Add("46112001",
"Rizka Awalia Mustakim", "P", "10/07/1994",
3000000, "1AD4")
table.Rows.Add("46112005",
"Mardhotillah", "P", "01/13/1994",
3000000, "1AD4")
table.Rows.Add("46112017",
"Camelia Indulgenssya Gundung", "P", "09/14/1994",
2000000, "1AD4")
table.Rows.Add("46112028",
"Nur Salim Rusdi", "L", "04/12/1994",
1500000, "1AD4")
table.Rows.Add("46112026",
"Muhammad Khaidir", "L", "12/26/1993",
3000000, "1AD4")
table.Rows.Add("46112020",
"Sukriani Karunia Rahma", "P", "12/01/1994",
3000000, "1AD4")
table.Rows.Add("46112006",
"Rezky Tri Utami", "P", "07/03/1994",
3000000, "1AD4")
table.Rows.Add("46112029",
"Azwar Arfah", "L", "04/03/1994",
3000000, "1AD4")
table.Rows.Add("46112016", "Dyah Sukma Anggraini", "P", "05/10/1994",
3500000, "1AD4")
table.Rows.Add("46112010",
"Nur Indah Purnamasari", "P", "07/22/1994",
2500000, "1AD4")
table.Rows.Add("46112012",
"Nurul Qadri Musra", "L", "08/24/1994",
3000000, "1AD4")
table.Rows.Add("46112055",
"Reni Anggraeni", "P", "10/12/1994",
1500000, "1B-D4")
table.Rows.Add("46112042",
"Faradhiba Zainal Putri", "P", "12/04/1993",
3000000, "1B-D4")
table.Rows.Add("46112054",
"Rahmi Ani", "P", "11/30/1994",
2000000, "1B-D4")
table.Rows.Add("46112043",
"Remon Agit Rimang", "L", "01/06/1995",
3000000, "1B-D4")
table.Rows.Add("46112032",
"Abd. Rahman", "L", "10/08/1994",
1500000, "1B-D4")
table.Rows.Add("46112057",
"I Ketut Yuda Sadpwa", "L", "05/02/1993",
4500000, "1B-D4")
table.Rows.Add("46112037",
"Herianto", "L", "12/08/1993",
3000000, "1B-D4")
table.Rows.Add("46112058",
"citra amalia ramadhani", "L", "02/16/1995",
3000000, "1B-D4")
table.Rows.Add("46112050",
"Andi Akbar", "L", "11/26/1994",
2000000, "1B-D4")
table.Rows.Add("46112034",
"Gamaliel Giovani Rafael Nong", "L", "08/06/1993",
3700000, "1B-D4")
table.Rows.Add("46112047",
"Hasmawati", "P", "11/22/1994",
5000000, "1B-D4")
table.Rows.Add("46112038",
"Viorensi S", "P", "10/13/1994",
2000000, "1B-D4")
table.Rows.Add("46112046",
"Andini Hayrunnisyah", "P", "06/27/1994",
1500000, "1B-D4")
table.Rows.Add("46112031",
"Irmayanti", "P", "05/02/1994",
1000000, "1B-D4")
table.Rows.Add("46112039",
"Carissa Evan Anthen", "P", "10/23/1994",
6000000, "1B-D4")
table.Rows.Add("46112052",
"Aprianto Sandy", "L", "04/11/1993",
3000000, "1B-D4")
table.Rows.Add("46112049",
"Muhammad Farid Syah", "L", "01/20/1995",
5000000, "1B-D4")
table.Rows.Add("46112033",
"Maulanan Ibrahim", "L", "04/10/1994",
1000000, "1B-D4")
table.Rows.Add("46112035",
"Herpita Tohura", "P", "10/24/1993",
700000, "1B-D4")
table.Rows.Add("46112048",
"Udin Pranata", "L", "01/29/1993",
1000000, "1B-D4")
table.Rows.Add("46112051",
"Afrisca Fraktiani Rante", "P", "04/13/1995",
5000000, "1B-D4")
table.Rows.Add("46112056",
"Kartini Widyasita", "P", "04/21/1993",
4650000, "1B-D4")
table.Rows.Add("46112045",
"Abdul Qawwam Nurjaya", "L", "11/26/1994",
3500000, "1B-D4")
table.Rows.Add("46112040",
"Tommy Paunganan", "L", "02/22/1993",
2000000, "1B-D4")
table.Rows.Add("46112053",
"Khusnul Khatimah A", "P", "08/27/1994",
3000000, "1B-D4")
table.Rows.Add("46112041",
"Nida Hazimah Ulfah", "P", "09/24/1995",
5000000, "1B-D4")
table.Rows.Add("46112044",
"Ulfah Nas", "P", "01/26/1994",
5000000, "1B")
table.Rows.Add("46112036",
"Hasmiati Hajar", "P", "05/17/1994",
5000000, "1B-D4")
table.Rows.Add("36112001",
"Fitri", "P",
"10/20/1994", 5000000, "1A-D3")
table.Rows.Add("36112003",
"Fathin Ammar Asidik", "L", "06/29/1994",
6800000, "1A-D3")
table.Rows.Add("36112016",
"Andi Jusma Nilam Sari", "P", "09/02/1994",
10000000, "1A-D3")
table.Rows.Add("36112006",
"Izmi Istiqamah", "P", "11/04/1994",
7000000, "1A-D3")
table.Rows.Add("36112007",
"Imran Novrin Ruslim", "L", "11/21/1994",
1000000, "1A-D3")
table.Rows.Add("36112008",
"Adbul Malik", "L", "11/09/1993",
1000000, "1A-D3")
table.Rows.Add("36112011",
"Zulfitra Qadar Yasin", "L", "03/10/1994",
10000000, "1A-D3")
table.Rows.Add("36112020",
"Bernard Talebong", "P", "10/01/1994",
10000000, "1A-D3")
table.Rows.Add("36112024",
"Syahrul Kamal", "L", "10/18/1994",
10000000, "1A-D3")
table.Rows.Add("36112010",
"Yulianti", "P", "09/28/1994",
1000000, "1A-D3")
table.Rows.Add("36112012",
"Sri Aprianti", "P", "04/05/1994",
4000000, "1A-D3")
table.Rows.Add("36112013", "Noviantri Paembonan", "P", "11/19/1994",
6000000, "1A-D3")
table.Rows.Add("36112018",
"Kurniawati", "P", "10/11/1994",
2000000, "1A-D3")
table.Rows.Add("36112017",
"Dana Abrian", "L", "10/05/1994",
5000000, "1A-D3")
table.Rows.Add("36112023",
"Andi Arhami Hamzah", "P", "06/28/1994",
10000000, "1A-D3")
table.Rows.Add("36112059",
"Ummul Hayyul Qayyum", "P", "12/01/1993",
3500000, "1A-D3")
table.Rows.Add("36112027",
"Nurul Rezki Susanti", "P", "09/24/1994",
5000000, "1A-D3")
table.Rows.Add("36112005",
"Mawar Aztanti", "P", "06/01/1993",
4000000, "1A-D3")
table.Rows.Add("36112022",
"Rismawati", "P", "09/07/1994",
900000, "1A-D3")
table.Rows.Add("36112004",
"Endah Mariadi", "P", "11/07/1994",
7500000, "1A-D3")
table.Rows.Add("36112026",
"Melinda Rizkawati", "P", "05/07/1994",
2000000, "1A-D3")
table.Rows.Add("36112025",
"Ivana Olivia Aser", "P", "01/14/1993",
6000000, "1A-D3")
table.Rows.Add("36112021",
"Sulaipah", "P", "09/28/1994",
1000000, "1A-D3")
table.Rows.Add("36112061",
"Rahmat Adi Pratama", "L", "04/21/1994",
10000000, "1A-D3")
table.Rows.Add("36112060",
"Nita", "P",
"01/04/1995", 2500000, "1A-D3")
table.Rows.Add("36112019",
"Kharisma Yusuf", "P", "06/14/1994",
4000000, "1A-D3")
table.Rows.Add("36112014",
"A. Rahmawaty", "P", "04/04/1994",
5000000, "1A-D3")
table.Rows.Add("36112015",
"Danela Mangintek", "P", "11/06/1994",
3000000, "1A-D3")
table.Rows.Add("36112009",
"Rahmaniah", "P", "01/19/1994",
1000000, "1A-D3")
table.Rows.Add("36112038",
"andri prianto tukan", "L", "04/26/1994",
2000000, "1B D-3")
table.Rows.Add("36112057",
"Reenaldy Alchudri Azsagaf", "L", "05/03/1994",
10000000, "1B D-3")
table.Rows.Add("36112039",
"Andi Syahril", "L", "10/02/1994",
2000000, "1B D-3")
table.Rows.Add("36112051",
"Muhammad Adhe Anugrah", "L", "08/31/1993",
5000000, "1B D-3")
table.Rows.Add("36112042",
"Sukmawati Amir", "P", "04/13/1994",
6000000, "1B D-3")
table.Rows.Add("36112043",
"Dian Eka Puteri", "P", "11/11/1993",
1000000, "1B D-3")
table.Rows.Add("36112048",
"Tri Wahyuni", "P", "11/11/1994",
"800000", "1B
D-3")
table.Rows.Add("36112047",
"A. Dian Pelita Waty", "P", "05/05/1994",
3000000, "1B D-3")
table.Rows.Add("36112056",
"Mu'minat Nur", "P", "05/17/1995",
5000000, "1B D-3")
table.Rows.Add("36112058",
"Andi Anggi Fadliyah", "P", "08/15/1994",
1500000, "1B D-3")
table.Rows.Add("36112033",
"A. Syasya Annisa Ausan", "P", "08/08/1994",
7000000, "1B D-3")
table.Rows.Add("36112044",
"Muhammad Fachri Sani", "L", "02/02/1994",
5000000, "1B D-3")
table.Rows.Add("36112053",
"Resky Yonada Ahmad", "P", "03/22/1994",
1500000, "1B D-3")
table.Rows.Add("36112029",
"Trinayanti", "P", "06/03/1992",
3000000, "1B D-3")
table.Rows.Add("36112041",
"Musyarafah Asis", "L", "07/13/1994",
6000000, "1B D-3")
table.Rows.Add("36112055",
"Achmad Rezky Satria Perdana", "L", "12/17/1993",
3000000, "1B D-3")
table.Rows.Add("36112028",
"Fibra Yoseph P.", "P", "03/27/1995",
6000000, "1B D-3")
table.Rows.Add("36112045",
"Ibnu Affan Al-Mufar'id", "L", "08/05/1994",
8000000, "1B D-3")
table.Rows.Add("36112030",
"Sri Widya Ayu Wandini", "P", "06/01/1994",
5000000, "1B D-3")
table.Rows.Add("36112046",
"Sri Wahyuni Hafid", "P", "12/25/1994",
11000000, "1B D-3")
table.Rows.Add("36112032",
"Rosita Satri", "P", "12/06/1994",
3000000, "1B D-3")
table.Rows.Add("36112052",
"Sabri", "L",
"07/24/1993", 700000, "1B D-3")
table.Rows.Add("36112049",
"Alfin Riani Bandaso", "P", "04/11/1994",
3000000, "1B D-3")
table.Rows.Add("36112036",
"Nurmilasari", "P", "07/06/1993",
200000, "1B D-3")
table.Rows.Add("36112035",
"Tri Arismunandar", "L", "12/09/1993",
1000000, "1B D-3")
table.Rows.Add("36112031",
"Nur Indahsari Idris", "P", "08/28/1994",
5000000, "1B D-3")
table.Rows.Add("36112037",
"Ismawati", "P", "08/01/1994",
900000, "1B D-3")
table.Rows.Add("36112034",
"Rezky Arianti", "P", "01/27/1994",
300000, "1B D-3")
table.Rows.Add("36112002",
"Artis Susan", "P", "10/29/1993",
5000000, "1B D-3")
table.Rows.Add("36112054",
"Ade Apriathis Rantelino", "L", "04/27/1994",
3000000, "1B D-3")
view = table.DefaultView
dgv_36110038.DataSource = view
End Sub
Private Sub stb_36110038_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
stb_36110038.CheckedChanged
If
stb_36110038.Checked = True Then
view.Sort = "Stambuk"
End If
End Sub
Private Sub klsBK_36110038_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles klsBK_36110038.CheckedChanged
If
klsBK_36110038.Checked = True Then
view.Sort = "Kelas desc"
End If
End Sub
Private Sub klsKBtglKB_36110038_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles klsKBtglKB_36110038.CheckedChanged
If
klsKBtglKB_36110038.Checked = True Then
view.Sort = "kelas asc, tanggal lahir asc"
End If
End Sub
Private Sub gjBK_36110038_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
gjBK_36110038.CheckedChanged
If
gjBK_36110038.Checked = True Then
view.Sort = "Gaji OrTu desc"
End If
End Sub
Private Sub gj1_36110038_TextChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles gj1_36110038.TextChanged
view.RowFilter = "[Gaji OrTu]>" &
Val(gj1_36110038.Text)
End Sub
Private Sub tgl1_36110038_ValueChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles tgl1_36110038.ValueChanged
view.RowFilter = "[Tanggal Lahir]<#" &
tgl1_36110038.Value.Month & "/"
& tgl1_36110038.Value.Day & "/"
& tgl1_36110038.Value.Year & "#"
End Sub
Private Sub nm1_36110038_TextChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles nm1_36110038.TextChanged
view.RowFilter = "NAMA LIKE'% " & nm1_36110038.Text
& "%'"
End Sub
Private Sub filter_36110038_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles filter_36110038.Click
view.RowFilter = "[GAJI ORTU]>"
& Val(gj2_36110038.Text) & " AND
[KELAS]<>'" & kls2_36110038.Text & "'" & "
AND [TANGGAL LAHIR]<#" & tgl2_36110038.Value.Month & "/" & tgl2_36110038.Value.Day & "/" & tgl2_36110038.Value.Year &
"#" & "
AND NAMA LIKE '%" & nm2_36110038.Text & "%'"
End Sub
Private Sub kls1_36110038_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
kls1_36110038.TextChanged
view.RowFilter = "[KELAS]<>'" &
kls1_36110038.Text & "'"
End Sub
Private Sub aturwarna_36110038_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
aturwarna_36110038.Click
For Each dgv As
DataGridViewRow In dgv_36110038.Rows
If
dgv.Cells("Gaji Ortu").Value >
6000000 Then
dgv.DefaultCellStyle.BackColor = Color.Red
ElseIf
dgv.Cells("Gaji Ortu").Value >
5000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Crimson
ElseIf
dgv.Cells("Gaji Ortu").Value >
4000000 Then
dgv.DefaultCellStyle.BackColor =
Color.Bisque
ElseIf
dgv.Cells("Gaji Ortu").Value >
3000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Brown
ElseIf
dgv.Cells("Gaji Ortu").Value >
2000000 Then
dgv.DefaultCellStyle.BackColor
= Color.Chocolate
Else
dgv.DefaultCellStyle.BackColor
= Color.CornflowerBlue
End
If
Next
End Sub
End Class
6.
Tekan
F5 pada keyboard untuk menjalankan form.
Tidak ada komentar:
Posting Komentar