Tugas Bahasa Pemrograman
http://mesran.blogspot.com/2013/05/tugas-si-p1101.html
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nik.Items.Add("001")
nik.Items.Add("002")
nik.Items.Add("003")
jabatan.Items.Add("Mandor")
jabatan.Items.Add("Kepala Bagian")
jabatan.Items.Add("Staff")
status.Items.Add("Menikah")
status.Items.Add("Tidak Menikah")
For i = 1 To 4
janak.Items.Add(i)
Next i
For i = 1 To 10
jlembur.Items.Add(i)
Next i
BuatTabel()
End Sub
Sub IsiTabel()
Dim lst As New ListViewItem
lst.Text = nik.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(jabatan.Text)
lst.SubItems.Add(gaji.Text)
lst.SubItems.Add(status.Text)
lst.SubItems.Add(tistri.Text)
lst.SubItems.Add(janak.Text)
lst.SubItems.Add(tanak.Text)
lst.SubItems.Add(jlembur.Text)
lst.SubItems.Add(hlembur.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(total.Text)
LV.Items.Add(lst)
End Sub
Private Sub nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nik.SelectedIndexChanged
Select Case nik.Text
Case "001" : nama.Text = "Puji"
Case "002" : nama.Text = "Friska"
Case "003" : nama.Text = "Vita"
End Select
End Sub
Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
Select Case JABATAN.Text
Case "Mandor" : GAJI.Text = 1750000
Case "Kepala Bagian" : GAJI.Text = 2500000
Case "Staff" : GAJI.Text = 1250000
End Select
PAJAK.Text = 0.015 * GAJI.Text
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
Select Case STATUS.Text
Case "Menikah" : tistri.Text = 0.09 * gaji.Text
Case "Tidak Menikah" : tistri.Text = 0
End Select
End Sub
Private Sub Btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnsimpan.Click
IsiTabel()
nik.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tistri.Text = ""
janak.Text = ""
tanak.Text = ""
jlembur.Text = ""
hlembur.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
Private Sub Btnhapussemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapussemua.Click
LV.Items.Clear()
End Sub
Private Sub Btnhapusdatayangdipilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapusdatayangdipilih.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
If JABATAN.Text = "Mandor" Then
hlembur.Text = jlembur.Text * 7500
ElseIf JABATAN.Text = "Kepala Bagian" Then
hlembur.Text = jlembur.Text * 10000
ElseIf JABATAN.Text = "Staff" Then
hlembur.Text = jlembur.Text * 5000
Else
hlembur.Text = 0
End If
total.Text = Val(hlembur.Text) + Val(gaji.Text) + Val(tistri.Text) + Val(tanak.Text) + Val(pajak.Text)
End Sub
Private Sub janak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles janak.SelectedIndexChanged
If janak.Text >= 2 And status.Text = "Menikah" Then
tanak.Text = 0.07 * gaji.Text
ElseIf janak.Text = 1 And status.Text = "Tidak Menikah" Then
tanak.Text = 0.03 * gaji.Text
Else
tanak.Text = 0
End If
End Sub
Private Sub LV_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LV.SelectedIndexChanged
End Sub
Sub BuatTabel()
LV.Columns.Add("NIK", 80, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 180, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan", 100, HorizontalAlignment.Center)
LV.Columns.Add("Gaji", 80, HorizontalAlignment.Center)
LV.Columns.Add("Status", 100, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan Istri", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jumlah Anak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan Anak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jam Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Honor Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Pajak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Total", 80, HorizontalAlignment.Center)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
End
End Sub
End Class
Home »
» TUGAS VB 2008
TUGAS VB 2008
Posted by puji lestari
Posted on 05.22
with No comments
Written by : Puji - Berbagi bersama...!!!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id libero non erat fermentum varius eget at elit. Suspendisse vel mattis diam. Ut sed dui in lectus hendrerit interdum nec ac neque. Praesent a metus eget augue lacinia accumsan ullamcorper sit amet tellus.
Join Me On: Facebook | Twitter | Google Plus :: Thank you for visiting ! ::
0 komentar:
Posting Komentar