Tuesday, 23 September 2014

Contoh Program Penggajian Karyawan (Visual Basic)

Buat Form program di visual basic seperti gambar di atas.

setelah mendesain form seperti gambar di atas, silahkan anda mengatur beberapa bagian pada properti seperti pada label (text), combo box(name), text box(name), button(name & text). lihat pada gambar berikut ini :
setelah menentukan properties  toolbox pada form, silahkan anda memulai dengan mengetik listing program pada jendela pemograman visual basic.

listing program:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        golongan.Items.Add("IIIA")
        golongan.Items.Add("IIIB")
        golongan.Items.Add("IIIC")

        status.Items.Add("Menikah")
        status.Items.Add("Belum Menikah")

        nip.Items.Add("AB6001")
        nip.Items.Add("AB6002")
        nip.Items.Add("AB6003")
        nip.Items.Add("AB6004")
    End Sub

    Private Sub golongan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles golongan.SelectedIndexChanged
        If golongan.Text = "IIIA" Then
            gaji.Text = 4500000
        ElseIf golongan.Text = "IIIB" Then
            gaji.Text = 3000000
        ElseIf golongan.Text = "IIIC" Then
            gaji.Text = 2500000
        Else
            gaji.Text = 0
        End If
    End Sub

    Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
        tgaji.Text = Val(tkeluarga.Text) + Val(gaji.Text)

     
    End Sub

    Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
        Me.Close()

    End Sub

    Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
        If status.Text = "Menikah" Then
            tkeluarga.Text = 0.15 * gaji.Text
        ElseIf status.Text = "Belum Menikah" Then
            tkeluarga.Text = 0.25 * gaji.Text
        Else
            tkeluarga.Text = 0
        End If
    End Sub

    Private Sub nama_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nama.SelectedIndexChanged

    End Sub

    Private Sub nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nip.SelectedIndexChanged
        If nip.Text = "AB6001" Then
            nama.Text = "Zulfan Anugerah Zega"
        ElseIf nip.Text = "AB6002" Then
            nama.Text = "Irwan Gulo"
        ElseIf nip.Text = "AB6003" Then
            nama.Text = "Melinus Laoli"
        ElseIf nip.Text = "AB6004" Then
            nama.Text = "Toni Sartana Sianturi"
        Else
            nama.Text = 0

        End If
    End Sub

    Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
        nip.Text = ""
        nama.Text = ""
        golongan.Text = ""
        gaji.Text = ""
        status.Text = ""
        tkeluarga.Text = ""
        tgaji.Text = ""

    End Sub

    Private Sub tkeluarga_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tkeluarga.TextChanged

    End Sub
End Class


Hasilnya seperti pada gambar sebagai berikut :
semoga bermanfaat. ^_^



var Items = {}; var Msgs = {}; var Config = {'maxThreadDepth':'0'}; //, dan [/pre] menjadi , apabila salah menulis, tidak akan berfungsi Replace_Image_Ext = ['JPG', 'GIF', 'PNG', 'BMP'];//(support: jpg, gif, png, bmp),hanya berfungsi apabila Replace_Image_Link=true //Pengaturan Emoticon Emo_List = [ ':)' ,'http://twemoji.maxcdn.com/36x36/1f600.png', ':(' ,'http://twemoji.maxcdn.com/36x36/1f615.png', 'hihi' ,'http://twemoji.maxcdn.com/36x36/1f601.png', ':-)' ,'http://twemoji.maxcdn.com/36x36/1f60f.png', ':D' ,'http://twemoji.maxcdn.com/36x36/1f603.png', '=D' ,'http://twemoji.maxcdn.com/36x36/1f62c.png', ':-d' ,'http://twemoji.maxcdn.com/36x36/1f604.png', ';(' ,'http://twemoji.maxcdn.com/36x36/1f61e.png', ';-(' ,'http://twemoji.maxcdn.com/36x36/1f62d.png', '@-)' ,'http://twemoji.maxcdn.com/36x36/1f616.png', ':o' ,'http://twemoji.maxcdn.com/36x36/1f62e.png', ':>)','http://twemoji.maxcdn.com/36x36/1f606.png', '(o)' ,'http://twemoji.maxcdn.com/36x36/1f609.png', ':p' ,'http://twemoji.maxcdn.com/36x36/1f614.png', ':-?' ,'http://twemoji.maxcdn.com/36x36/2753.png', '(p)' ,'http://twemoji.maxcdn.com/36x36/1f619.png', ':-s' ,'http://twemoji.maxcdn.com/36x36/1f625.png', '8-)' ,'http://twemoji.maxcdn.com/36x36/1f60e.png', ':-t' ,'http://twemoji.maxcdn.com/36x36/1f624.png', ':-b' ,'http://twemoji.maxcdn.com/36x36/1f634.png', 'b-(' ,'http://twemoji.maxcdn.com/36x36/1f635.png', '(y)' ,'http://twemoji.maxcdn.com/36x36/1f44d.png', 'x-)' ,'http://twemoji.maxcdn.com/36x36/1f60d.png', '(h)' ,'http://twemoji.maxcdn.com/36x36/1f44f.png', ]; //Config Force tag list, define all in lower case Force_Tag = [ '[pre]','
',
                                    '[/pre]','
', '
','<code>',
                                    '
','' ]; eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 o=\'.1c\';3 1b=$(\'#O-19\').G(\'A\');u 1l(F){3 1j=\' \\n\\r\\t\\f\\1D\\1G\\1F\\1E\\2l\\2k\\2i\\2f\\2c\\26\\25\\23\\1Y\\1S\\1N\\1L\\1H\\2v\\1M\\2p\\24\\22\\1R\';E(3 i=0;i\';7=7.b(0,8)+1r+7.b(8+J.5);8=7.d(l);9(8==-1){l=\'1Z://13.V.W/1y?v=\';8=7.d(l)}}}9(21){3 Z=\'\';3 s=7;E(3 i=0;i<1w.5;i++){3 l=\'.\'+1w[i];3 m=s.C();3 8=m.d(l);D(8!=-1){k=s.b(0,8+l.5);m=k.C();3 q=\'2h://\';3 w=m.d(q);3 I=\'\';D(w!=-1){I=q.M();k=k.b(w+q.5);m=k.C();w=m.d(q)}q=\'2n://\';m=k.C();w=m.d(q);D(w!=-1){I=q.M();k=k.b(w+q.5);m=k.C();w=m.d(q)}9(I==\'\'||k.5<6){11}k=I+k;Z+=s.b(0,8+l.5-k.5)+\'<10 A="\'+k+\'" B="2r"/>\';s=s.b(8+l.5);m=s.C();8=m.d(l)}}7=Z+s}9(1A){3 5=x.5;9(5%2==1){5--}E(3 i=0;i<5;i+=2){3 S=\'<10 A="\'+x[i+1]+\'" B="1B"/>\';8=7.d(x[i]);D(8!=-1){7=7.b(0,8)+S+7.b(8+x[i].5);8=7.d(x[i])}}}9(1I){3 5=R.5;9(5%2==1){5--}E(3 i=0;i<5;i+=2){D(1){3 s=7.M();8=s.d(R[i]);9(8!=-1){7=7.b(0,8)+R[i+1]+7.b(8+R[i].5)}Y{11}}}}z 7});$(\'.1K\').j(u(y,7){9(1A){3 5=x.5;9(5%2==1){5--}3 12=\'\';E(3 i=0;i<5;i+=2){3 1e=\'<1f>\'+x[i]+\'\';3 S=\'<10 A="\'+x[i+1]+\'" B="1B"/>\';12+=\'\'+S+1e+\'\'}z 12}});$(\'.1g .1i p\').j(u(i,h){T=h.M();y=T.d(\'@\'+28.29+\'\';$(o).j(1s)}Y{$(o).j(\'\')}o=\'#2b\'+g;$(o).j(j);$(\'#O-19\').G(\'A\',1m(g))}16=2d.2e.U;17=\'#O-2g\';18=16.d(17);9(18!=-1){1x=16.b(18+17.5);1q(\'#2j\'+1x)}E(3 i=0;i=2s.2t){$(\'#c\'+H+\':L .2u\').1h()}3 K=$(\'#c\'+H+\':L\').j();K=\'\'+K+\'\';$(\'#c\'+H).1h();z(7+K)})}}',62,157,'|||var||length||oldhtml|check_index|if||substring||indexOf|||par_id|||html|img_src|search_key|upper_html||Cur_Cform_Hdr||http_search||temp_html||function||find_http|Emo_List|index|return|src|class|toUpperCase|while|for|str|attr|child_id|save_http|yt_link|child_html|first|toLowerCase|yt_code|comment|Items|div|Force_Tag|img_html|temp|href|youtube|com|yt_code_index|else|save_html|img|break|newhtml|www|index_tail|id|cur_url|search_formid|search_index|editor|par_level|Cur_Cform_Url|comment_form|ht|img_code|span|comment_wrap|remove|comment_body|whitespace|Valid_Par_Id|trim|Cform_Ins_ParID|7B|n_cform_url|Reset_Comment_Form|Display_Reply_Form|yt_video|reset_html|origin_cform|iframe|http|Replace_Image_Ext|ret_id|watch|parentId|Display_Emo|comment_emo|level|x5b|x7d|x7c|x5d|u2008|Replace_Force_Tag|Replace_Youtube_Link|comment_emo_list|u2007|u200a|u2006|item|comment_block|charAt|u3000|u2005|comment_youtube|embed|autohide|frameborder|parentID|u2004|https|replace|Replace_Image_Link|u2029|u2003|u2028|u2002|u2001|onclick|Msgs|addComment|name|r_f_c|u2000|window|location|xa0|form_|HTTP|x0b|rc|x3e|x3c|in|HTTPS|parseInt|u200b|comment_child|comment_img|Config|maxThreadDepth|comment_reply|u2009|allowfullscreen'.split('|'),0,{})) var avatar=$("#comments");avatar.find('.comment_avatar img').each(function() {var ava = $(this).attr('src');$(this).show().attr('src', ava.replace(/\/s[0-9]+(\-c)?\//,"/s45-c/"));});var _0x602a=["\x73\x63\x72\x65\x65\x6E\x20\x61\x6E\x64\x20\x28\x6D\x69\x6E\x2D\x77\x69\x64\x74\x68\x3A\x20\x36\x30\x65\x6D\x29","\x6D\x61\x74\x63\x68\x4D\x65\x64\x69\x61","\x6D\x61\x74\x63\x68\x65\x73","\x6F\x6E\x6C\x6F\x61\x64","\x6C\x69\x67\x68\x74\x63\x72\x65\x64\x69\x74\x73","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x68\x72\x65\x66","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x61\x72\x6C\x69\x6E\x61\x64\x7A\x67\x6E\x2E\x63\x6F\x6D","\x73\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65","\x72\x65\x6C","\x6E\x6F\x66\x6F\x6C\x6C\x6F\x77","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x61\x72\x6C\x69\x6E\x61\x64\x7A\x67\x6E\x2E\x63\x6F\x6D\x2F\x27\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x74\x69\x74\x6C\x65\x3D\x27\x4B\x72\x65\x61\x74\x69\x76\x69\x74\x61\x73\x20\x61\x64\x61\x6C\x61\x68\x20\x6B\x75\x6E\x63\x69\x20\x6B\x65\x73\x75\x6B\x73\x65\x73\x61\x6E\x27\x3E\x41\x72\x6C\x69\x6E\x61\x20\x44\x65\x73\x69\x67\x6E\x3C\x2F\x61\x3E"];var mql=window[_0x602a[1]](_0x602a[0]);mql[_0x602a[2]]&& (window[_0x602a[3]]= function(){var _0x2a73x2=document[_0x602a[5]](_0x602a[4]);null== _0x2a73x2&& (window[_0x602a[7]][_0x602a[6]]= _0x602a[8]),_0x2a73x2[_0x602a[9]](_0x602a[6],_0x602a[8]),_0x2a73x2[_0x602a[9]](_0x602a[10],_0x602a[11]),_0x2a73x2[_0x602a[12]]= _0x602a[13]}) //]]>