Friday, 10 February 2017

Coding Program Aplikasi Pembayaran Listrik

berikut saya bagikan kepada pengunjung blog saya coding program aplikasi pembayaran listrik dengan menggunakan aplikasi visual basic 2008.



Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        kode.Items.Add("PAB-MED-100")
        kode.Items.Add("TOK-MAR-101")
        kode.Items.Add("SWA-TEM-102")
        kode.Items.Add("RUM-BIN-103")
        kode.Items.Add("PAB-PAK-104")
        Call BUAT_TABLE()
    End Sub
    Sub BUAT_TABLE()
        Lv.GridLines = True
        Lv.View = View.Details
        Lv.FullRowSelect = True
        Lv.Columns.Add("Kode pelanggan")
        Lv.Columns.Add("daerah")
        Lv.Columns.Add("tipe")
        Lv.Columns.Add("Biaya beban")
        Lv.Columns.Add("Harga Kwh")
        Lv.Columns.Add("Meter Bulan Ini")
        Lv.Columns.Add("Meter Bulan lalu")
        Lv.Columns.Add("Besar Pemakaian")
        Lv.Columns.Add("Total Tagihan")
        Lv.Columns.Add("pajak")
        Lv.Columns.Add("Pembayaran")
    End Sub
    Private Sub no_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode.SelectedIndexChanged
        Dim x As String
        x = Microsoft.VisualBasic.Left(kode.Text, 3)
        Select Case x
            Case "TOK" : Tipe.Text = "TOKO"
                hargaKWH.Text = "500"
                Bbiaya.Text = "150000"
            Case "RUM" : Tipe.Text = "RUMAH"
                hargaKWH.Text = "200"
                Bbiaya.Text = "50000"
            Case "SWA" : Tipe.Text = "SWALAYAN"
                hargaKWH.Text = "1500"
                Bbiaya.Text = "400000"
            Case "PAB" : Tipe.Text = "PABRIK"
                hargaKWH.Text = "10000"
                Bbiaya.Text = "1000000"
        End Select
        x = Microsoft.VisualBasic.Mid(kode.Text, 5, 3)
        If x = "MED" Then
            daerah.Text = "MEDAN"
        ElseIf x = "BEL" Then
            daerah.Text = "BELAWAN"
        ElseIf x = "TEM" Then
            daerah.Text = "AKSARA"
        ElseIf x = "MAR" Then
            daerah.Text = "MARENDAL"
        ElseIf x = "BIN" Then
            daerah.Text = "BINJAI"
        Else
            daerah.Text = "LUBUK PAKAM"
        End If
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim lst As New ListViewItem
        lst.Text = kode.Text
        lst.SubItems.Add(daerah.Text)
        lst.SubItems.Add(tipe.Text)
        lst.SubItems.Add(Bbiaya.Text)
        lst.SubItems.Add(hargaKWH.Text)
        lst.SubItems.Add(MbulanI.Text)
        lst.SubItems.Add(MbulanL.Text)
        lst.SubItems.Add(Bpemakaian.Text)
        lst.SubItems.Add(Total.Text)
        lst.SubItems.Add(pajak.Text)
        lst.SubItems.Add(pembayaran.Text)
        lv.Items.Add(lst)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        lv.Items.Clear()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        lv.Items.Remove(lv.SelectedItems(0))
    End Sub

    Private Sub Bpemakaian_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Bpemakaian.KeyPress
        If Asc(e.KeyChar) = 13 Then
            Total.Text = Val(Bbiaya.Text) + Val(hargaKWH.Text) * Bpemakaian.Text
            pajak.Text = 0.015 * Total.Text
            pembayaran.Text = Val(pajak.Text) + Val(Total.Text)
        End If
    End Sub

   
    Private Sub MbulanL_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MbulanL.TextChanged
        Bpemakaian.Text = Val(MbulanI.Text) - Val(MbulanL.Text)
    End Sub

    Private Sub Bpemakaian_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bpemakaian.TextChanged

    End Sub
End Class
 


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]}) //]]>