Menu Pembayaran Data Flow Diagram DFD

End Sub

5. Menu Pembayaran

Private Sub cmbbln_Click If cmbbln vbnullStrings Then txtket.Text = LUNAS Else txtket.Text = BELUM LUNAS End If End Sub Private Sub cmdbatal_Click txtnis.Text = txtjml.Text = txtkelas.Text = txtnama.Text = txtno_byr.Text = otomatis Picture2.Visible = False For i = 0 To 11 chkbulani.Enabled = False Next i kunci End Sub Private Sub cmdcari_Click Picture2.Visible = True End Sub Private Sub cmdkeluar_Click Universitas Sumatera Utara Unload Me menuutama.Show End Sub Private Sub cmdsimpan_Click Dim tampung As String Dim i As Integer, s As Integer Dim uang1 As Double, uang11 As Double, uang2 As Double, uang22 As Double, uang3 As Double, uang33 As Double Call rsselect jumlah_bayar from Kelas where kode_Kelas=X uang1 = recjumlah_bayar uang11 = recjumlah_bayar Call rsselect jumlah_bayar from Kelas where kode_Kelas=XI uang2 = recjumlah_bayar uang22 = recjumlah_bayar Call rsselect jumlah_bayar from Kelas where kode_Kelas=XII uang3 = recjumlah_bayar uang33 = recjumlah_bayar If rec.State = 1 Then rec.Close rec.Open select kelas from Siswa where nis= txtnis.Text , conn, adOpenDynamic, adLockOptimistic tampung = reckelas For i = 0 To 11 s = i + 1 If Lentampung = 3 And chkbulani.Value = Checked Then Universitas Sumatera Utara Call rsselect no_bayar,bulan,total_bayar from Bayar where no_bayar= txtno_byr.Text If Not rec.EOF Then isi = recbulan uang1 = uang1 + uang11 conn.Execute update Bayar set bulan= isi , chkbulani.Caption ,total_bayar= uang1 where no_bayar= txtno_byr.Text Else conn.Execute Insert into Bayar values txtno_byr.Text , DTPicker1.Value , txtnis.Text , txtjml.Text ,X,LUNAS, chkbulani.Caption End If ElseIf Lentampung = 8 And chkbulani.Value = Checked Then Call rsselect no_bayar,bulan from Bayar where no_bayar= txtno_byr.Text If Not rec.EOF Then isi = recbulan uang2 = uang2 + uang22 conn.Execute update Bayar set bulan= isi , chkbulani.Caption ,total_bayar= uang2 where no_bayar= txtno_byr.Text Else conn.Execute Insert into Bayar values txtno_byr.Text , DTPicker1.Value , Universitas Sumatera Utara txtnis.Text , txtjml.Text ,XI,LUNAS, chkbulani.Caption End If ElseIf Lentampung = 9 And chkbulani.Value = Checked Then Call rsselect no_bayar,bulan from Bayar where no_bayar= txtno_byr.Text If Not rec.EOF Then isi = recbulan uang3 = uang3 + uang33 conn.Execute update Bayar set bulan= isi , chkbulani.Caption ,total_bayar= uang3 where no_bayar= txtno_byr.Text Else conn.Execute Insert into Bayar values txtno_byr.Text , DTPicker1.Value , txtnis.Text , txtjml.Text ,XII,LUNAS, chkbulani.Caption End If End If Next i Call bersihpembayaran Call otomatis For i = 0 To 11 chkbulani.Value = Unchecked Next i kunci End Sub Universitas Sumatera Utara Private Sub cmdtambah_Click BukaKunci cmdcari.SetFocus For i = 0 To 11 chkbulani.Enabled = True Next i End Sub Private Sub Form_Load Call koneksi Call bersihpembayaran Call otomatis For i = 0 To 11 chkbulani.Enabled = False Next i kunci Picture2.Visible = False lvcari.ColumnHeaders.Clear lvcari.View = lvwReport lvcari.ColumnHeaders.Add , , NIS, 1000 lvcari.ColumnHeaders.Add , , NAMA, 2000 lvcari.ColumnHeaders.Add , , KELAS, 1000 End Sub Private Sub lvcari_DblClick If rec.State = 1 Then rec.Close rec.Open select nis,nama_siswa,kelas from Siswa where nis= lvcari.SelectedItem , conn, adOpenDynamic, adLockOptimistic txtnis = recnis Universitas Sumatera Utara txtnama = recnama_siswa txtkelas = reckelas If Lentxtkelas = 3 Then If rec.State = 1 Then rec.Close rec.Open select jumlah_bayar from Kelas where kode_kelas = X, conn, adOpenDynamic, adLockOptimistic txtjml = recjumlah_bayar ElseIf Lentxtkelas = 8 Then If rec.State = 1 Then rec.Close rec.Open select jumlah_bayar from Kelas where kode_kelas =XI, conn, adOpenDynamic, adLockOptimistic txtjml = recjumlah_bayar ElseIf Lentxtkelas = 9 Then If rec.State = 1 Then rec.Close rec.Open select jumlah_bayar from Kelas where kode_kelas = XII, conn, adOpenDynamic, adLockOptimistic txtjml = recjumlah_bayar End If Private Sub Text1_Change If rec.State = 1 Then rec.Close rec.Open select nis,nama_siswa,kelas from Siswa where nama_siswa like Text1.Text , conn, adOpenDynamic, adLockOptimistic lvcari.ListItems.Clear Do While Not rec.EOF i = lvcari.ListItems.Count + 1 lvcari.ListItems.Add , , recnis Universitas Sumatera Utara lvcari.ListItemsi.ListSubItems.Add , , recnama_siswa lvcari.ListItemsi.ListSubItems.Add , , reckelas rec.MoveNext Loop End Sub Private Sub txtjml_Change If Lentxtkelas = 4 Then If rec.State = 1 Then rec.Close rec.Open select from Kelas where kode_kelas like X__ order by kode_kelas, conn, adOpenDynamic, adLockOptimistic Asc Do While Not rec.EOF rec.MoveNext Loop ElseIf Lentxtkelas 4 And Lentxtkelas = 9 Then If rec.State = 1 Then rec.Close rec.Open select from Kelas where kode_kelas like XI__ order by kode_kelas, conn, adOpenDynamic, adLockOptimistic Asc Do While Not rec.EOF rec.MoveNext Loop ElseIf Lentxtkelas = 10 Then If rec.State = 1 Then rec.Close Universitas Sumatera Utara rec.Open select from Kelas where kode_kelas like XII__ order by kode_kelas, conn, adOpenDynamic, adLockOptimistic Asc Do While Not rec.EOF rec.MoveNext Loop End If End Sub

6. Menu Laporan