BLOG SAYA
Selasa, 24 Januari 2012
Herianti Lusia Simbolon
berikut ini alamat untuk mengetahui program studi kasus,silahkan klik disini
program studi kasus
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Nama.Focus()
Jabatan.Items.Add("Mandor")
Jabatan.Items.Add("Kepala Bagian")
Jabatan.Items.Add("Staf")
Status.Items.Add("Menikah")
Status.Items.Add("Belum Menikah")
Call buattabel()
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
Pajak.Text = 0.015 * Val(Gaji.Text)
Case "Staf"
Gaji.Text = 1250000
Pajak.Text = 0.015 * Val(Gaji.Text)
Case "Kepala Bagian"
Gaji.Text = 2500000
Pajak.Text = 0.015 * Val(Gaji.Text)
End Select
Status.Focus()
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
Dim y As String
y = Status.Text = "Menikah"
If Jabatan.Text = "Mandor" Then
Tunjangan.Text = 0.09 * 1750000
ElseIf Jabatan.Text = "Staf" Then
Tunjangan.Text = 0.09 * 1250000
ElseIf Jabatan.Text = "Kepala Bagian" Then
Tunjangan.Text = 0.09 * 2500000
End If
If Status.Text = "Belum Menikah" Then
Tunjangan.Text = 0
End If
Jumlah.Focus()
End Sub
Private Sub jumlah_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jumlah.TextChanged
If Jumlah.Text = "1" Then
Tunjangan_anak.Text = 0.03 * Val(Gaji.Text)
ElseIf Jumlah.Text = "2" Then
Tunjangan_anak.Text = 0.07 * Val(Gaji.Text)
Else
Tunjangan_anak.Text = 0.07 * Val(Gaji.Text)
End If
End Sub
Private Sub jam_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jam.TextChanged
If Jabatan.Text = "Mandor" Then
Upah.Text = 7500 * Val(Jam.Text)
ElseIf Jabatan.Text = "Staf" Then
Upah.Text = 5000 * Val(Jam.Text)
ElseIf Jabatan.Text = "Kepala Bagian" Then
Upah.Text = 10000 * Val(Jam.Text)
End If
End Sub
Private Sub btnhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhitung.Click
Total.Text = Val(Gaji.Text) + Val(Tunjangan.Text) + Val(Tunjangan_anak.Text) + Val(Upah.Text) - Val(Pajak.Text)
End Sub
Sub buattabel()
LV.Columns.Add("Nama", 100, HorizontalAlignment.Center)
LV.Columns.Add("Jabatan", 100, HorizontalAlignment.Center)
LV.Columns.Add("Status", 100, HorizontalAlignment.Center)
LV.Columns.Add("Gaji Pokok", 100, HorizontalAlignment.Right)
LV.Columns.Add("Tunjangan Istri", 120, HorizontalAlignment.Right)
LV.Columns.Add("Jumlah Anak", 100, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan anak", 120, HorizontalAlignment.Right)
LV.Columns.Add("Pajak", 100, HorizontalAlignment.Right)
LV.Columns.Add("Jam Lembur", 100, HorizontalAlignment.Center)
LV.Columns.Add("Upah Lembur", 100, HorizontalAlignment.Right)
LV.Columns.Add("Total Gaji", 100, HorizontalAlignment.Center)
LV.View = View.Details
LV.FullRowSelect = True
LV.GridLines = True
End Sub
Sub isitabel()
Dim lst As New ListViewItem
lst.Text = nama.Text
lst.SubItems.Add(Jabatan.Text)
lst.SubItems.Add(Status.Text)
lst.SubItems.Add(Gaji.Text)
lst.SubItems.Add(Tunjangan.Text)
lst.SubItems.Add(Jumlah.Text)
lst.SubItems.Add(Tunjangan_anak.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(jam.Text)
lst.SubItems.Add(Upah.Text)
lst.SubItems.Add(Total.Text)
LV.Items.Add(lst)
End Sub
Private Sub btnbersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnbersih.Click
Nama.Text = ""
Jabatan.Text = ""
Status.Text = ""
Gaji.Text = ""
Tunjangan.Text = ""
Jumlah.Text = ""
Tunjangan_anak.Text = ""
Pajak.Text = ""
Jam.Text = ""
Upah.Text = ""
Total.Text = ""
Nama.Focus()
End Sub
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnsimpan.Click
Call isitabel()
Nama.Text = ""
Jabatan.Text = ""
Status.Text = ""
Gaji.Text = ""
Tunjangan.Text = ""
Jumlah.Text = ""
Tunjangan_anak.Text = ""
Pajak.Text = ""
Jam.Text = ""
Upah.Text = ""
Total.Text = ""
Nama.Focus()
End Sub
Private Sub btnhapus_semua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus_semua.Click
LV.Items.Clear()
End Sub
Private Sub btnhapus_data_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus_data.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
Dim x As String
x = MsgBox("Anda Yakin Ingin Keluar", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Keluar")
If x = vbYes Then
Close()
End If
End Sub
End Class
jawaban no 33
Public Class Form1
Dim LST As ListViewItem
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode.SelectedIndexChanged
Select Case kode.Text
Case "TS001"
Microsoft.VisualBasic.Right(kode.Text, 3)
nama.Text = "Flashdisk 4GB"
Microsoft.VisualBasic.Left(kode.Text, 2)
merk.Text = "Toshiba"
Case "TS002"
Microsoft.VisualBasic.Right(kode.Text, 3)
nama.Text = "Flashdisk 2GB"
Microsoft.VisualBasic.Left(kode.Text, 2)
merk.Text = "Toshiba"
Case "VG001"
Microsoft.VisualBasic.Right(kode.Text, 3)
nama.Text = "Flashdisk 4GB"
Microsoft.VisualBasic.Left(kode.Text, 2)
merk.Text = "V-Gen"
Case "VG002"
Microsoft.VisualBasic.Right(kode.Text, 3)
nama.Text = "Flashdisk 2GB"
Microsoft.VisualBasic.Left(kode.Text, 2)
merk.Text = "V-gen"
End Select
If kode.Text = "TS001" Then
harga.Text = "105000"
ElseIf kode.Text = "TS002" Then
harga.Text = "75000"
ElseIf kode.Text = "VG001" Then
harga.Text = "90000"
ElseIf kode.Text = "VG002" Then
harga.Text = "60000"
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kode.Items.Add("TS001")
kode.Items.Add("TS002")
kode.Items.Add("VG001")
kode.Items.Add("VG002")
buat_table()
kosong()
End Sub
Sub buat_table()
With LV
.Items.Clear()
.FullRowSelect = True
.GridLines = True
.View = View.Details
.Columns.Add("No Pembelian", 100)
.Columns.Add("Kode Barang", 100)
.Columns.Add("Nama Barang", 100, HorizontalAlignment.Center)
.Columns.Add("Merk", 100, HorizontalAlignment.Left)
.Columns.Add(" Harga ", 100, HorizontalAlignment.Left)
.Columns.Add("Jumlah Beli", 100, HorizontalAlignment.Left)
.Columns.Add("Total Harga", 100, HorizontalAlignment.Left)
End With
End Sub
Sub simpan()
LST = Me.lv.Items.Add(Me.no.Text)
LST.SubItems.Add(Me.kode.Text)
LST.SubItems.Add(Me.nama.Text)
LST.SubItems.Add(Me.merk.Text)
LST.SubItems.Add(Me.harga.Text)
LST.SubItems.Add(Me.jumlah.Text)
LST.SubItems.Add(Me.tharga.Text)
End Sub
Sub kosong()
nama.Text = ""
no.Text = ""
kode.Text = ""
merk.Text = ""
harga.Text = ""
jumlah.Text = ""
tharga.Text = ""
no.Focus()
End Sub
Private Sub btnhapusdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapusdata.Click
If lv.SelectedItems.Count <> 0 Then
lv.Items.Remove(lv.SelectedItems(0))
Else
MsgBox("maaf anda belum" & "memilih yang mana mau dihapus")
End If
End Sub
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
Call simpan()
jawaban no 32
Langganan:
Postingan (Atom)