LAMPIRAN
//LOGIN
Imports System.Data.OleDb Public Class Login
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=tugas_akhir.accdb")
Try conn.Open()
Dim cmd As OleDbCommand = conn.CreateCommand
cmd.CommandText = "SELECT * FROM admin WHERE [username]='" & txtUsername.Text & "' AND [password]='" & txtPassword.Text & "'"
Dim userFound As Boolean = False Dim username As String = ""
Dim dr As OleDbDataReader = cmd.ExecuteReader While dr.Read
userFound = True
username = dr("username").ToString() End While
If userFound = True Then MenuUtama.Show()
MenuUtama.lblNama.Text = "Welcome, "& username Me.Hide()
Else
MsgBox("Username dan password tidak benar!", MsgBoxStyle.Information, "Invalid login")
End If dr.Close()
cmd.Dispose()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.MsgBoxHelp, "Invalid Login") Finally
conn.Close() End Try End Sub
Private Sub txtUsername_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUsername.TextChanged
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub End Class
//MENU UTAMA
Public Class MenuUtama
Private Sub btnbp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbp.Click
Log_BP.Show() End Sub
Private Sub btnGuru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuru.Click
Log_Guru.Show() End Sub
Private Sub btnsiswa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsiswa.Click
Log_Siswa.Show() End Sub
Private Sub btnback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnback.Click
Login.Show() Me.Hide() End Sub
Private Sub MenuUtama_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub End Class
//LOGIN BP
Public Class Log_BP
Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
End Class
//BP
Public Class BP
Private Sub btnGuru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuru.Click
DataGuru.Show() End Sub
Private Sub btnSiswa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSiswa.Click
DataSiswa.Show() End Sub
Private Sub btnback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnback.Click
MenuUtama.Show() Me.Hide()
End Sub End Class
//DATA GURU
Imports System.Data.OleDb Public Class DataGuru
Public da As New OleDbDataAdapter Public dt As New DataTable
Dim cn As New OleDbConnection Dim cmd As New OleDbCommand
Private Sub DataGuru_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= tugas_akhir.accdb"
End Sub
Sub showData(ByVal pelajaran As String)
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= tugas_akhir.accdb"
Try cn.Open()
With cmd
.Connection = cn
End With
Private Sub btnTampil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTampil.Click
Dim pelajaran As String = cbPelajaran.Text showData(pelajaran)
End Sub
Private Sub dgvGuru_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgvGuru.CellContentClick
txtNIP.Text = dgvGuru.Item(1, e.RowIndex).Value.ToString() txtNama.Text = dgvGuru.Item(2, e.RowIndex).Value.ToString() cbPelajaran1.Text() = dgvGuru.Item(3, e.RowIndex).Value.ToString() End Sub
Private Sub btnTambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTambah.Click
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= tugas_akhir.accdb"
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= tugas_akhir.accdb"
Dim i As Int32 Try
With cmd
.Connection = cn
.CommandText = "UPDATE guru SET nip='" & txtNIP.Text & "', nama = '" & txtNama.Text & "', pelajaran = '" & cbPelajaran1.Text & "' WHERE nip = '" & txtNIP.Text & "'"
i = .ExecuteNonQuery() cn.Close()
.Dispose() If i > 0 Then MsgBox("Success!")
showData(cbPelajaran1.Text) End If End With
Catch ex As Exception MsgBox(ex.Message)
Finally cn.Close() End Try End Sub
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= tugas_akhir.accdb"
Dim i As Int32 Try
cn.Open()
With cmd
.Connection = cn
.CommandText = "DELETE FROM guru WHERE nip = '" & txtNIP.Text & "'"
i = .ExecuteNonQuery() cn.Close()
.Dispose() If i > 0 Then MsgBox("Success!")
showData(txtNIP.Text) End If End With
Catch ex As Exception MsgBox(ex.Message)
Finally cn.Close() End Try End Sub
Private Sub btnkembali_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkembali.Click
MenuUtama.Show() Me.Hide()
//DATA SISWA
Imports System.Data.OleDb Public Class DataSiswa
Public da As New OleDbDataAdapter Public dt As New DataTable
Dim cn As New OleDbConnection Dim cmd As New OleDbCommand
Private Sub DataSiswa_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= semester_ganjil.accdb"
showData() End Sub
Sub showData() Try
If ConnectionState.Open Then cn.Open()
End If With cmd
.Connection = cn
.CommandText = "SELECT * FROM absensi" End With
da.SelectCommand = cmd dt.Clear()
da.Fill(dt)
dgvSiswa.DataSource = dt Catch ex As Exception
MsgBox(ex.Message) Finally cn.Close() End Try End Sub
Private Sub dgvSiswa_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvSiswa.CellClick txtNISN.Text = dgvSiswa.Item(1, e.RowIndex).Value.ToString() txtNama.Text = dgvSiswa.Item(2, e.RowIndex).Value.ToString() txtJK.Text = dgvSiswa.Item(3, e.RowIndex).Value.ToString() txtSakit.Text = dgvSiswa.Item(4, e.RowIndex).Value.ToString() txtIzin.Text = dgvSiswa.Item(5, e.RowIndex).Value.ToString() txtAlpa.Text = dgvSiswa.Item(6, e.RowIndex).Value.ToString() txtJumlah.Text = dgvSiswa.Item(7, e.RowIndex).Value.ToString() txtKelakuan.Text = dgvSiswa.Item(8, e.RowIndex).Value.ToString() txtKerajinan.Text = dgvSiswa.Item(9, e.RowIndex).Value.ToString() txtKerapian.Text = dgvSiswa.Item(10, e.RowIndex).Value.ToString() txtKebersihan.Text = dgvSiswa.Item(11, e.RowIndex).Value.ToString() txtKedisiplinan.Text = dgvSiswa.Item(12, e.RowIndex).Value.ToString() End Sub
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Try nama_siswa = '" & txtNISN.Text & "', jenis_kelamin = '" & txtJK.Text & "', sakit='" & txtSakit.Text & "', izin = '" & txtIzin.Text & "', alpa = '" & txtAlpa.Text & "', jumlah = '" & txtJumlah.Text & "', kelakuan = '" &
txtKelakuan.Text & "', kerajinan = '" & txtKerajinan.Text & "', kerapian = '" & txtKerapian.Text & "', kebersihan = '" & txtKebersihan.Text & "', kedisiplinan = '" & txtKedisiplinan.Text & "' WHERE nisn = '" & txtNISN.Text & "'"
i = .ExecuteNonQuery()
Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click
End Sub
Private Sub btnTambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTambah.Click
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= semester_ganjil.accdb"
Try cn.Open()
Dim i As Int32 With cmd
.Connection = cn
.CommandText = "INSERT INTO absensi(nisn, nama_siswa, jenis_kelamin, sakit, izin, alpa, jumlah, kelakuan, kerajinan, kerapian, kebersihan, kedisiplinan) " & _
"VAlUES('" & txtNISN.Text & "', '" & txtNama.Text & "', '" & txtJK.Text & "', '" & txtSakit.Text & "', '" & txtIzin.Text & "', '" &
txtAlpa.Text & "', '" & txtJumlah.Text & "', '" & txtKelakuan.Text & "', '" & txtKerajinan.Text & "', '" & txtKerapian.Text & "', '" & txtKebersihan.Text & "', '" & txtKedisiplinan.Text & "')"
i = .ExecuteNonQuery End With
If (i > 0) Then MsgBox("INSERT success!") showData()
End If
Catch ex As Exception MsgBox(ex.Message)
Finally cn.Close() End Try End Sub
Private Sub btnkembali_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkembali.Click
MenuUtama.Show() Me.Hide()
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
//LOGIN GURU
Imports System.Data.OleDb Public Class Log_Guru
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=tugas_akhir.accdb")
Try conn.Open()
Dim cmd As OleDbCommand = conn.CreateCommand
cmd.CommandText = "SELECT * FROM guru WHERE NIP='" & txtNIP.Text & "'"
Dim userFound As Boolean = False Dim nama_guru As String = "" Dim nip As String = ""
Dim dr As OleDbDataReader = cmd.ExecuteReader While dr.Read
userFound = True
nama_guru = dr("nama").ToString() nip = dr("nip").ToString()
End While
If userFound = True Then Guru.Show()
Guru.lblNama.Text = "Welcome, "& nama_guru Guru.lblNIP.Text = nip
Me.Hide()
Else
MsgBox("NIS TIDAK ADA", MsgBoxStyle.Information, "Invalid login") End If
dr.Close() cmd.Dispose()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.MsgBoxHelp, "Invalid Login") Finally
//GURU
Imports System.Data.OleDb Public Class Guru
Public da As New OleDbDataAdapter Public dt As New DataTable
Dim cn As New OleDbConnection Dim cmd As New OleDbCommand
Private Sub Guru_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Sub showData()
Dim namatabel As String = cbPelajaran.Text If cbPelajaran.Text = "Bahasa Indonesia" Then namatabel = "BAHASA_INDONESIA"
ElseIf cbPelajaran.Text = "Bahasa Inggris" Then namatabel = "BAHASA_INGGRIS"
End If
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= semester_ganjil.accdb"
Try cn.Open()
With cmd
.Connection = cn
.CommandText = "SELECT * FROM [" & namatabel & "]" End With
da.SelectCommand = cmd dt.Clear()
da.Fill(dt)
dgvGuru.DataSource = dt Catch ex As Exception MsgBox(ex.Message)
Finally cn.Close() End Try End Sub
Private Sub btnTampil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTampil.Click
showData() End Sub
Private Sub btnTambahNilai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTambahNilai.Click
showData() End Sub
Private Sub dgvGuru_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgvGuru.CellContentClick
txtUTS2.Text = dgvGuru.Item(5, e.RowIndex).Value.ToString()
txtUjianSemester.Text = dgvGuru.Item(6, e.RowIndex).Value.ToString() txtRapor.Text = dgvGuru.Item(7, e.RowIndex).Value.ToString()
txtPraktik.Text = dgvGuru.Item(8, e.RowIndex).Value.ToString() txtSikap.Text = dgvGuru.Item(9, e.RowIndex).Value.ToString() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click txtUTS1.Text & "', uts2 = '" & txtUTS2.Text & "', nus = '" &
txtUjianSemester.Text & "', praktik='" & txtPraktik.Text & "', rapot = '" & txtRapor.Text & "' WHERE nama_siswa = '" & lblNamaSiswa.Text & "'"
i = .ExecuteNonQuery() Val(txtUjianSemester.Text) + Val(txtPraktik.Text)) / 4 End If
txtRapor.Text = rata2.ToString() End Sub
Private Sub txtUTS1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUTS1.TextChanged
Private Sub txtUTS2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUTS2.TextChanged
hitungRata() End Sub
Private Sub txtRapor_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtRapor.TextChanged
hitungRata() End Sub
Private Sub txtPraktik_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPraktik.TextChanged
hitungRata() End Sub
Private Sub txtUjianSemester_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUjianSemester.TextChanged
hitungRata() End Sub
Private Sub btnCariSiswa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCariSiswa.Click
Dim namatabel As String = cbPelajaran.Text Dim namaSiswa As String = txtCariSiswa.Text If cbPelajaran.Text = "Bahasa Indonesia" Then namatabel = "BAHASA_INDONESIA"
ElseIf cbPelajaran.Text = "Bahasa Inggris" Then namatabel = "BAHASA_INGGRIS"
End If
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= semester_ganjil.accdb"
Try cn.Open()
With cmd
.Connection = cn
.CommandText = "SELECT * FROM [" & namatabel & "] WHERE nama_siswa LIKE '%" & namaSiswa & "%'"
End With
da.SelectCommand = cmd dt.Clear()
da.Fill(dt)
dgvGuru.DataSource = dt Catch ex As Exception MsgBox(ex.Message)
//LOGIN SISWA
Imports System.Data.OleDb Public Class Log_Siswa
Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=semester_ganjil.accdb")
Try conn.Open()
Dim cmd As OleDbCommand = conn.CreateCommand
cmd.CommandText = "SELECT * FROM absensi WHERE NISN='" & txtNIS.Text & "'"
Dim userFound As Boolean = False Dim nama_siswa As String = "" Dim nisn As String = ""
Dim dr As OleDbDataReader = cmd.ExecuteReader While dr.Read
userFound = True
nama_siswa = dr("nama_siswa").ToString() nisn = dr("nisn").ToString()
End While
If userFound = True Then Siswa.Show()
Siswa.lblNama.Text = "Welcome, "& nama_siswa Siswa.lblNISN.Text = nisn
Me.Hide()
Else
MsgBox("NIS TIDAK ADA", MsgBoxStyle.Information, "Invalid login") End If
dr.Close() cmd.Dispose()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.MsgBoxHelp, "Invalid Login") Finally
conn.Close() End Try End Sub
Private Sub Log_Siswa_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub End Class
Imports System.Data.OleDb Public Class Siswa
Public da As New OleDbDataAdapter Public dt As New DataTable
Dim cn As New OleDbConnection Dim cmd As New OleDbCommand
Private Sub Siswa_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Sub showData()
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= semester_ganjil.accdb"
Try cn.Open()
With cmd
.Connection = cn
.CommandText = "SELECT agama.*, PKN.*, bahasa_indonesia.*, matematika.* FROM ((agama INNER JOIN PKN ON PKN.nisn = agama.NISN) INNER JOIN bahasa_indonesia ON PKN.NISN = bahasa_indonesia.NISN) INNER JOIN matematika ON bahasa_indonesia.NISN=matematika.NISN WHERE matematika.nisn='" &lblNISN.Text() & "'"
End With
da.SelectCommand = cmd dt.Clear()
da.Fill(dt)
dgvSiswa.DataSource = dt Catch ex As Exception
MsgBox(ex.Message) Finally cn.Close() End Try End Sub
Private Sub btnTampil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTampil.Click
showData() End Sub
Private Sub lblNama_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblNama.Click
End Sub End Class
UNIVERSITAS SUMATERA UTARA
FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
Jln. Bioteknologi No.1 Kampus USU Padang Bulan Medan-20155
Telp. (061) 8211050, 8214290, Fax. (061) 8214290
Nama Mahasiswa
: Veronika br Sembiring
Kartu Bimbingan Tugas Akhir Mahasiswa
NIM
: 132406043
Judul Tugas Akhir
: Perancangan Aplikasi Pengolahan Nilai dan Konsling
...
SMA
Swasta GBKP Kabanjahe
Dosen Pembimbing
:Dr. Sawaluddin,M.IT
Tanggal Mulai Bimbingan
:
Tanggal Selesai Bimbingan
:
No
Tanggal Asisten
Bimbingan
Pembahasan Pada Asisten
Mengenai, Pada Bab
Paraf Dosen
Pembimbing
Keterangan
1
2
3
4
5
6
7
*Kartu ini harap dikembalikan ke Program Studi D-3 TeknikInformatika bila bimbingan mahasiswa telah selesai.