29 Januari 2012

Tugas Visual Studio

1.proses penyeleesaian bagi Pertama

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        buattabel()

    End Sub

    Sub buattabel()
        LV.Columns.Add("NPM", 60, HorizontalAlignment.Left)
        LV.Columns.Add("Name", 180, HorizontalAlignment.Left)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True

    End Sub

    Sub isitabel()
        Dim lst As New ListViewItem
        lst.Text = NPM.Text
        lst.SubItems.Add(Nama.Text)
        LV.Items.Add(lst)

    End Sub


    Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
        isitabel()
        NPM.Text = ""
        Nama.Text = ""
    End Sub





    Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click
        Dim x As String
        x = MsgBox("Thank You Very Much")
        If x = vbYes Then
            Me.Close()


        End If

    End Sub

    Private Sub hapus1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus1.Click
        LV.Items.Remove(LV.SelectedItems(0))
    End Sub

    Private Sub hapus2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus2.Click

        LV.Items.Clear()
    End Sub
End Classl






2 . Proses Penyelesaian bagi ke dua


Public Class FormKaryawan

  
    Private Sub nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nip.SelectedIndexChanged
        If nip.Text = "0911518" Then
            nama.Text = "Adi Chandro Rumapea"
        ElseIf nip.Text = "0911519" Then
            nama.Text = "Ucok Baba"
        ElseIf nip.Text = "0911510" Then
            nama.Text = "Bondan Prakoso"
        ElseIf nip.Text = "0911588" Then
            nama.Text = "Uciha Sasuke"

        Else
            nama.Text = "Ujumaki Naruto"

        End If
    End Sub

    Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
        If jabatan.Text = "Mandor" Then
            gapok.Text = "1750000"
            pajak.Text = (1.5 * Val(gapok.Text))

        ElseIf jabatan.Text = "Kepala Bagian" Then
            gapok.Text = "2500000"
            pajak.Text = (1.5 * Val(gapok.Text))
        Else
            gapok.Text = "1250000"
            pajak.Text = 0
        End If
    End Sub

    Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
        If status.Text = "Menikah" Then
            tistri.Text = (0.09 * Val(gapok.Text))
        Else
            tistri.Text = "0"
        End If
    End Sub

   

    Private Sub jam_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jam.SelectedIndexChanged
        If jam.Text = "1" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "7500"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "5000"
            Else
                lembur.Text = "10000"
            End If
        ElseIf jam.Text = "2" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "15000"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "10000"
            Else
                lembur.Text = "20000"
            End If
        ElseIf jam.Text = "3" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "22500"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "15000"
            Else
                lembur.Text = "30000"
            End If
        ElseIf jam.Text = "4" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "30000"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "20000"
            Else
                lembur.Text = "40000"
            End If
        ElseIf jam.Text = "5" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "37500"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "25000"
            Else
                lembur.Text = "50000"
            End If
        ElseIf jam.Text = "6" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "45000"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "30000"
            Else
                lembur.Text = "60000"
            End If
        ElseIf jam.Text = "7" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "52500"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "35000"
            Else
                lembur.Text = "70000"
            End If
        ElseIf jam.Text = "8" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "60000"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "40000"
            Else
                lembur.Text = "80000"
            End If
        ElseIf jam.Text = "9" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "67500"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "45000"
            Else
                lembur.Text = "90000"
            End If
        ElseIf jam.Text = "10" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "75000"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "50000"
            Else
                lembur.Text = "100000"
            End If
        ElseIf jam.Text = "11" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "82500"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "55000"
            Else
                lembur.Text = "110000"
            End If
        ElseIf jam.Text = "12" Then
            If jabatan.Text = "Mandor" Then
                lembur.Text = "90000"
            ElseIf jabatan.Text = "Staf" Then
                lembur.Text = "60000"
            Else
                lembur.Text = "1200000"
            End If
        End If

    End Sub

    Private Sub hitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hitung.Click
        total.Text = Val(gapok.Text) + Val(tistri.Text) + Val(tanak.Text) + Val(lembur.Text) - Val(pajak.Text)
    End Sub

    Private Sub FormKaryawan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Buattabel()

    End Sub

    Sub Buattabel()
        LV.Columns.Add("NIP", 70, HorizontalAlignment.Center)
        LV.Columns.Add("Nama", 100, HorizontalAlignment.Left)
        LV.Columns.Add("Jabatan", 70, HorizontalAlignment.Center)
        LV.Columns.Add("G.Pokok", 70, HorizontalAlignment.Center)
        LV.Columns.Add("Status", 70, HorizontalAlignment.Center)
        LV.Columns.Add("T. Istri", 70, HorizontalAlignment.Center)
        LV.Columns.Add("J. Anak", 70, HorizontalAlignment.Center)
        LV.Columns.Add("T. Anak", 70, HorizontalAlignment.Center)
        LV.Columns.Add("Pajak", 70, HorizontalAlignment.Center)
        LV.Columns.Add("Gaji Lambur", 70, HorizontalAlignment.Center)
        LV.Columns.Add("J.Jam", 70, HorizontalAlignment.Center)
        LV.Columns.Add("Total", 70, HorizontalAlignment.Center)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True
    End Sub

    Sub isitabel()
        Dim lst As New ListViewItem
        lst.Text = nip.Text
        lst.SubItems.Add(nama.Text)
        lst.SubItems.Add(jabatan.Text)
        lst.SubItems.Add(gapok.Text)
        lst.SubItems.Add(status.Text)
        lst.SubItems.Add(tistri.Text)
        lst.SubItems.Add(byakanak.Text)
        lst.SubItems.Add(tanak.Text)
        lst.SubItems.Add(pajak.Text)
        lst.SubItems.Add(lembur.Text)
        lst.SubItems.Add(jam.Text)
        lst.SubItems.Add(total.Text)

        LV.Items.Add(lst)
    End Sub


    Private Sub BTNProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNProses.Click
        isitabel()
        nip.Text = ""
        nama.Text = ""
        jabatan.Text = ""
        gapok.Text = ""
        status.Text = ""
        tistri.Text = ""
        byakanak.Text = ""
        tanak.Text = ""
        pajak.Text = ""
        lembur.Text = ""
        jam.Text = ""
        total.Text = ""
        nip.Focus()

    End Sub

    Private Sub byakanak_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles byakanak.TextChanged
        If byakanak.Text = "1" Then
            tanak.Text = (0.3 * Val(gapok.Text))
        ElseIf byakanak.Text = "2" Then
            tanak.Text = (0.7 * Val(gapok.Text))
        Else
            tanak.Text = (0.7 * Val(gapok.Text))
        End If
    End Sub
End Class






0 komentar:

 
Free Joomla TemplatesFree Blogger TemplatesFree Website TemplatesFreethemes4all.comFree CSS TemplatesFree Wordpress ThemesFree Wordpress Themes TemplatesFree CSS Templates dreamweaverSEO Design