Aplikasi Pembayaran Biaya Sekolah Dan SPP
Aplikasi Pembayaran Biaya Sekolah Dan SPP
Aplikasi Pembayaran Biaya Sekolah Dan SPP
com)
Langkah-langkah membuat aplikasi pembayaran biaya sekolah dan SPP adalah sebagai
berikut :
1. Membuat database
2. Membuat tabel-tabel
3. Membuat relasi tabel
4. Membuat project
5. Membuat module koneksi
6. Membuat form login
7. Membuat menu utama
8. Membuat form-form master
9. Membuat form transaksi pembayaran
10. Membuat form transaksi SPP
11. Membuat laporan
12. Dan lain-lain
Coding dan gambar-gambar form dan laporan dapat dilihat pada ilustrasi di bawah ini :
Module koneksi database
Imports System.Data.OleDb
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Module Module1
MasterMenu.panelkode.Text = DR.Item(0)
MasterMenu.panelnama.Text = DR.Item(1)
MasterMenu.panelstatus.Text = UCase(DR.Item(3))
Else
MsgBox("Login gagal")
txtnama.Clear()
txtpassword.Clear()
txtnama.Focus()
hitung = hitung + 1
If hitung = 3 Then
MsgBox("Login sudah 3x salah")
End
End If
End If
Call Koneksi()
CMD = New OleDbCommand("select * from TBLLEMBAGA", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
MasterMenu.panellembaga.Text = DR.Item(0)
Else
MsgBox("Profil lembaga harus segera diisi")
MasterLembaga.Show()
End If
End Sub
Sub Ketemu()
TextBox2.Text = DR.Item("Nama_lembaga")
TextBox3.Text = DR.Item("alamat")
TextBox4.Text =
Microsoft.VisualBasic.Mid(DR.Item("telepon"), 9, 20)
TextBox5.Text = Microsoft.VisualBasic.Mid(DR.Item("fax"),
5, 20)
TextBox7.Text =
Microsoft.VisualBasic.Mid(DR.Item("email"), 7, 43)
TextBox8.Text =
Microsoft.VisualBasic.Mid(DR.Item("website"), 9, 41)
TextBox2.Focus()
End Sub
Sub TampilPerusahaan()
Call Koneksi()
CMD = New OleDbCommand("select * from TBLLEMBAGA WHERE
ID_LEMBAGA='01'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox2.Text = DR.Item("nama_LEMBAGA")
TextBox3.Text = DR.Item("alamat")
TextBox4.Text =
Microsoft.VisualBasic.Mid(DR.Item("telp"), 9, 20)
TextBox5.Text =
Microsoft.VisualBasic.Mid(DR.Item("fax"), 5, 20)
TextBox7.Text =
Microsoft.VisualBasic.Mid(DR.Item("email"), 7, 50)
TextBox8.Text =
Microsoft.VisualBasic.Mid(DR.Item("website"), 9, 50)
End If
End Sub
Call Koneksi()
CMD = New OleDbCommand("select * from TBLLEMBAGA where
id_lembaga='01'", Conn)
DR = CMD.ExecuteReader
DR.Read()
Try
If Not DR.HasRows Then
Call Koneksi()
Dim simpan As String = "insert into TBLLEMBAGA
values ('01','" & TextBox2.Text & "','" & TextBox3.Text & "','" &
Label4.Text & Space(1) & TextBox4.Text & "','" & Label5.Text &
Space(1) & TextBox5.Text & "','" & Label6.Text & Space(1) &
TextBox7.Text & "','" & Label7.Text & Space(1) & TextBox8.Text
& "')"
CMD = New OleDbCommand(simpan, Conn)
CMD.ExecuteNonQuery()
MsgBox("Data berhasil disimpan")
Me.Close()
Else
Call Koneksi()
Dim edit As String = "update TBLLEMBAGA set
Nama_lembaga='" & TextBox2.Text & "',alamat='" & TextBox3.Text
& "',telp='" & Label4.Text & Space(1) & TextBox4.Text
& "',fax='" & Label5.Text & Space(1) & TextBox5.Text
& "',email='" & Label6.Text & Space(1) & TextBox7.Text
& "',website='" & Label7.Text & Space(1) & TextBox8.Text & "'
where ID_LEMBAGA='01'"
CMD = New OleDbCommand(edit, Conn)
CMD.ExecuteNonQuery()
MsgBox("Data berhasil diedit")
Me.Close()
End If
Call Koneksi()
CMD = New OleDbCommand("select * from TBLLEMBAGA",
Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
MasterMenu.panellembaga.Text = DR.Item(0)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Imports System.Data.OleDb
Sub Kosongkan()
TextBox1.Enabled = True
TextBox1.Clear()
TextBox2.Clear()
ComboBox1.Text = ""
TextBox3.Clear()
TextBox6.Clear()
TextBox1.Focus()
Call Tampillevel_user()
Call TampilGrid()
End Sub
Sub DataBaru()
TextBox2.Clear()
ComboBox1.Text = ""
TextBox3.Clear()
TextBox6.Clear()
TextBox2.Focus()
End Sub
Sub Ketemu()
TextBox1.Enabled = False
TextBox2.Text = DR.Item("nama_User")
TextBox3.Text = DR.Item("pwd_User")
ComboBox1.Text = DR.Item("level_user")
TextBox2.Focus()
End Sub
Sub TampilGrid()
'Call Koneksi()
DA = New OleDbDataAdapter("select * from tblUser", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Sub Tampillevel_user()
'Call Koneksi()
CMD = New OleDbCommand("select distinct level_user from
tblUser", Conn)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item("level_user"))
Loop
End Sub
Sub NomorOtomatis()
CMD = New OleDbCommand("select id_pendidikan from
tbllevelpendidikan order by id_pendidikan desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
TextBox1.Text = "01"
Else
TextBox1.Text =
Format(Microsoft.VisualBasic.Right(DR.Item("id_pendidikan"), 2) +
1, "00")
End If
End Sub
Sub Kosongkan()
TextBox1.Enabled = False
Call NomorOtomatis()
TextBox2.Clear()
TextBox6.Clear()
Call TampilGrid()
TextBox2.Focus()
End Sub
Sub DataBaru()
TextBox2.Clear()
TextBox6.Clear()
Call TampilGrid()
TextBox2.Focus()
End Sub
Sub Ketemu()
TextBox1.Enabled = False
TextBox2.Text = DR.Item("level_pendidikan")
TextBox2.Focus()
End Sub
Sub TampilGrid()
DA = New OleDbDataAdapter("select * from
tbllevelpendidikan", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Sub Kondisiawal()
Call Kosongkan()
End Sub
Sub CariID()
CMD = New OleDbCommand("select * from tbllevelpendidikan
where id_pendidikan='" & TextBox1.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
End Sub
Call CariID()
Try
If Not DR.HasRows Then
'Call Koneksi()
Dim simpan As String = "insert into
tbllevelpendidikan values ('" & TextBox1.Text & "','" &
TextBox1.Text + "-" + TextBox2.Text & "')"
CMD = New OleDbCommand(simpan, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
Call TampilGrid()
Else
'Call Koneksi()
Dim edit As String = "update tbllevelpendidikan
set level_pendidikan='" & TextBox2.Text & "' where
id_pendidikan='" & TextBox1.Text & "'"
CMD = New OleDbCommand(edit, Conn)
CMD.ExecuteNonQuery()
'Call Kondisiawal()
Call Kosongkan()
Call TampilGrid()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
'Call CariID()
'If Not DR.HasRows Then
' MsgBox("id level tidak terdaftar")
' TextBox1.Focus()
' Exit Sub
'End If
Imports System.Data.OleDb
Sub Bersihkan()
ComboBox1.Text = ""
IDPendidikan.Text = ""
txtuangspp.Clear()
txtkondisidata.Clear()
txtidbiaya.Clear()
DGV.Columns.Clear()
End Sub
Sub TampilLevelpendidikan()
CMD = New OleDbCommand("select * from TBLlevelpendidikan",
Conn)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item(1))
Loop
End Sub
Sub TotalBiaya()
On Error Resume Next
Dim hitung As Integer
For baris As Integer = 0 To DGV.RowCount - 1
hitung = hitung + DGV.Rows(baris).Cells(2).Value
Next
txttotalbiaya.Text = FormatNumber(hitung, 0)
End Sub
End If
If e.ColumnIndex = 2 Then
Try
DGV.CurrentCell = DGV(1, DGV.CurrentCell.RowIndex)
Catch ex As Exception
MsgBox("Harus angka")
End Try
End If
Call TotalBiaya()
End Sub
DGV.Columns(0).ReadOnly = True
End Sub
Sub NomorOtomatis()
CMD = New OleDbCommand("select id_siswa from tblsiswa
order by id_siswa desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
txtIDSiswa.Text = "00001"
Else
txtIDSiswa.Text =
Format(Microsoft.VisualBasic.Right(DR.Item("id_siswa"), 5) +
1, "00000")
End If
End Sub
Sub Kosongkan()
txtIDSiswa.Enabled = False
Call NomorOtomatis()
txtNIS.Clear()
txtNISN.Clear()
txtNama.Clear()
TextBox6.Clear()
cmbPendidikan.Text = ""
cmbTahunAjaran.Text = ""
cmbJurusan.Text = ""
cmbKelas.Text = ""
cmbSemester.Text = ""
Call Tampilangkatan()
Call TampilJurusan()
Call Tampilkelas()
Call TampilGrid()
txtNIS.Focus()
End Sub
Sub DataBaru()
txtNIS.Clear()
txtNISN.Clear()
txtNama.Clear()
TextBox6.Clear()
cmbPendidikan.Text = ""
cmbTahunAjaran.Text = ""
cmbJurusan.Text = ""
cmbKelas.Text = ""
cmbSemester.Text = ""
Call Tampilangkatan()
Call TampilJurusan()
Call Tampilkelas()
Call TampilGrid()
txtNIS.Focus()
End Sub
Sub Ketemu()
On Error Resume Next
txtIDSiswa.Enabled = False
txtNIS.Text = DR.Item("NIS")
txtNISN.Text = DR.Item("NISN")
txtNama.Text = DR.Item("nama_siswa")
cmbPendidikan.Text = DR.Item("id_biaya") ':
SendKeys.Send("{tab}")
cmbTahunAjaran.Text = DR.Item("Tahun_ajaran")
cmbJurusan.Text = DR.Item("Jurusan")
cmbKelas.Text = DR.Item("kelas")
cmbSemester.Text = DR.Item("semester")
txtNIS.Focus()
End Sub
Sub TampilGrid()
DA = New OleDbDataAdapter("select * from tblsiswa", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Sub TampilPendidikan()
CMD = New OleDbCommand("select * from tblLEVELPENDIDIKAN",
Conn)
DR = CMD.ExecuteReader
cmbPendidikan.Items.Clear()
Do While DR.Read
cmbPendidikan.Items.Add(DR.Item(0) & Space(2) & DR(1))
Loop
End Sub
Sub Tampilangkatan()
CMD = New OleDbCommand("select DISTINCT TAHUN_AJARAN from
tblSISWA", Conn)
DR = CMD.ExecuteReader
cmbTahunAjaran.Items.Clear()
Do While DR.Read
cmbTahunAjaran.Items.Add(DR.Item(0))
Loop
End Sub
Sub TampilJurusan()
CMD = New OleDbCommand("select DISTINCT JURUSAN from
tblSISWA", Conn)
DR = CMD.ExecuteReader
cmbJurusan.Items.Clear()
Do While DR.Read
cmbJurusan.Items.Add(DR.Item(0))
Loop
End Sub
Sub Tampilkelas()
CMD = New OleDbCommand("select DISTINCT KELAS from
tblSISWA", Conn)
DR = CMD.ExecuteReader
cmbKelas.Items.Clear()
Do While DR.Read
cmbKelas.Items.Add(DR.Item(0))
Loop
End Sub
Sub Kondisiawal()
Call Kosongkan()
Call TampilPendidikan()
Call Tampilangkatan()
Call TampilGrid()
Call TampilJurusan()
Call Tampilkelas()
End Sub
Sub Carisiswa()
CMD = New OleDbCommand("select * from tblsiswa where
id_siswa='" & txtIDSiswa.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
End Sub
Call Carisiswa()
Try
If Not DR.HasRows Then
'Call Koneksi()
Dim simpan As String = "insert into tblsiswa
values ('" & txtIDSiswa.Text & "','" & txtNIS.Text & "','" &
txtNISN.Text & "','" & txtNama.Text & "','" &
Microsoft.VisualBasic.Left(cmbPendidikan.Text, 2) & "','" &
Microsoft.VisualBasic.Left(cmbPendidikan.Text, 2) & "','" &
cmbTahunAjaran.Text & "','" & cmbJurusan.Text & "','" &
cmbKelas.Text & "','" & cmbSemester.Text & "','" &
MasterMenu.panellembaga.Text & "')"
CMD = New OleDbCommand(simpan, Conn)
CMD.ExecuteNonQuery()
For i As Integer = 1 To 12
Dim TempO As Date =
DateAdd(DateInterval.Month, i - 1, DateValue(LtempoPertama.Text))
Call Koneksi()
Dim hasil As String = txtIDSiswa.Text
Dim simpandetail2 As String = "insert into
TBLSPP values ('" & txtIDSiswa.Text & i & "',0,'" & TempO
& "','" & Format(TempO, "MMMM") + " " + Format(TempO, "yyyy")
& "','" & txtIDSiswa.Text & "',0,'-','-')"
CMD = New OleDbCommand(simpandetail2, Conn)
CMD.ExecuteNonQuery()
Next
Call Kosongkan()
Call TampilGrid()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Call Carisiswa()
If DR.HasRows Then
Call Ketemu()
End If
End Sub
'End If
End Sub
Imports System.Data.OleDb
Sub Nomorotomat()
CMD = New OleDbCommand("select id_pembayaran from
tblpembayaran order by id_pembayaran desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
txtnomor.Text = "00001"
Else
txtnomor.Text =
Format(Microsoft.VisualBasic.Left(DR.Item("id_pembayaran"), 5) +
1, "00000")
End If
txtnomor.Enabled = False
End Sub
Sub Kosongkan()
txtIDSiswa.Clear()
txtnama.Clear()
txttotal.Clear()
txtdibayar.Clear()
txtkembali.Clear()
txtsisa.Clear()
txtIDpendidikan.Clear()
txtLevel.Clear()
txtsemester.Text = ""
txtjatuhtempo.Clear()
DGV.Columns.Clear()
End Sub
Sub TotalBayar()
Dim hitung As Integer
For baris As Integer = 0 To DGV.RowCount - 1
hitung = hitung + DGV.Rows(baris).Cells(5).Value
Next
txttotal.Text = hitung
txtdibayar.Text = hitung
txtkembali.Text = Val(txttotal.Text) -
Val(txtdibayar.Text)
End Sub
Sub TotalSisa()
Dim hitung As Integer
For baris As Integer = 0 To DGV.RowCount - 1
hitung = hitung + DGV.Rows(baris).Cells(4).Value
Next
txtsisa.Text = hitung
End Sub
Try
If e.ColumnIndex = 5 Then
If DateValue(TanggalBayar.Text) >
DateValue(txtjatuhtempo.Text) Then
DGV.Rows(e.RowIndex).Cells(6).Value = "BAYAR
TUNGGAKAN"
Else
DGV.Rows(e.RowIndex).Cells(6).Value = "BAYAR
CICILAN"
End If
DGV.Columns(6).AutoSizeMode =
DataGridViewAutoSizeColumnMode.DisplayedCells
DGV.Rows(e.RowIndex).Cells(4).Value =
DGV.Rows(e.RowIndex).Cells(2).Value -
(DGV.Rows(e.RowIndex).Cells(3).Value +
DGV.Rows(e.RowIndex).Cells(5).Value)
End If
Call TotalBayar()
Call TotalSisa()
Catch ex As Exception
MsgBox("Harus angka")
SendKeys.Send("{UP}")
DGV.Rows(e.RowIndex).Cells(5).Value = ""
DGV.Rows(e.RowIndex).Cells(6).Value = ""
End Try
End Sub
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
DA = New OleDbDataAdapter("select distinct
tblpembayarandetail.id_biaya AS [Id
Biaya],tblbiayadetail.nama_biaya as [Nama Biaya],jumlah_biaya as
[Jumlah Biaya],tblpembayarandetail.jumlah_bayar as [Sudah
Bayar],Sisa from tblpembayarandetail,tblbiayadetail,tblpembayaran
where tblpembayarandetail.id_biaya=tblbiayadetail.id_biaya and
tblpembayaran.id_siswa='" & txtIDSiswa.Text & "' and
left(tblpembayarandetail.id_biaya,2) = '" & txtIDpendidikan.Text
& "' and tblpembayarandetail.id_pembayaran in (select
max(id_pembayaran) from tblpembayarandetail where left(id_biaya,2)
='" & txtIDpendidikan.Text & "') group by
tblpembayarandetail.id_biaya,tblbiayadetail.nama_biaya,tblbiayadet
ail.jumlah_biaya,tblpembayarandetail.jumlah_bayar,sisa order by
1", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.Columns.Add("bayar", "Bayar Sekarang")
DGV.Columns.Add("Keterangan", "Keterangan")
DGV.Columns(1).AutoSizeMode =
DataGridViewAutoSizeColumnMode.DisplayedCells
DGV.Columns(0).ReadOnly = True
DGV.Columns(1).ReadOnly = True
DGV.Columns(2).ReadOnly = True
DGV.Columns(3).ReadOnly = True
DGV.Columns(4).ReadOnly = True
For baris As Integer = 0 To DGV.RowCount - 2
DGV.Rows(baris).Cells(3).Value =
DGV.Rows(baris).Cells(2).Value - DGV.Rows(baris).Cells(4).Value
DGV.Rows(baris).Cells(5).Value = 0
DGV.Rows(baris).Cells(6).Value = "-"
If DGV.Rows(baris).Cells(4).Value <=
0 Then
DGV.Rows(baris).Cells(5).ReadOnly
= True
Else
DGV.Rows(baris).Cells(5).ReadOnly
= False
End If
Next
If txtsisa.Text = 0 Then
MsgBox("pembayaran sudah lunas")
Call Kosongkan()
End If
Else
Call TampilGridBiaya()
DGV.Columns(0).ReadOnly = True
DGV.Columns(1).ReadOnly = True
DGV.Columns(2).ReadOnly = True
DGV.Columns(3).ReadOnly = True
DGV.Columns(4).ReadOnly = True
End If
Else
txtnama.Clear()
txtIDpendidikan.Clear()
txtsemester.Text = ""
DGV.Columns.Clear()
MsgBox("Id siswa tidak terdaftar")
DataSiswa.Show()
End If
End If
Sub TampilGridBiaya()
DA = New OleDbDataAdapter("select * from tblbiayadetail
where left(id_biaya,2) = '" & txtIDpendidikan.Text & "' order by
1", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.Columns(1).AutoSizeMode =
DataGridViewAutoSizeColumnMode.DisplayedCells
DGV.Columns(2).DefaultCellStyle.Format = "###,###,###"
DGV.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
Next
DGV.Columns(4).DefaultCellStyle.ForeColor = Color.Red
DGV.Columns(1).AutoSizeMode =
DataGridViewAutoSizeColumnMode.DisplayedCells
Call TotalSisa()
End Sub
Sub Bayarotomatis()
'Call Koneksi()
CMD = New OleDbCommand("select * from TBLSPP where
No_bayar in(select max(No_Bayar) from TBLSPP)", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
TxtNomorBayar.Text = Format(Now, "yyMMdd") + "0001"
Else
If Microsoft.VisualBasic.Left(DR.Item("no_Bayar"), 6)
= Format(Now, "yyMMdd") Then
TxtNomorBayar.Text = DR.Item("no_Bayar") + 1
Else
TxtNomorBayar.Text = Format(Now, "yyMMdd")
+ "0001"
End If
End If
End Sub
Sub KondisiAwal()
TxtIDSiswa.Clear()
Label2.Text = ""
LBLnamaSiswa.Text = ""
LblKelas.Text = ""
LBLtahunAjaran.Text = ""
LBiayaSPP.Text = ""
Label13.Text = ""
Label15.Text = ""
Label17.Text = ""
Label18.Text = ""
Button1.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
DGV.Columns.Clear()
TxtIDSiswa.Focus()
End Sub
End Sub
Else
MsgBox("ID_Siswa tidak terdaftar")
Call KondisiAwal()
DataSiswa.Show()
End If
End If
'Call Koneksi()
CMD = New OleDbCommand("select * from TBLSPP where
ID_Siswa='" & TxtIDSiswa.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
'Call Koneksi()
DA = New OleDbDataAdapter("select * from TBLSPP where
ID_Siswa='" & TxtIDSiswa.Text & "' ORDER BY 3", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
DGV.Columns(5).DefaultCellStyle.Format = "###,###,###"
DGV.Columns(5).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV.Columns(4).Visible = False
DGV.Columns(7).Visible = False
DGV.Columns(6).Width = 150
Call TotalTelahDibayar()
Call TotalBelumDibayar()
End If
If Not ((e.KeyChar >= "0" And e.KeyChar
<= "9") Or e.KeyChar = vbBack) Then e.Handled = True
End Sub
Sub TotalTelahDibayar()
Dim hitung As Integer = 0
For baris As Integer = 0 To DGV.RowCount - 1
hitung = hitung + DGV.Rows(baris).Cells(5).Value
Label13.Text = Format(hitung, "###,###,###")
Next
'Call Koneksi()
CMD = New OleDbCommand("select count(keterangan) from
TBLSPP where ID_Siswa='" & TxtIDSiswa.Text & "' and keterangan<>'-
'", Conn)
DR = CMD.ExecuteReader
DR.Read()
Label17.Text = DR.Item(0) & " Bulan"
End Sub
Sub TotalBelumDibayar()
'Call Koneksi()
CMD = New OleDbCommand("select count(keterangan) from
TBLSPP where ID_Siswa='" & TxtIDSiswa.Text & "' and keterangan='-
'", Conn)
DR = CMD.ExecuteReader
DR.Read()
Label18.Text = DR.Item(0) & " Bulan"
Label15.Text =
Val(Microsoft.VisualBasic.Str(LBiayaSPP.Text) * DR.Item(0))
Label15.Text = FormatNumber(Label15.Text, 0)
End Sub
'Call Koneksi()
DA = New OleDbDataAdapter("select * from TBLSPP where
ID_Siswa='" & TxtIDSiswa.Text & "' ORDER BY 3", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
DGV.Columns(5).DefaultCellStyle.Format = "###,###,###"
DGV.Columns(5).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV.Columns(6).Width = 190
Call TotalTelahDibayar()
Call TotalBelumDibayar()
Call Bayarotomatis()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Cetak.Show()
Cetak.CRV.SelectionFormula = "{TBLSPP.no_bayar}='" &
TextBox2.Text & "'"
laporan.Load("master spp.rpt")
Call SetingLaporan()
Cetak.CRV.ReportSource = laporan
Cetak.CRV.RefreshReport()
End Sub
End Sub
Cetak.Show()
Cetak.CRV.SelectionFormula = "{TBLSPP.ID_Siswa}='" &
TxtIDSiswa.Text & "'"
laporan.Load("master spp.rpt")
Call SetingLaporan()
Cetak.CRV.ReportSource = laporan
Cetak.CRV.RefreshReport()
End Sub
Imports System.Data.OleDb
Sub TampilKelas()
'Call Koneksi()
CMD = New OleDbCommand("select distinct kelas from
tblsiswa", Conn)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item("kelas"))
ComboBox2.Items.Add(DR.Item("kelas"))
Loop
End Sub
End Sub
End Sub
End Sub
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
Dim simpan As String = "insert into tblrekap
values('" & DGV.Rows(baris).Cells(0).Value & "','" &
DGV.Rows(baris).Cells(1).Value & "','" &
DGV.Rows(baris).Cells(2).Value & "','" &
DGV.Rows(baris).Cells(3).Value & "','" &
DGV.Rows(baris).Cells(4).Value & "','" &
DGV.Rows(baris).Cells(5).Value & "')"
CMD = New OleDbCommand(simpan, Conn)
CMD.ExecuteNonQuery()
Else
Dim edit As String = "update tblrekap set
nama_siswa='" & DGV.Rows(baris).Cells(1).Value
& "',pendidikan='" & DGV.Rows(baris).Cells(2).Value
& "',biaya='" & DGV.Rows(baris).Cells(3).Value
& "',telah_bayar='" & DGV.Rows(baris).Cells(4).Value
& "',sisa='" & DGV.Rows(baris).Cells(5).Value & "' where
id_siswa='" & DGV.Rows(baris).Cells(0).Value & "'"
CMD = New OleDbCommand(edit, Conn)
CMD.ExecuteNonQuery()
End If
Next
laporan.Load("rekap pembayaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
End Class
Imports System.Data.OleDb
DS = New DataSet
DA.Fill(DS)
DGV1.DataSource = DS.Tables(0)
DGV1.ReadOnly = True
DGV1.Columns(6).DefaultCellStyle.Format = "#,###"
DGV1.Columns(6).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DA = New OleDbDataAdapter("SELECT
TBLPEMBAYARAN.ID_PEMBAYARAN,TANGGAL,TOTAL_BAYAR,SISA_BIAYA FROM
TBLPEMBAYARAN WHERE ID_SISWA LIKE '%" & TextBox1.Text & "%'",
Conn)
DS = New DataSet
DA.Fill(DS)
DGV2.DataSource = DS.Tables(0)
DGV2.ReadOnly = True
DGV2.Columns(2).DefaultCellStyle.Format = "#,###"
DGV2.Columns(3).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV2.Columns(2).DefaultCellStyle.Format = "#,###"
DGV2.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV2.Columns(3).DefaultCellStyle.Format = "#,###"
DGV2.Columns(3).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DS = New DataSet
DA.Fill(DS)
DGV3.DataSource = DS.Tables(0)
DGV3.ReadOnly = True
DGV3.Columns(2).DefaultCellStyle.Format = "#,###"
DGV3.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV3.Columns(3).DefaultCellStyle.Format = "#,###"
DGV3.Columns(3).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
End If
Call HitungTotal()
If txttotalbiaya.Text = txttotalbayar.Text Then
txtketerangan.Text = "LUNAS"
Else
txtketerangan.Text = "BELUM LUNAS"
End If
If e.KeyCode = Keys.Escape Then
Me.Close()
End If
End Sub
Sub HitungTotal()
txttotalsisa.Text = txttotalbiaya.Text -
txttotalbayar.Text
txttotalsisa.Text = FormatNumber(txttotalsisa.Text, 0)
End Sub
DS = New DataSet
DA.Fill(DS)
DGV3.DataSource = DS.Tables(0)
DGV3.ReadOnly = True
DGV3.Columns(2).DefaultCellStyle.Format = "#,###"
DGV3.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV3.Columns(3).DefaultCellStyle.Format = "#,###"
DGV3.Columns(3).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
End Sub
DS = New DataSet
DA.Fill(DS)
DGV3.DataSource = DS.Tables(0)
DGV3.ReadOnly = True
DGV3.Columns(2).DefaultCellStyle.Format = "#,###"
DGV3.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGV3.Columns(3).DefaultCellStyle.Format = "#,###"
DGV3.Columns(3).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
End Sub
Imports System.Data.OleDb
Public Class LaporanSiswa
Sub TampilKelas()
'Call Koneksi()
CMD = New OleDbCommand("select distinct kelas from
tblsiswa", Conn)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
ComboBox3.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item("kelas"))
ComboBox3.Items.Add(DR.Item("kelas"))
Loop
End Sub
Sub TampilJurusan()
'Call Koneksi()
CMD = New OleDbCommand("select distinct jurusan from
tblsiswa", Conn)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
ComboBox3.Items.Clear()
Do While DR.Read
ComboBox5.Items.Add(DR.Item("jurusan"))
Loop
End Sub
Sub TampilTahun()
'Call Koneksi()
CMD = New OleDbCommand("select distinct tahun_ajaran from
tblsiswa", Conn)
DR = CMD.ExecuteReader
ComboBox2.Items.Clear()
ComboBox4.Items.Clear()
Do While DR.Read
ComboBox2.Items.Add(DR.Item("tahun_ajaran"))
ComboBox4.Items.Add(DR.Item("tahun_ajaran"))
Loop
End Sub
End Sub
End Sub
End Sub
Else
laporan.Load("laporan siswa.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End If
TextBox1.Focus()
End If
End Sub
End Sub
End Class