DISKRIPSI LATIHAN 14
Latihan_14_36110030
A.
Object-object dalam Latihan_14_36110030:
1. Object Label
Terdapat
delapan label (yang bertuliskan gaji orang tua lebih dari terdapat dua label,
bukan kelas terdapat dua label, tanggal lahir sebelum terdapat dua label, dan
nama memiliki unsur terdapat dua label juga).
2. Object
Textbox
Terdapat dua
belas textbox (enam status input; delapan status read only dan hanya digunakan
sebagai pengganti label). Status input digunakan untuk memasukkan gaji orang
tua lebih dari, bukan kelas, dan nama memiliki unsur. Masing-masing 2 textbox. Status
Read Only digunakan sebagai pengganti label yang bertuliskan gaji
ortu>=6000000, gaji ortu>=5000000, gaji ortu>=4000000, gaji
ortu>=3000000, gaji ortu>=2000000, selain itu.
3. Object
Button
Terdapat dua
object button (Filter dan Atur Warna). Button filter digunakan untuk memfilter
data tabel berdasarkan data yang telah diinput di textbox. Button atur warna
digunakan untuk memberikan warna pada data yang ada dalam datagridview menurut
besar gaji ortunya.
4. Object
DateTimePicker
Terdapat dua
object datetimepicker yang digunakan dalam memfilter data tabel yang ada di
datagridview.
5. Object
DataGridView
Terdapat
satu objeck datagridview yang digunakan untuk menampilkan data tabel yang telah
dibuat.
B.
Script Unique
Untuk button Filter:
FILTER_36110030_Click
Untuk button Atur Warna:
WARNA_36110030_Click
C.
Even
STB_36110030_CheckedChanged
KLS1_36110030_CheckedChanged
KLS2_36110030_CheckedChanged
GAJI_36110030_CheckedChanged
GAJI1_36110030_TextChanged
BK1_36110030_TextChanged
TGL1_36110030_ValueChanged
UNSUR1_36110030_TextChanged
FILTER_36110030_Click
WARNA_36110030_Click
D.
Property
Property TextBox ==> ReadOnly=True
PROSEDUR PENYELESIAN LATIHAN 14
1.KLIK STAR KEMUDIAN PILIH
MICROSOFT VISUAL STUDIO 2008
2.KEMUDIAN KLIK NEW PROJECT PADA FILE
3.KEMUDIAN
KLIK ADD UNTUK MENAMBAHKAN PROJECT
4.
KEMUDIAN BUATLAH FORM SEPERTI DIBAWAH INI :
5.KEMUDIAN MASUKAN RUMUS :
Public Class Latihan_14_36110030
'Mendeklarasikan
datatable
Dim Table As New DataTable
'Mendeklarasikan
dataview
Dim
TableView As New
DataView
Private Sub Latihan_14_36110030_Load(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles Me.Load
'Perintah
Menambahkan kolom pada table
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(Double)))
Table.Columns.Add(New DataColumn("Kelas",
GetType(String)))
'Perintah
menabahkan data baris pada table
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("36112003",
"Fathin Ammar Asidik", "L", "06/29/1994",
6800000, "1A_D3")
Table.Rows.Add("36112008",
"Adbul Malik", "L", "11/09/1993",
1200000, "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",
1000000, "1A_D3")
Table.Rows.Add("36112024",
"Syahrul Kamal", "L", "10/18/1994",
10000000, "1A_D3")
Table.Rows.Add("36112001",
"Fitri", "P",
"10/20/1994", 5000000, "1A_D3")
Table.Rows.Add("36112010",
"Yulianti", "P", "09/28/1994",
1200000, "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",
1200000, "1A_D3")
Table.Rows.Add("46112003",
"Nurawalia M.", "P", "12/04/1994",
3000000, "1A_D4")
Table.Rows.Add("46112023",
"Puspita Susilawati Ridjal", "P", "01/01/1994",
4000000, "1A_D4")
Table.Rows.Add("46112018",
"Rose Anne Tarida Situmorang", "P", "12/14/1994",
5000000, "1A_D4")
Table.Rows.Add("46112004",
"Siti Khaerunnisa", "P", "03/28/1994",
1000000, "1A_D4")
Table.Rows.Add("46112015",
"Irmayanti", "P", "09/23/1994",
1000000, "1A_D4")
Table.Rows.Add("46112011",
"Delsi Tifani Lan", "P", "12/24/1994",
2000000, "1A_D4")
Table.Rows.Add("46112027",
"Reny Rita Waty Djafar", "P", "07/26/1993",
3000000, "1A_D4")
Table.Rows.Add("46112002",
"Dewi Sartika", "P", "02/10/1994",
1000000, "1A_D4")
Table.Rows.Add("46112004",
"Anita Rahmah Muhtadin", "P", "12/07/1994",
5000000, "1A_D4")
Table.Rows.Add("46112021",
"Rafidah", "P", "06/05/1994",
500000, "1A_D4")
Table.Rows.Add("46112009",
"Eka Yuli Astuti", "P", "08/07/1994",
2000000, "1A_D4")
Table.Rows.Add("46112025",
"Fitri Amalia Islamiati", "P", "03/26/1995",
4000000, "1A_D4")
Table.Rows.Add("46112014",
"Mariana.", "P", "06/22/1994",
1000000, "1A_D4")
Table.Rows.Add("46112013",
"A. Muh. Lutfi Ahmad", "L", "10/10/1993",
4000000, "1A_D4")
Table.Rows.Add("46112008",
"Nanda Ardilia Pratama", "L", "08/01/1994",
1000000, "1A_D4")
Table.Rows.Add("46112022",
"Liliani Paelongan", "P", "05/25/1994",
3000000, "1A_D4")
Table.Rows.Add("46112007",
"Andi Rabiah", "L", "09/07/1994",
1000000, "1A_D4")
Table.Rows.Add("46112001",
"Rizka Awalia Mustakim", "P", "10/07/1994",
3000000, "1A_D4")
Table.Rows.Add("46112005",
"Mardhotillah", "P", "01/13/1994",
3000000, "1A_D4")
Table.Rows.Add("46112017",
"Camelia Indulgenssya Gundung", "P", "09/14/1994",
2000000, "1A_D4")
Table.Rows.Add("46112028",
"Nur Salim Rusdi", "L", "04/12/1994",
1500000, "1A_D4")
Table.Rows.Add("46112026",
"Muhammad Khaidir", "L", "12/26/1993",
3000000, "1A_D4")
Table.Rows.Add("46112020",
"Sukriani Karunia Rahma", "P", "12/01/1994",
3000000, "1A_D4")
Table.Rows.Add("46112006",
"Rezky Tri Utami", "P", "07/03/1994",
3000000, "1A_D4")
Table.Rows.Add("46112029",
"Azwar Arfah", "L", "04/03/1994",
3000000, "1A_D4")
Table.Rows.Add("46112016",
"Dyah Sukma Anggraini", "P", "05/10/1994",
3500000, "1A_D4")
Table.Rows.Add("46112010",
"Nur Indah Purnamasari", "P", "07/22/1994",
2500000, "1A_D4")
Table.Rows.Add("46112012",
"Nurul Qadri Musra", "L", "08/24/1994",
3000000, "1A_D4")
Table.Rows.Add("36112028",
"adri prianto tukan", "L", "04/26/1994",
2000000, "1B_D3")
Table.Rows.Add("36112057",
"Renaldy Alchudri Azsagaf", "L", "05/03/1994",
10000000, "1B_D3")
Table.Rows.Add("36112039",
"Andi Syahril", "L", "10/02/1994",
2000000, "1B_D3")
Table.Rows.Add("36112051",
"Muhammad Adhe Anugrah", "L", "08/31/1993",
5000000, "1B_D3")
Table.Rows.Add("36112042",
"Sukmawati Amir", "P", "04/13/1994",
6000000, "1B_D3")
Table.Rows.Add("36112040",
"Dian Eka Puteri", "P", "11/11/1993",
1000000, "1B_D3")
Table.Rows.Add("36112048",
"Tri Wahyuni", "P", "11/11/1994",
800000, "1B_D3")
Table.Rows.Add("36112047",
"A. Dian Pelita Waty", "P", "05/05/1994",
3000000, "1B_D3")
Table.Rows.Add("36112043",
"Mu'minat Nur", "P", "05/17/1995",
5000000, "1B_D3")
Table.Rows.Add("36112050",
"Andi Anggi Fadliyah", "P", "08/15/1994",
1500000, "1B_D3")
Table.Rows.Add("36112033",
"A. Syasya Annisa Ausan", "P", "08/08/1994",
7000000, "1B_D3")
Table.Rows.Add("36112044",
"Muhammad Fachri Sani", "L", "02/02/1994",
5000000, "1B_D3")
Table.Rows.Add("36112053",
"Resky Yonada Ahmad", "P", "03/22/1994",
1500000, "1B_D3")
Table.Rows.Add("36112029",
"Trinayanti", "P", "06/03/1992",
3000000, "1B_D3")
Table.Rows.Add("36112041",
"Musyarafah Asis", "L", "07/13/1994",
6000000, "1B_D3")
Table.Rows.Add("36112055",
"Achmad Rezky Satria Perdana", "L", "12/17/1993",
3000000, "1B_D3")
Table.Rows.Add("36112034",
"Fibra Yoseph P.", "P", "03/27/1995",
6000000, "1B_D3")
Table.Rows.Add("36112045",
"Ibnu Affan Al-Mufar'id", "L", "08/05/1994",
8000000, "1B_D3")
Table.Rows.Add("36112030",
"Sri Widya Ayu Wandini", "P", "06/01/1994",
5000000, "1B_D3")
Table.Rows.Add("36112046",
"Sri Wahyuni Hafid", "P", "12/25/1994",
11000000, "1B_D3")
Table.Rows.Add("36112032",
"Rosita Satri", "P", "12/06/1994",
3000000, "1B_D3")
Table.Rows.Add("36112052",
"Sabri", "L",
"07/24/1993", 700000, "1B_D3")
Table.Rows.Add("36112049",
"Alfin Riani Bandaso", "P", "04/11/1994",
3000000, "1B_D3")
Table.Rows.Add("36112036",
"Nurmilasari", "P", "07/06/1993",
200000, "1B_D3")
Table.Rows.Add("36112035",
"Tri Arismunandar", "L", "12/09/1993",
1000000, "1B_D3")
Table.Rows.Add("36112031",
"Nur Indahsari Idris", "P", "08/28/1994",
5000000, "1B_D3")
Table.Rows.Add("36112037",
"Ismawati", "P", "08/01/1994",
900000, "1B_D3")
Table.Rows.Add("36112034",
"Rezky Arianti", "P", "01/27/1994",
3000000, "1B_D3")
Table.Rows.Add("36112032",
"Artis Susan", "P", "10/29/1993",
5000000, "1B_D3")
Table.Rows.Add("36112054",
"Ade Apriathis Rantelino", "L", "04/27/1994",
3000000, "1B_D3")
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_D4")
Table.Rows.Add("46112036",
"Hasmiati Hajar", "P", "05/17/1994",
5000000, "1B_D4")
'Perintah
menapilkan data melalui data view
TableView = Table.DefaultView
DataGridView1.DataSource = TableView
'Perintah
mengubah lebar kolom pada table
DataGridView1.Columns("Stambuk").Width = 60
DataGridView1.Columns("Jenis Kelamin").Width = 50
DataGridView1.Columns("Tanggal Lahir").Width = 70
DataGridView1.Columns("Gaji Ortu").Width = 60
DataGridView1.Columns("Kelas").Width = 40
DataGridView1.Columns("Jenis Kelamin").DefaultCellStyle.Alignment
= DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns("Kelas").DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleCenter
End Sub
Private Sub STAMBUK_36110030_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
stambuk_36110030.CheckedChanged
'Perintah
mengurutkan data berdasarkan stambuk
If
stambuk_36110030.Checked = True Then
TableView.Sort = "Stambuk"
End If
End Sub
Private Sub KELAS1_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
kelas1_36110030.CheckedChanged
'Perintah
mengurutkan data berdasarkan kelas
If
kelas1_36110030.Checked = True Then
TableView.Sort = "[Kelas] desc"
End If
End Sub
Private Sub KELAS2_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
kelas2_36110030.CheckedChanged
'Perintah
mengurutkan data berdasarkan kelas dan tanggal lahir
If
kelas2_36110030.Checked = True Then
TableView.Sort = "[Kelas], [Tanggal Lahir]"
End If
End Sub
Private Sub GAJI_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
gaji1_36110030.CheckedChanged
'Perintah
mengurutkan data berdasarkan gaji ortu
If
gaji1_36110030.Checked = True Then
TableView.Sort = "[Gaji Ortu] desc"
End If
End Sub
Private Sub GAJI2_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
gaji2_36110030.TextChanged
'Perintah
filter berdasarkan gaji ortu pada textbox
TableView.RowFilter = "[Gaji Ortu] > " &
Val(gaji2_36110030.Text)
End Sub
Private Sub BK_36110030_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
bk_36110030.TextChanged
'Perintah
filter berdasarkan kelas pada textbox
TableView.RowFilter = "[Kelas] <> '" &
bk_36110030.Text & "'"
End Sub
Private Sub TGL1_36110030_ValueChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
tgl1_36110030.ValueChanged
'Perintah
filter berdasarkan tanggal lahir pada datetimepicker
TableView.RowFilter = "[Tanggal Lahir] < #" &
tgl1_36110030.Value.Month & "/"
& tgl1_36110030.Value.Day & "/"
& tgl1_36110030.Value.Year & "#"
End Sub
Private Sub NMU1_36110030_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
nmu1_36110030.TextChanged
'Perintah
filter berdasarkan nama yang mengandung unsur pada textbox
TableView.RowFilter = "[Nama] like '%" &
nmu1_36110030.Text & "%'"
End Sub
Private Sub FILTER_36110030_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles filter_36110030.Click
'Perintah
filter dengan beberapa kriteria
TableView.RowFilter = "[Gaji Ortu] > " &
Val(nmu2_36110030.Text) & _
" and
[Kelas] <> '" & BK2_36110030.Text & "'" & _
" and
[Tanggal Lahir] < #" & TGL2_36110030.Value.Month & "/" & TGL2_36110030.Value.Day & "/" & TGL2_36110030.Value.Year &
"#" & _
" and
[Nama] like '%" & GAJI3_36110030.Text & "%'"
End Sub
Private Sub _Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles aw_36110030.Click
'Perintah
mengubah warna baris sesuai dengan beberapa kriteria
For Each BarisX As
DataGridViewRow In DataGridView1.Rows
If
BarisX.Cells("Gaji Ortu").Value
>= 6000000 Then
BarisX.DefaultCellStyle.BackColor = Color.Red
ElseIf
BarisX.Cells("Gaji Ortu").Value
>= 5000000 Then
BarisX.DefaultCellStyle.BackColor = Color.Crimson
ElseIf
BarisX.Cells("Gaji Ortu").Value
>= 4000000 Then
BarisX.DefaultCellStyle.BackColor = Color.Bisque
ElseIf
BarisX.Cells("Gaji Ortu").Value
>= 3000000 Then
BarisX.DefaultCellStyle.BackColor = Color.Blue
ElseIf
BarisX.Cells("Gaji Ortu").Value
>= 2000000 Then
BarisX.DefaultCellStyle.BackColor = Color.FloralWhite
Else
BarisX.DefaultCellStyle.BackColor = Color.YellowGreen
End
If
Next
End Sub
End Class
6. KEMUDIAN
UJI PROGRAM
7. JIKA SUDAH
BERHASIL Save program anda
8. selesai
0 komentar:
Posting Komentar