Oleh: admin | 05/12/2012

Belajar Visual Foxpro 9 (Latihan 2)

Kali ini saya memposting Latihan 2 (lanjutan). Latihan kali ini agak berbeda dengan sebelumnya, hanya ada perbedaan logika sedikit.

Form diatas menampilkan Gaji Pokok, Tunjangan, dan Gaji Pokok berdasarkan Jabatan dan status Perkawinan.
object cmdprosesgaji procedure click

a = thisform.txtnamakar.Value 
b = thisform.check1.Value 
c = thisform.check2.Value 
d = thisform.check3.Value
e = thisform.check4.Value
f = thisform.cbojab.Value 
IF EMPTY(a)
   =MESSAGEbox("Nama karyawan belum diisi",0+64,"Info")
   RETURN
ENDIF
If  b = 0 .and. c = 0      
   =MESSAGEbox("Anda belum memilih jenis kelamin",0+64,"Info")
   RETURN
ENDIF
IF EMPTY(f)
   =MESSAGEbox("Anda belum memilih jabatan",0+64,"Info")
   RETURN
ENDIF
If  d = 0 .and. e = 0      
   =MESSAGEbox("Anda belum menentukan status",0+64,"Info")
   RETURN
ENDIF

IF f = 'Manager'
		IF b = 1 .and. d = 1
		   gp = 4000000
		ELSE
		   IF c = 1 .and. d = 1
		      gp = 3250000
		   ELSE
		      IF b = 1 .and. e = 1
		         gp = 2000000
		      ELSE
		         IF c = 1 .and. e = 1
		            gp = 750000
		         ENDIF
		      ENDIF
		   ENDIF
		 ENDIF
ELSE
    IF f = 'Staf'
		IF b = 1 .and. d = 1
				   gp = 3000000
				ELSE
				   IF c = 1 .and. d = 1
				      gp = 2250000
				   ELSE
				      IF b = 1 .and. e = 1
				         gp = 1000000
				      ELSE
				         IF c = 1 .and. e = 1
				            gp = 750000
				         ENDIF
				      ENDIF
				   ENDIF
				 ENDIF
	 ELSE
	    IF f = 'Kasir'
	        IF b = 1 .and. d = 1
				   gp = 1000000
				ELSE
				   IF c = 1 .and. d = 1
				      gp = 750000
				   ELSE
				      IF b = 1 .and. e = 1
				         gp = 1000000
				      ELSE
				         IF c = 1 .and. e = 1
				            gp = 500000
				         ENDIF
				      ENDIF
				   ENDIF
				 ENDIF		
	     ENDIF
	  ENDIF
endif	     			 
 IF b = 1 .and. d = 1 
    Tji = gp * 0.15
    Tja = gp * 0.20
    Tg = gp + Tji + Tja
    thisform.txtgapok.Value = gp
    thisform.txttjistri.Value = Tji
    thisform.txttjsuami.Value ='' 
    thisform.txttjanak.Value = Tja
    thisform.txttotgaji.Value = Tg     
 ELSE
     IF c = 1 .and. d = 1    
	    Tjs = gp * 0.10
	    Tja = gp * 0.20   
	    Tg = gp + Tjs + Tja
	    thisform.txtgapok.Value = gp
	    thisform.txttjsuami.Value = Tjs
	    thisform.txttjistri.Value ='' 
	    thisform.txttjanak.Value = Tja
	    thisform.txttotgaji.Value = Tg
	 ELSE
	    thisform.txttjsuami.Value =''
	    thisform.txttjistri.Value =''
	    thisform.txttjanak.Value =''
	    thisform.txtgapok.Value = gp 
	    thisform.txttotgaji.Value = gp       
	 endif   
 ENDIF

 

Responses

  1. susah jugabljr foxpro yagz


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Kategori

%d blogger menyukai ini: