TUGAS VB INDIVIDU
Lihat Penuh >> > <<< KembaliDesign Form
Ketentuan Program :
- Buat Prosedur Aktif, Tidak aktif dan Bersih, kemudian panggil setiap prosedur tersebut didalam form kalian sesuai dengan logika kalian masing-masing.
- NIP 200803171 Purna Indra Sari, 2009771 Dwiyanto Edi, 2009668 Selvi Kurniawati, selain itu jika dimasukkan nip yang lain akan keluar "NIP Tidak diKenal" pada textbox nama karyawan.
- Kode DR untuk Direktur, MG untuk Manajer, ST untuk Staff
- Direktur Gapok = Rp. 3.000.000 Tunj. Jabatan 5% * Gapok, Tunj. Istri 5%* Gapok, Manajer Gapok = Rp. 2.250.000,- Tunj. Jabatan 5%* Gapok, Tunj. Istri 3%* Gapok, Staff Gapok = Rp. 1.850.00, Tunj. jabatan Tidak ada dan Tunj. Istri 2%* Gapok.
- Input Jumlah Anak
- Tunj. Anak : Jika anak <=3 maka Jumlah anak * Rp. 150.000, Namun jika jumlah anak >= 3 maka tunjangan anak = 3 * Rp. 150.000,-
- Proses = Gapok + Tunj. Jabatan + Tunj. Istri + Tunj. Anak
Listing Program :
Private Sub bersih()
Me.txtnip.Text = ""
Me.txtnama.Text = ""
Me.cbojabatan.Text = "Silahkan Pilih"
Me.txtjabatan.Text = ""
Me.txtgapok.Text = ""
Me.txttunjjabatan.Text = ""
Me.txttunjistri.Text = ""
Me.txtanak.Text = ""
Me.txttunjanak.Text = ""
Me.txttotal.Text = ""
End Sub
Private Sub tidakaktif()
Me.txtnip.Enabled = False
Me.txtnama.Enabled = False
Me.txtjabatan.Enabled = False
Me.cbojabatan.Enabled = False
Me.txtgapok.Enabled = False
Me.txtjabatan.Enabled = False
Me.txttunjjabatan.Enabled = False
Me.txttunjistri.Enabled = False
Me.txttunjanak.Enabled = False
Me.txtanak.Enabled = False
Me.txtnip.BackColor = vbInactiveBorder
Me.txtnama.BackColor = vbInactiveBorder
Me.cbojabatan.BackColor = vbInactiveBorder
Me.txtjabatan.BackColor = vbInactiveBorder
Me.txtgapok.BackColor = vbInactiveBorder
Me.txttunjjabatan.BackColor = vbInactiveBorder
Me.txttunjistri.BackColor = vbInactiveBorder
Me.txttunjanak.BackColor = vbInactiveBorder
Me.txtanak.BackColor = vbInactiveBorder
Me.txttotal.BackColor = vbInactiveBorder
End Sub
Private Sub Aktif()
Me.txtnip.Enabled = True
Me.txtnama.Enabled = True
Me.txtjabatan.Enabled = True
Me.cbojabatan.Enabled = True
Me.txtgapok.Enabled = True
Me.txtjabatan.Enabled = True
Me.txttunjjabatan.Enabled = True
Me.txttunjistri.Enabled = True
Me.txtanak.Enabled = True
Me.txttunjanak.Enabled = True
Me.txtnip.BackColor = vbWhite
Me.txtnama.BackColor = vbWhite
Me.cbojabatan.BackColor = vbWhite
Me.txtjabatan.BackColor = vbWhite
Me.txtgapok.BackColor = vbWhite
Me.txttunjjabatan.BackColor = vbWhite
Me.txttunjistri.BackColor = vbWhite
Me.txttunjanak.BackColor = vbWhite
Me.txttotal.BackColor = vbWhite
Me.txtanak.BackColor = vbWhite
End Sub
Private Sub cbojabatan_Click()
If Me.cbojabatan.Text = "DR" Then
Me.txtjabatan.Text = "Direktur"
Me.txtgapok.Text = 4000000
Me.txttunjjabatan.Text = 0.05 * Val(Me.txtgapok)
Me.txttunjistri.Text = 0.1 * Val(Me.txtgapok)
Else
If Me.cbojabatan.Text = "MG" Then
Me.txtjabatan.Text = "Manager"
Me.txtgapok.Text = 3000000
Me.txttunjjabatan.Text = 0.05 * Val(Me.txtgapok)
Me.txttunjistri.Text = 0.1 * Val(Me.txtgapok)
Else
If Me.cbojabatan.Text = "SV" Then
Me.txtjabatan.Text = "Supervisor "
Me.txtgapok.Text = 2500000
Me.txttunjjabatan.Text = 0.05 * Val(Me.txtgapok)
Me.txttunjistri.Text = 0.1 * Val(Me.txtgapok)
Else
Me.txtjabatan.Text = "Staff"
Me.txtgapok.Text = 1500000
Me.txttunjjabatan.Text = 0.05 * Val(Me.txtgapok)
Me.txttunjistri.Text = 0.1 * Val(Me.txtgapok)
End If
End If
End If
Me.txtjabatan.Enabled = False
Me.txtgapok.Enabled = False
Me.txttunjjabatan.Enabled = False
Me.txttunjistri.Enabled = False
Me.txtanak.SetFocus
End Sub
Private Sub CmdKeluar_Click()
PESAN = MsgBox("Yakin Akan Keluar ??/.....", vbYesNo, "QUIS VISUAL BASIC")
If PESAN = vbYes Then
End
End If
End Sub
Private Sub cmdlagi_Click()
Call bersih
Call tidakaktif
Me.CmdTambah.SetFocus
End Sub
Private Sub cmdproses_Click()
Me.txttotal.Text = Val(Me.txtgapok.Text) + Val(Me.txttunjjabatan.Text) + Val(Me.txttunjistri.Text) + Val(Me.txttunjanak.Text)
End Sub
Private Sub CmdTambah_Click()
Call Aktif
Call bersih
Me.txtnip.SetFocus
End Sub
Private Sub Form_Activate()
Call bersih
Call tidakaktif
Me.CmdTambah.SetFocus
End Sub
Private Sub Form_Load()
Me.cbojabatan.AddItem "DR"
Me.cbojabatan.AddItem "MG"
Me.cbojabatan.AddItem "SV"
Me.cbojabatan.AddItem "ST"
End Sub
Private Sub Timer1_Timer()
Dim hariini As Variant
Dim jam As Variant
hariini = Now
jam = Now
Me.lbljam.Caption = Format(jam, "hh:mm:ss am/pm")
Me.Lbltgl.Caption = Format(hariini, "DDDD / DD-MMMM-YYYY")
End Sub
Private Sub txtanak_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Me.txtanak <= 3 Then
Me.txttunjanak.Text = Val(Me.txtanak.Text) * 150000
Else
Me.txttunjanak.Text = 3 * 150000
End If
End If
End Sub
Private Sub txtnip_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Me.txtnip.Text = "200803617" Then
Me.txtnama.Text = "Sinta permata"
Else
If Me.txtnip.Text = "200809716" Then
Me.txtnama.Text = "Doni L"
Else
If Me.txtnip.Text = "200809453" Then
Me.txtnama.Text = "Deta Aprilia"
Else
Me.txtnama.Text = "NIP Tidak Dikenal"
Me.txtnama.Enabled = False
Me.cbojabatan.Enabled = False
Me.txtjabatan.Enabled = False
Me.txtgapok.Enabled = False
Me.txttunjjabatan.Enabled = False
Me.txttunjistri.Enabled = False
Me.txtanak.Enabled = False
Me.txttunjanak.Enabled = False
Me.txttotal.Enabled = False
Me.txtnip.Text = ""
Me.CmdTambah.SetFocus
End If
End If
End If
End If
End Sub
0 komentar:
Posting Komentar