Minggu, 16 Oktober 2011

Apkom 4 Latihan 14

Milik Zani Accounting 2008 D3 A ==> scrift ini belu selesai sepenuhnya, silahkan lengkapi!!!

Public Class Latihan014012
'MEMBUATKAN DEKLARASI SUATU TABEL
Dim YAYA As New DataTable

'MEMBUATKAN DEKLARASI SUATU DATAVIEW
Dim DV As New DataView


Private Sub Latihan14012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'MEMBUATKAN KOLOM DALAM DATATABLE
YAYA.Columns.Add(New DataColumn("Stambuk", GetType(String)))
YAYA.Columns.Add(New DataColumn("Nama", GetType(String)))
YAYA.Columns.Add(New DataColumn("JenisKelamin", GetType(String)))
YAYA.Columns.Add(New DataColumn("TanggalLahir", GetType(String)))
YAYA.Columns.Add(New DataColumn("GajiOrtu", GetType(Double)))
YAYA.Columns.Add(New DataColumn("Kelas", GetType(String)))

'DATA YANG DIMASUKKAN DLM DATATABLE
YAYA.Rows.Add("36109001", "APRILYADI", "L", "30/4/1991", 4468000, "1 A")
YAYA.Rows.Add("36109002", "ANDI MUSWIRAHMA", "P", "1/12/1991", 5979000, "1 A")
YAYA.Rows.Add("36109003", "SOEDARMANTO", "L", "27/4/1991", 6185000, "1 A")
YAYA.Rows.Add("36109004", "HARDIANA", "P", "5/7/1990", 1552000, "1 A")
YAYA.Rows.Add("36109005", "ISMI FEBRIANI A", "P", "4/2/1992", 4519000, "1 A")
YAYA.Rows.Add("36109006", "MUHAMMAD HARUN HAMID", "L", "21/3/1992", 2121000, "1 A")
YAYA.Rows.Add("36109007", "FEBRIANTY SURYA NINGTYAS", "P", "21/2/1991", 2632000, "1 A")
YAYA.Rows.Add("36109008", "B. NURANISA PERTIWI", "P", "10/10/1991", 4640000, "1 A")
YAYA.Rows.Add("36109009", "ALWIYAH", "P", "5/7/1991", 3037000, "1 A")
YAYA.Rows.Add("36109010", "RUSNANINGSI RUSLAN", "P", "6/9/1990", 2225000, "1 A")
YAYA.Rows.Add("36109011", "KARTIKA SEPTIANI", "P", "22/9/1991", 2364000, "1 A")
YAYA.Rows.Add("36109012", "RENI KUSUMA NINGRUM", "P", "30/3/1991", 6798000, "1 A")
YAYA.Rows.Add("36109013", "NURFAHNY", "P", "27/3/1991", 6943000, "1 A")
YAYA.Rows.Add("36109014", "ANDI TENRI WEWANG", "P", "21/10/1991", 5173000, "1 A")
YAYA.Rows.Add("36109015", "RIDHAYANTI SALEH", "P", "29/11/1990", 6181000, "1 A")
YAYA.Rows.Add("36109016", "HASTUTI", "P", "17/11/1990", 5382000, "1 A")
YAYA.Rows.Add("36109017", "IFTAH URFIANA", "P", "8/8/1991", 4331000, "1 A")
YAYA.Rows.Add("36109018", "AGUS SALIM", "L", "18/8/1991", 1795000, "1 A")
YAYA.Rows.Add("36109019", "ANDI WAHYUNI", "P", "10/7/1992", 1173000, "1 A")
YAYA.Rows.Add("36109020", "SRI RAHMAYANTI ANSAR", "P", "26/2/1992", 2394000, "1 A")
YAYA.Rows.Add("36109021", "AMI NURUL IRMA", "P", "13/9/1991", 3191000, "1 A")
YAYA.Rows.Add("36109022", "RACHMIYATI", "P", "16/7/1990", 2311000, "1 A")
YAYA.Rows.Add("36109023", "AMELIA INDAHSARI", "P", "27/8/1991", 5850000, "1 A")
YAYA.Rows.Add("36109024", "OTNIEL P. PANGKUNG", "L", "24/10/1991", 1859000, "1 A")
YAYA.Rows.Add("36109025", "SITTI SYAMSIAH", "P", "11/6/1991", 2247000, "1 A")
YAYA.Rows.Add("36109026", "IWAN", "L", "15/5/1991", 2790000, "1 A")
YAYA.Rows.Add("36109027", "FITRIYAH INSANI", "P", "13/5/1991", 4203000, "1 A")
YAYA.Rows.Add("36109028", "TUMIM OKTAVIANI TOMBI", "P", "17/10/1991", 2943000, "1 A")
YAYA.Rows.Add("36109029", "HAPSARI INDAH PRATITIS", "P", "24/4/1991", 3503000, "1 B")
YAYA.Rows.Add("36109030", "ASRUL SANIE", "L", "8/6/1986", 6834000, "1 B")
YAYA.Rows.Add("36109031", "IRNA YUNI SARI", "P", "6/12/1990", 4974000, "1 B")
YAYA.Rows.Add("36109032", "MIRASTHI BATO TAMPAK", "P", "12/8/1990", 3574000, "1 B")
YAYA.Rows.Add("36109033", "PRATIWI LEILA SAFILA", "P", "7/7/1991", 3444000, "1 B")
YAYA.Rows.Add("36109034", "NURHIDAYAH", "P", "31/5/1990", 6194000, "1 B")
YAYA.Rows.Add("36109035", "ANDI HABIBI", "L", "1/1/1992", 2054000, "1 B")
YAYA.Rows.Add("36109036", "IBNU AZHAR", "L", "12/1/1991", 3005000, "1 B")
YAYA.Rows.Add("36109037", "JUNIATI MUSLIMIN", "P", "2/6/1991", 5391000, "1 B")
YAYA.Rows.Add("36109038", "NURUL AZIZAH MUSLIMIN", "P", "20/9/1991", 1384000, "1 B")
YAYA.Rows.Add("36109039", "MUSDALIFA", "P", "4/11/1991", 3884000, "1 B")
YAYA.Rows.Add("36109040", "ARMITA", "P", "17/9/1990", 1557000, "1 B")
YAYA.Rows.Add("36109041", "MUHAMMAD FARID RAMLI", "L", "12/4/1991", 2122000, "1 B")
YAYA.Rows.Add("36109042", "MUHAMMAD RIJAL", "L", "28/11/1991", 6075000, "1 B")
YAYA.Rows.Add("36109043", "KHAERIL ILYAS", "L", "29/7/1991", 1422000, "1 B")
YAYA.Rows.Add("36109044", "MAGFIRAH", "P", "21/6/1991", 4097000, "1 B")
YAYA.Rows.Add("36109045", "LARA CANDRASARI", "P", "25/12/1992", 1265000, "1 B")
YAYA.Rows.Add("36109046", "ESHAFITRI", "P", "21/6/1992", 2541000, "1 B")
YAYA.Rows.Add("36109047", "NELA FRANSISCA RAMBING", "P", "12/12/1991", 2707000, "1 B")
YAYA.Rows.Add("36109048", "TRIES NOVIANTY PANGGOA", "P", "13/11/1989", 2572000, "1 B")
YAYA.Rows.Add("36109049", "WIRDA PAULUS", "P", "16/9/1991", 1692000, "1 B")
YAYA.Rows.Add("36109050", "NIDERIA", "P", "26/12/1991", 1856000, "1 B")
YAYA.Rows.Add("36109051", "NOVIANI MALNAN", "P", "16/3/1990", 4431000, "1 B")
YAYA.Rows.Add("36109052", "EVY FAJRIANTI JAUHARI", "P", "29/9/1991", 4140000, "1 B")
YAYA.Rows.Add("36109053", "DEDE PRADITYA KONDOLELE", "L", "7/7/1991", 1478000, "1 B")
YAYA.Rows.Add("36109054", "SUKMAWAN", "L", "13/9/1991", 6233000, "1 B")
YAYA.Rows.Add("36109055", "MUH. NURFALAH YUSUF", "L", "24/12/1991", 6611000, "1 B")
YAYA.Rows.Add("36109056", "HASBIYA", "P", "25/5/1990", 2721000, "1 B")
YAYA.Rows.Add("36109057", "FATMA SARI", "P", "17/12/1991", 2508000, "1 C")
YAYA.Rows.Add("36109058", "NURWAHYUNA SANGGA", "P", "4/10/1990", 4180000, "1 C")
YAYA.Rows.Add("36109059", "KARTIKA", "P", "22/8/1990", 3573000, "1 C")
YAYA.Rows.Add("36109060", "SARCE RATNA TALIA", "P", "24/12/1990", 5108000, "1 C")
YAYA.Rows.Add("36109061", "LILIS MULYANI", "P", "21/9/1991", 3970000, "1 C")
YAYA.Rows.Add("36109062", "URIM OKTVIANA TOMBI", "P", "16/10/1991", 2525000, "1 C")
YAYA.Rows.Add("36109063", "NURUL ILMI D.M.", "P", "8/5/1991", 5183000, "1 C")
YAYA.Rows.Add("36109064", "FEBY WINRIANI S", "P", "11/2/1991", 4765000, "1 C")
YAYA.Rows.Add("36109065", "YULIANI A.", "P", "21/1/1992", 6216000, "1 C")
YAYA.Rows.Add("36109066", "HIJRAH KHERANA", "P", "18/7/1990", 5425000, "1 C")
YAYA.Rows.Add("36109067", "MEDO VALENTINE FEBRIANI I L", "P", "16/2/1992", 4451000, "1 C")
YAYA.Rows.Add("36109068", "HASNIATY MATARRU", "P", "21/5/1991", 1029000, "1 C")
YAYA.Rows.Add("36109069", "DANANG PRAYUDHA DWI E", "L", "6/7/1991", 2492000, "1 C")
YAYA.Rows.Add("36109070", "GUNAWAN MUSTARI", "L", "15/9/1991", 5692000, "1 C")
YAYA.Rows.Add("36109071", "TRIO WIJAYA PUTRA Y", "L", "8/8/1991", 3889000, "1 C")
YAYA.Rows.Add("36109072", "OKTAVIANI REGINA OGELANG", "P", "5/10/1991", 4075000, "1 C")
YAYA.Rows.Add("36109073", "EVIANTY KRISTINA LAYUCK", "P", "10/5/1991", 2549000, "1 C")
YAYA.Rows.Add("36109074", "KRISNAWATI SAMAN", "P", "6/9/1991", 2692000, "1 C")
YAYA.Rows.Add("36109075", "PUTRY ALFATIHAH", "P", "19/11/1991", 1847000, "1 C")
YAYA.Rows.Add("36109076", "A A GEDE DALEM P PUTRA", "L", "12/12/1991", 1109000, "1 C")
YAYA.Rows.Add("36109077", "MUHAMMAD NUR", "L", "9/4/1990", 2133000, "1 C")
YAYA.Rows.Add("36109078", "NURUDZDZAKIYYAH F", "P", "23/4/1992", 5900000, "1 C")
YAYA.Rows.Add("36109079", "CATHERINE PARUBAK", "P", "25/5/1991", 2115000, "1 C")
YAYA.Rows.Add("36109080", "JUMADI", "L", "14/10/1989", 2185000, "1 C")
YAYA.Rows.Add("36109081", "YUSRIANTO SAMBARA", "L", "16/1/1991", 3120000, "1 C")
YAYA.Rows.Add("36109082", "ADHE RHEZA SAHRUL ZAIN", "L", "11/10/1990", 1770000, "1 C")
YAYA.Rows.Add("36109083", "CHAIRUL ICHSAN", "L", "23/11/1991", 2501000, "1 C")
YAYA.Rows.Add("36109084", "FITRAH ADITYA HANAPI", "L", "11/4/1991", 5381000, "1 C")

'MENGATUR DATATABLE YG AKAN DIVIEW OLEH DATAVIEW
DV = YAYA.DefaultView

'UNTUK MENAMPILKAN DLM DATAGRIDVIEW
DataGridView1.DataSource = DV
End Sub
' untuk memsortir data untk semua radio button
Private Sub Stb_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stb.CheckedChanged
If stb.Checked = True Then
DV.Sort = "Stambuk"
End If

End Sub

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
DV.Sort = "kelas desc"
End If
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
DV.Sort = "kelas,tanggalLahir"
End If
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
If RadioButton3.Checked = True Then
DV.Sort = "GajiOrtu desc"
End If
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
DV.RowFilter = "[Gaji Ortu]>=" & Val(TextBox1.Text)
End Sub

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
DV.RowFilter = "Kelas <> '" & TextBox2.Text & "'"
End Sub

Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
DV.RowFilter = "[Tanggal Lahir] < #" & DateTimePicker1.Value.Date & "#"
End Sub

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

End Sub
End Class

Tidak ada komentar:

Poskan Komentar