P. 1
Perancangan Basis Data - Sistem Informasi Perpustakaan dengan Visual Basic 2010

Perancangan Basis Data - Sistem Informasi Perpustakaan dengan Visual Basic 2010

|Views: 3,075|Likes:
Veröffentlicht vonHermawan M. Wijaya
tugas mata kuliah perancangan basis data, yaitu pembuatan sistem informasi perpustakaan emnggunakan visual basic 2010
tugas mata kuliah perancangan basis data, yaitu pembuatan sistem informasi perpustakaan emnggunakan visual basic 2010

More info:

Published by: Hermawan M. Wijaya on Apr 09, 2012
Urheberrecht:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

08/06/2014

pdf

text

original

FINAL PROJECT

“SISTEM INFORMASI PERPUSTAKAAN”
PERANCANGAN BASIS DATA

DISUSUN OLEH :
1. Thomas Bagus Yeriko 2. Hermawan M. Wijaya 3. Nurcahyaningrum Oktaviyanti 4. Ana Wati Ndarbeni (09.12.4053) (09.12.4075) (09.12.4112) (09.12.4241)

STMIK “AMIKOM” YOGYAKARTA 2011

APLIKASI SISTEM INFORMASI PERPUSTAKAAN UMUM
SplashScreen

Script SplashScreen
Public NotInheritable Class SplashScreen1 'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab ' of the Project Designer ("Properties" under the "Project" menu). Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Set up the dialog text at runtime according to the application's assembly information. 'TODO: Customize the application's assembly information in the "Application" pane of the project ' properties dialog (under the "Project" menu). 'Application title If My.Application.Info.Title <> "" Then ApplicationTitle.Text = My.Application.Info.Title Else 'If the application title is missing, use the application name, without the extension ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName ) End If 'Format the version information using the text set into the Version control at design time as the ' formatting string. This allows for effective localization if desired. ' Build and revision information could be included by using the following code and changing the ' Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar. See ' String.Format() in Help for more information.

' ' Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision) Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor) 'Copyright info Copyright.Text = My.Application.Info.Copyright End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Value += 4 If ProgressBar1.Value = 100 Then Timer1.Dispose() Me.Visible = False LoginForm1.Show() End If End Sub Private Sub MainLayoutPanel_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MainLayoutPanel.Paint Timer1.Enabled = True End Sub End Class

Form Login

Script Form Login
Public Class LoginForm1 Dim Keluar As MsgBoxResult ' TODO: Insert code to perform custom authentication using the provided username and password ' (See http://go.microsoft.com/fwlink/?LinkId=35339). ' The custom principal can then be attached to the current thread's principal as follows: ' My.User.CurrentPrincipal = CustomPrincipal ' where CustomPrincipal is the IPrincipal implementation used to perform authentication. ' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object ' such as the username, display name, etc. Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click If txtUser.Text = "" And txtPass.Text = "" Then MsgBox("Silahkan masukkan Username dan Password terlebih dahulu", vbOKOnly + vbInformation, "Informasi") txtUser.Focus() ElseIf txtUser.Text = "" Then MsgBox("Username masih kosong", vbOKOnly + vbInformation, "Informasi") txtUser.Focus() ElseIf txtPass.Text = "" Then MsgBox("Password masih kosong", vbOKOnly + vbInformation, "Informasi") txtPass.Focus() ElseIf txtUser.Text <> "Admin" And txtPass.Text <> "bl0124" Then MsgBox("Username dan password yang Anda masukkan salah", vbOKOnly + vbInformation, "Informasi") txtUser.Clear() txtPass.Clear() txtUser.Focus() ElseIf txtUser.Text <> "Admin" Then MsgBox("Username yang Anda masukkan salah", vbOKOnly + vbInformation, "Informasi") txtUser.Clear() txtUser.Focus() ElseIf txtPass.Text <> "bl0124" Then

MsgBox("Password yang Anda masukkan salah", vbOKOnly + vbInformation, "Informasi") txtPass.Clear() txtPass.Focus() Else Timer1.Enabled = True End If End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click Keluar = MsgBox("Apakah Anda yakin akan keluar ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Value += 4 If ProgressBar1.Value = 100 Then Timer1.Dispose() Me.Visible = False MDI.Show() End If End Sub End Class

Form MDI (Form Utama)

Script Form MDI
Public Class MDI Dim Keluar As MsgBoxResult Dim Masuk As MsgBoxResult Dim tulisan(2) As String Dim i, j As Integer Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click Keluar = MsgBox("Apakah Anda yakin akan keluar ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub Private Sub KeluarToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem1.Click Keluar = MsgBox("Apakah Anda yakin akan keluar ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub

Private Sub FormAnggotaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormAnggotaToolStripMenuItem.Click FormAnggota.MdiParent = Me FormAnggota.Show() End Sub Private Sub MDI_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load lblJam.Text = TimeValue(Now) lblTgl.Text = DateValue(Now) ControlMenu.MdiParent = Me FormBuku.MdiParent = Me FormAnggota.MdiParent = Me FormJudulBuku.MdiParent = Me ControlMenu.Show() tulisan(0) = " Sistem Informasi Perpustakaan Umum Blora " tulisan(1) = " Sistem Informasi Perpustakaan Umum Blora " tulisan(2) = " Sistem Informasi Perpustakaan Umum Blora " Label1.Text = tulisan(j) Timer2.Start() Timer1.Start() End Sub Private Sub FormJudulBukuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormJudulBukuToolStripMenuItem.Click FormJudulBuku.MdiParent = Me FormJudulBuku.Show() End Sub Private Sub FormBukuToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormBukuToolStripMenuItem1.Click MsgBox("Pastikan Anda mengisi Form Judul Buku terlebih dahulu sebelum mengisi form ini", vbOKOnly + vbInformation, "Informasi") Masuk = MsgBox("Sudahkah Anda mengisi Form Judul Buku ?", vbQuestion + vbYesNo, "Informasi") If Masuk = MsgBoxResult.Yes Then FormBuku.MdiParent = Me FormBuku.Show() End If End Sub Private Sub FormPeminjamanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormPeminjamanToolStripMenuItem.Click FormPeminjamanBuku.MdiParent = Me FormPeminjamanBuku.Show() End Sub Private Sub FormPengembalianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormPengembalianToolStripMenuItem.Click FormPengembalian.MdiParent = Me FormPengembalian.Show() End Sub Private Sub LaporanAnggotaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanAnggotaToolStripMenuItem.Click LaporanAngg.MdiParent = Me

LaporanAngg.Show() End Sub Private Sub LaporanBukuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanBukuToolStripMenuItem.Click LaporanDetailBuku.MdiParent = Me LaporanDetailBuku.Show() End Sub Private Sub LaporanPeminjamanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanPeminjamanToolStripMenuItem.Click LaporanBukuKeluar.MdiParent = Me LaporanBukuKeluar.Show() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim jamku As Date jamku = DateTime.Now lblJam.Text = jamku.Hour.ToString() lblMenit.Text = jamku.Minute.ToString() lblDetik.Text = jamku.Second.ToString() End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick If i.Equals(tulisan(j).Length) Then Me.Label1.Text = "" If j < tulisan.Length - 1 Then j = j + 1 Me.Label1.Text = tulisan(j) Else j = 0 End If i = 0 End If Label1.Text = tulisan(j).Substring(0, i) i = i + 1 End Sub End Class

Form Control Menu

Script Form Control Menu
Public Class ControlMenu Dim Masuk As MsgBoxResult Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click FormAnggota.MdiParent = MDI FormAnggota.Show() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click FormJudulBuku.MdiParent = MDI FormJudulBuku.Show() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click MsgBox("Pastikan Anda mengisi Form Judul Buku terlebih dahulu sebelum mengisi form ini", vbOKOnly + vbInformation, "Informasi") Masuk = MsgBox("Sudahkah Anda mengisi Form Judul Buku ?", vbQuestion + vbYesNo, "Informasi") If Masuk = MsgBoxResult.Yes Then FormBuku.MdiParent = MDI FormBuku.Show() End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click FormPeminjamanBuku.MdiParent = MDI FormPeminjamanBuku.Show() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

FormPengembalian.MdiParent = MDI FormPengembalian.Show() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click LaporanAngg.MdiParent = MDI LaporanAngg.Show() End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click LaporanDetailBuku.MdiParent = MDI LaporanDetailBuku.Show() End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click LaporanBukuKeluar.MdiParent = MDI LaporanBukuKeluar.Show() End Sub End Class

Form Anggota

Script Form Anggota
Public Class FormAnggota Dim errorku As System.Exception Dim Keluar As MsgBoxResult Private Sub AnggotaBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnggotaBindingNavigatorSaveItem.Click Try If Kode_AnggTextBox.Text = "" Then MsgBox("Kode harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Nama_AnggTextBox.Text = "" Then MsgBox("Nama harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf AlamatTextBox.Text = "" Then MsgBox("Alamat harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Tgl_lahirDateTimePicker.Text = "" Then MsgBox("Tanggal Lahir harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf GenderComboBox.Text = "" Then MsgBox("Jenis Kelamin harus diisi", vbOKOnly + vbInformation, "Informasi") Else Me.Validate() Me.AnggotaBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.DBPerpusFP4KDataSet) Timer1.Enabled = True End If Catch ex As Exception errorku = Err.GetException MsgBox("Anda memasukkan data yang salah, silahkan cek lagi data yang Anda masukkan", vbOKOnly + vbInformation, "Informasi") MsgBox(errorku.Message) End Try End Sub

Private Sub FormAnggota_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DBPerpusFP4KDataSet.Anggota' table. You can move, or remove it, as needed. Me.AnggotaTableAdapter.Fill(Me.DBPerpusFP4KDataSet.Anggota) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ToolStripProgressBar1.Value += 4 If ToolStripProgressBar1.Value = 100 Then Timer1.Dispose() MsgBox("Data berhasil disimpan", vbOKOnly + vbInformation, "Informasi") ToolStripProgressBar1.Value = 0 End If End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Keluar = MsgBox("Sudahkah Anda menyimpan semua data ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click MsgBox("Pastikan Anda menyimpan data setelah menambah data baru", vbOKOnly + vbInformation, "Informasi") Kode_AnggTextBox.Focus() End Sub Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click MsgBox("Data berhasil dihapus", vbOKOnly + vbInformation, "Informasi") MsgBox("Silahkan tekan tombol simpan setelah selesai menghapus data", vbOKOnly + vbInformation, "Informasi") End Sub Private Sub txtCariAngg_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCariAngg.KeyUp Dim dv As DataView = New DataView() dv.Table = DBPerpusFP4KDataSet.Anggota dv.RowFilter = "Kode_Angg like '" & txtCariAngg.Text & "%'" AnggotaBindingSource.DataSource = dv End Sub Private Sub txtCariNama_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCariNama.KeyUp Dim dv As DataView = New DataView() dv.Table = DBPerpusFP4KDataSet.Anggota dv.RowFilter = "Nama_Angg like '" & txtCariNama.Text & "%'" AnggotaBindingSource.DataSource = dv End Sub End Class

Form Judul Buku

Script Form Judul Buku
Public Class FormJudulBuku Dim errorku As System.Exception Dim Keluar As MsgBoxResult Private Sub Judul_BukuBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Judul_BukuBindingNavigatorSaveItem.Click Try If Kode_JudulTextBox.Text = "" Then MsgBox("Kode Judul harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Judul_BkTextBox.Text = "" Then MsgBox("Judul Buku harus diisi", vbOKOnly + vbInformation, "Informasi") Else Me.Validate() Me.Judul_BukuBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.DataSetBuku) Timer1.Enabled = True End If Catch ex As Exception errorku = Err.GetException MsgBox("Anda memasukkan data yang salah, silahkan cek lagi data yang Anda masukkan", vbOKOnly + vbInformation, "Informasi") MsgBox(errorku.Message) End Try End Sub Private Sub FormJudulBuku_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DataSetBuku.Buku' table. You can move, or remove it, as needed. Me.BukuTableAdapter.Fill(Me.DataSetBuku.Buku) 'TODO: This line of code loads data into the 'DataSetBuku.Judul_Buku' table. You can move, or remove it, as needed. Me.Judul_BukuTableAdapter.Fill(Me.DataSetBuku.Judul_Buku) End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ToolStripProgressBar1.Value += 4 If ToolStripProgressBar1.Value = 100 Then Timer1.Dispose() MsgBox("Data berhasil disimpan", vbOKOnly + vbInformation, "Informasi") ToolStripProgressBar1.Value = 0 End If End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Keluar = MsgBox("Sudahkah Anda menyimpan semua data ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click MsgBox("Data berhasil dihapus", vbOKOnly + vbInformation, "Informasi") MsgBox("Silahkan tekan tombol simpan setelah selesai menghapus data", vbOKOnly + vbInformation, "Informasi") End Sub Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click MsgBox("Pastikan Anda menyimpan data setelah menambah data baru", vbOKOnly + vbInformation, "Informasi") Kode_JudulTextBox.Focus() End Sub Private Sub txtCariKodeJudul_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCariKodeJudul.TextChanged Dim dv As DataView = New DataView() dv.Table = DataSetBuku.Judul_Buku dv.RowFilter = "Kode_Judul like '" & txtCariKodeJudul.Text & "%'" Judul_BukuBindingSource.DataSource = dv End Sub Private Sub txtCariJudul_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCariJudul.TextChanged Dim dv As DataView = New DataView() dv.Table = DataSetBuku.Judul_Buku dv.RowFilter = "Judul_Bk like '" & txtCariJudul.Text & "%'" Judul_BukuBindingSource.DataSource = dv End Sub End Class

Form Buku

Script Form Buku
Public Class FormBuku Dim errorku As System.Exception Dim Keluar As MsgBoxResult Private Sub BukuBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BukuBindingNavigatorSaveItem.Click Try If Kode_BukuTextBox.Text = "" Then MsgBox("Kode Buku harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Kode_JudulTextBox.Text = "" Then MsgBox("Kode Judul harus diisi", vbOKOnly + vbInformation, "Informasi") MsgBox("Kode Judul harus sama dengan Kode Judul yang baru dimasukkan di Form judul Buku", vbOKOnly + vbInformation, "Informasi") ElseIf PengarangTextBox.Text = "" Then MsgBox("Pengarang harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf PenerbitTextBox.Text = "" Then MsgBox("Penerbit harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Tgl_MasukDateTimePicker.Text = "" Then MsgBox("Tanggal Masuk Buku harus diisi", vbOKOnly + vbInformation, "Informasi") Else Me.Validate() Me.BukuBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.DataSetBuku) Timer1.Enabled = True End If Catch ex As Exception errorku = Err.GetException MsgBox("Anda memasukkan data yang salah, silahkan cek lagi data yang Anda masukkan", vbOKOnly + vbInformation, "Informasi") MsgBox(errorku.Message)

End Try End Sub Private Sub FormBuku_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DataSetBuku.Buku' table. You can move, or remove it, as needed. Me.BukuTableAdapter.Fill(Me.DataSetBuku.Buku) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ToolStripProgressBar1.Value += 4 If ToolStripProgressBar1.Value = 100 Then Timer1.Dispose() MsgBox("Data berhasil disimpan", vbOKOnly + vbInformation, "Informasi") ToolStripProgressBar1.Value = 0 End If End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Keluar = MsgBox("Sudahkah Anda menyimpan semua data ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click MsgBox("Pastikan Anda menyimpan data setelah menambah data baru", vbOKOnly + vbInformation, "Informasi") Kode_BukuTextBox.Focus() End Sub Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click MsgBox("Data berhasil dihapus", vbOKOnly + vbInformation, "Informasi") MsgBox("Silahkan tekan tombol simpan setelah selesai menghapus data", vbOKOnly + vbInformation, "Informasi") End Sub Private Sub txtCari_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCari.KeyUp Dim dv As DataView = New DataView() dv.Table = DataSetBuku.Buku dv.RowFilter = "Kode_Buku like '" & txtCari.Text & "%'" BukuBindingSource.DataSource = dv End Sub Private Sub txtCariPengarang_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCariPengarang.TextChanged Dim dv As DataView = New DataView() dv.Table = DataSetBuku.Buku dv.RowFilter = "Pengarang like '" & txtCariPengarang.Text & "%'"

BukuBindingSource.DataSource = dv End Sub Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCariPenerbit.KeyUp Dim dv As DataView = New DataView() dv.Table = DataSetBuku.Buku dv.RowFilter = "Penerbit like '" & txtCariPenerbit.Text & "%'" BukuBindingSource.DataSource = dv End Sub End Class

Form Peminjaman

Script Form Peminjaman
Public Class FormPeminjamanBuku Dim errorku As System.Exception Dim Keluar As MsgBoxResult Private Sub Buku_KeluarBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buku_KeluarBindingNavigatorSaveItem.Click Try If Kode_BkKeluarTextBox.Text = "" Then MsgBox("Kode Buku Keluar harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Kode_AnggTextBox.Text = "" Then MsgBox("Kode Anggota harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Nama_AnggTextBox.Text = "" Then MsgBox("Nama Anggota harus diisi", vbOKOnly + vbInformation, "Informasi") ElseIf Tgl_BukuKeluarDateTimePicker.Text = "" Then MsgBox("Tanggal Buku Keluar harus diisi", vbOKOnly + vbInformation, "Informasi") 'ElseIf rdoBtn1.Checked = False And rdoBtn2.Checked = False And rdoBtn3.Checked = False Then ' MsgBox("Jumlah dan Kode Buku yang akan dipinjam harus diisi", vbOKOnly + vbInformation, "Informasi") Else Me.Validate() Me.Buku_KeluarBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.DataSetBukuKeluar) Timer1.Enabled = True End If Catch ex As Exception errorku = Err.GetException MsgBox("Anda memasukkan data yang salah, silahkan cek lagi data yang Anda masukkan", vbOKOnly + vbInformation, "Informasi") MsgBox(errorku.Message) End Try End Sub

Private Sub FormPeminjamanBuku_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DataSetBuku.Judul_Buku' table. You can move, or remove it, as needed. Me.Judul_BukuTableAdapter.Fill(Me.DataSetBuku.Judul_Buku) 'TODO: This line of code loads data into the 'DataSetBukuKeluar.Buku_Keluar' table. You can move, or remove it, as needed. Me.Buku_KeluarTableAdapter.Fill(Me.DataSetBukuKeluar.Buku_Keluar) End Sub Private Sub rdoBtn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoBtn1.Click lblBuku1.Visible = True Kode_Buku1TextBox.Visible = True lblBuku2.Visible = False Kode_Buku2TextBox.Visible = False lblBuku3.Visible = False Kode_Buku3TextBox.Visible = False Kode_Buku1TextBox.Focus() End Sub Private Sub rdoBtn2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoBtn2.Click lblBuku1.Visible = True Kode_Buku1TextBox.Visible = True lblBuku2.Visible = True Kode_Buku2TextBox.Visible = True lblBuku3.Visible = False Kode_Buku3TextBox.Visible = False Kode_Buku1TextBox.Focus() End Sub Private Sub rdoBtn3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoBtn3.Click lblBuku1.Visible = True Kode_Buku1TextBox.Visible = True lblBuku2.Visible = True Kode_Buku2TextBox.Visible = True lblBuku3.Visible = True Kode_Buku3TextBox.Visible = True Kode_Buku1TextBox.Focus() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ToolStripProgressBar1.Value += 4 If ToolStripProgressBar1.Value = 100 Then Timer1.Dispose() MsgBox("Data berhasil disimpan", vbOKOnly + vbInformation, "Informasi") ToolStripProgressBar1.Value = 0 End If End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Keluar = MsgBox("Sudahkah Anda menyimpan semua data ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub

Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click MsgBox("Pastikan Anda menyimpan data setelah menambah data baru", vbOKOnly + vbInformation, "Informasi") Kode_BkKeluarTextBox.Focus() End Sub Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click MsgBox("Data berhasil dihapus", vbOKOnly + vbInformation, "Informasi") MsgBox("Silahkan tekan tombol simpan setelah selesai menghapus data", vbOKOnly + vbInformation, "Informasi") End Sub Private Sub txtCariKodeAngg_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCariKodeAngg.KeyUp Dim dv As DataView = New DataView() dv.Table = DataSetBukuKeluar.Buku_Keluar dv.RowFilter = "Kode_Angg like '" & txtCariKodeAngg.Text & "%'" Buku_KeluarBindingSource.DataSource = dv End Sub End Class

Form Pengembalian

Script Form Pengembalian
Public Class FormPengembalian Dim tglKeluar As Date Dim tglKembali As Date Dim lama As Integer Dim lamaDenda As Integer Dim jangkaWaktu As Integer Dim totalDenda As Integer Dim errorku As System.Exception Dim Keluar As MsgBoxResult Private Sub Buku_KeluarBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buku_KeluarBindingNavigatorSaveItem.Click Try If cmbJmlBuku.Text = "" Then MsgBox("Jumlah Buku yang dipinjam harus diisi", +vbOKOnly + vbCritical, "Peringatan") cmbJmlBuku.Focus() Else Me.Validate() Me.Buku_KeluarBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.DataSetBukuKeluar) Timer1.Enabled = True End If Catch ex As Exception errorku = Err.GetException MsgBox("Anda memasukkan data yang salah, silahkan cek lagi data yang Anda masukkan", vbOKOnly + vbInformation, "Informasi") MsgBox(errorku.Message) End Try End Sub Private Sub FormPengembalian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'TODO: This line of code loads data into the 'DataSetBukuKeluar.Buku_Keluar' table. You can move, or remove it, as needed. Me.Buku_KeluarTableAdapter.Fill(Me.DataSetBukuKeluar.Buku_Keluar) End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDenda.TextChanged 'tglKeluar = Me.Tgl_BukuKeluarDateTimePicker.Select. End Sub Private Sub btnTampilBkKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTampilBkKeluar.Click calBkKeluar.Visible = True End Sub Private Sub btnSembunyiBkKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSembunyiBkKeluar.Click calBkKeluar.Visible = False End Sub Private Sub btnTampilBkKembali_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTampilBkKembali.Click calBkKembali.Visible = True End Sub Private Sub btnSembunyiBkKembali_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSembunyiBkKembali.Click calBkKembali.Visible = False End Sub Private Sub btnDenda_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDenda.Click Dim denda As Integer denda = 1000 Try If cmbJmlBuku.Text = "" Then MsgBox("Jumlah Buku yang dipinjam harus diisi", +vbOKOnly + vbCritical, "Peringatan") cmbJmlBuku.Focus() Else tglKeluar = Me.calBkKeluar.SelectionRange.Start tglKembali = Me.calBkKembali.SelectionRange.End lama = (tglKembali - tglKeluar).TotalDays jangkaWaktu = 7 lamaDenda = lama - jangkaWaktu totalDenda = cmbJmlBuku.Text * lamaDenda * denda If lama > 7 Then MsgBox("Tanggal Peminjaman Buku adalah " & tglKeluar.Date & vbCrLf & _ "Tanggal Pengembalian Buku adalah " & tglKembali.Date & vbCrLf & _ "Total Buku yang dipinjam adalah " & cmbJmlBuku.Text & " buah" & vbCrLf & _ "Lama Peminjaman adalah " & lama & " hari" & vbCrLf & _ "Total Hari kena Denda adalah " & lamaDenda & " hari" & vbCrLf & _ "Denda yang harus dibayar adalah Rp " & totalDenda & ",-") ElseIf lama <= 7 And lama >= 0 Then MsgBox("Tanggal Peminjaman Buku adalah " & tglKeluar.Date & vbCrLf & _

"Tanggal Pengembalian Buku adalah " & tglKembali.Date & vbCrLf & _ "Total Buku yang dipinjam adalah " & cmbJmlBuku.Text & " buah" & vbCrLf & _ "Lama Peminjaman adalah " & lama & " hari" & vbCrLf & _ "Total Hari kena Denda adalah 0 hari" & vbCrLf & _ "Denda yang harus dibayar adalah Rp 0,-") Else MsgBox("Terdapat kesalahan dalam penginputan data", +vbOKOnly + vbCritical, "Peringatan") End If If lama <= 7 Then txtDenda.Text = "0" ElseIf lama > 7 Then txtDenda.Text = totalDenda Else MsgBox("Terdapat kesalahan dalam penginputan data", +vbOKOnly + vbCritical, "Peringatan") End If End If Catch ex As Exception errorku = Err.GetException MsgBox("Terdapat kesalahan dalam memasukkan data, silahkan cek lagi data yang Anda masukkan", vbOKOnly + vbInformation, "Informasi") MsgBox(errorku.Message) End Try End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ToolStripProgressBar1.Value += 4 If ToolStripProgressBar1.Value = 100 Then Timer1.Dispose() MsgBox("Data berhasil disimpan", vbOKOnly + vbInformation, "Informasi") ToolStripProgressBar1.Value = 0 End If End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Keluar = MsgBox("Sudahkah Anda menyimpan semua data ?", vbQuestion + vbYesNo, "Informasi") If Keluar = MsgBoxResult.Yes Then Close() End If End Sub Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click MsgBox("Data berhasil dihapus", vbOKOnly + vbInformation, "Informasi") MsgBox("Silahkan tekan tombol simpan setelah selesai menghapus data", vbOKOnly + vbInformation, "Informasi") txtDenda.Clear() End Sub Private Sub txtCariKodeAngg_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCariKodeAngg.TextChanged Dim dv As DataView = New DataView()

dv.Table = DataSetBukuKeluar.Buku_Keluar dv.RowFilter = "Kode_Angg like '" & txtCariKodeAngg.Text & "%'" Buku_KeluarBindingSource.DataSource = dv End Sub Private Sub txtCariKdBkKeluar_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCariKdBkKeluar.TextChanged Dim dv As DataView = New DataView() dv.Table = DataSetBukuKeluar.Buku_Keluar dv.RowFilter = "Kode_BkKeluar like '" & txtCariKdBkKeluar.Text & "%'" Buku_KeluarBindingSource.DataSource = dv End Sub Private Sub txtCariNamaAngg_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCariNamaAngg.TextChanged Dim dv As DataView = New DataView() dv.Table = DataSetBukuKeluar.Buku_Keluar dv.RowFilter = "Nama_Angg like '" & txtCariNamaAngg.Text & "%'" Buku_KeluarBindingSource.DataSource = dv End Sub End Class

Laporan
Laporan Anggota

Laporan Detail Buku

Laporan Buku Keluar

Script Database
create table Anggota( Kode_Angg varchar (10) not null primary key, Nama_Angg varchar(50)not null, Alamat varchar (50) not null, Tgl_lahir date not null, Gender varchar (2)not null, No_telp varchar (12)) create table Judul_Buku( Kode_Judul varchar (10) not null primary key, Judul_Bk varchar (100) not null) create table Buku ( Kode_Buku varchar (10) not null primary key, Kode_Judul varchar (10) not null, Pengarang varchar (50) not null, Penerbit varchar (50) not null, Tgl_Masuk date not null, foreign key (Kode_Judul)references Judul_Buku(Kode_Judul)) create table Buku_Keluar( Kode_BkKeluar varchar (10) not null primary key, Kode_Angg varchar (10) not null, Nama_Angg varchar(50)not null, Tgl_BukuKeluar datetime not null, Kode_Buku1 varchar (10) not null, Kode_Buku2 varchar (10), Kode_Buku3 varchar (10)) insert into Anggota values('01','Thomas','Jalan Kasuari No.77A Yogyakarta', '1990-04-21','L','085228122606'); insert into Anggota values('02','Hermawan','Jalan Jendral Sudirman No.153 Blora' ,'1991-05-30','L','085740011326'); insert into Anggota values('03','Cahya','Jalan Ahmad Yani No. 102 Yogyakarta', '1991-02-10','P','087852651001'); insert into Anggota values('04','Nevya','Jalan Merdeka No.45 Semarang ', '1991-11-05','P','085727234576'); insert into Anggota values('05','Ninis','Jalan Nusantara No.1 Jakarta', '1991-08-24','P','081804886480'); insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert into into into into into into into into into into into into into into into into into into into Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku Judul_Buku values values values values values values values values values values values values values values values values values values values ('A01','Pengantar Pemrograman Terstruktur'); ('A02','Pengantar Pemrograman Terstruktur'); ('A03','Pengantar Pemrograman Terstruktur'); ('A04','Pengantar Pemrograman Terstruktur'); ('A05','Pengantar Pemrograman Terstruktur'); ('B01','Komputer Grafis'); ('B02','Komputer Grafis'); ('B03','Komputer Grafis'); ('B04','Komputer Grafis'); ('B05','Komputer Grafis'); ('B06','Komputer Grafis'); ('B07','Komputer Grafis'); ('B08','Komputer Grafis'); ('B09','Komputer Grafis'); ('B10','Komputer Grafis'); ('C01','Aplikasi Sistem Pakar'); ('C02','Aplikasi Sistem Pakar'); ('C03','Aplikasi Sistem Pakar'); ('C04','Aplikasi Sistem Pakar');

insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku Periklanan'); insert into Judul_Buku Periklanan'); insert into Judul_Buku Periklanan'); insert into Judul_Buku Periklanan'); insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert into Judul_Buku insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16'); insert 16');

values values values values

('C05','Aplikasi ('C06','Aplikasi ('C07','Aplikasi ('D01','Aplikasi

Sistem Sistem Sistem Desain

Pakar'); Pakar'); Pakar'); Grafis Untuk

values ('D02','Aplikasi Desain Grafis Untuk values ('D03','Aplikasi Desain Grafis Untuk values ('D04','Aplikasi Desain Grafis Untuk values values values values values values values values values values values values values values values values values values values values values values values values values values values ('E01','Pintar Bahasa Inggris Lanjutan'); ('E02','Pintar Bahasa Inggris Lanjutan'); ('E03','Pintar Bahasa Inggris Lanjutan'); ('E04','Pintar Bahasa Inggris Lanjutan'); ('E05','Pintar Bahasa Inggris Lanjutan'); ('E06','Pintar Bahasa Inggris Lanjutan'); ('F01','Tata Bahasa Untuk Bahasa Inggris'); ('F02','Tata Bahasa Untuk Bahasa Inggris'); ('F03','Tata Bahasa Untuk Bahasa Inggris'); ('F04','Tata Bahasa Untuk Bahasa Inggris'); ('F05','Tata Bahasa Untuk Bahasa Inggris'); ('G01','Kupas Tuntas PHP & MySQL'); ('G02','Kupas Tuntas PHP & MySQL'); ('G03','Kupas Tuntas PHP & MySQL'); ('G04','Kupas Tuntas PHP & MySQL'); ('G05','Kupas Tuntas PHP & MySQL'); ('G06','Kupas Tuntas PHP & MySQL'); ('H01','Pelajaran Bahasa Jepang'); ('H02','Pelajaran Bahasa Jepang'); ('H03','Pelajaran Bahasa Jepang'); ('I01','Pengantar Jaringan Komputer'); ('I02','Pengantar Jaringan Komputer'); ('I03','Pengantar Jaringan Komputer'); ('I04','Pengantar Jaringan Komputer'); ('I05','Pengantar Jaringan Komputer'); ('I06','Pengantar Jaringan Komputer'); ('I07','Pengantar Jaringan Komputer');

into Buku values('AA1','A01','Armadyah Amborowati','ANDI','2011-05into Buku values('AA2','A02','Armadyah Amborowati','ANDI','2011-05into Buku values('AA3','A03','Armadyah Amborowati','ANDI','2011-05into Buku values('AA4','A04','Armadyah Amborowati','ANDI','2011-05into Buku values('AA5','A05','Armadyah Amborowati','ANDI','2011-05into Buku values('BB1','B01','Amir Fatah Sofyan','ANDI','2011-05into Buku values('BB2','B02','Amir Fatah Sofyan','ANDI','2011-05into Buku values('BB3','B03','Amir Fatah Sofyan','ANDI','2011-05into Buku values('BB4','B04','Amir Fatah Sofyan','ANDI','2011-05into Buku values('BB5','B05','Amir Fatah Sofyan','ANDI','2011-05into Buku values('BB6','B06','Amir Fatah Sofyan','ANDI','2011-05into Buku values('BB7','B07','Amir Fatah Sofyan','ANDI','2011-05-

insert into Buku values('BB8','B08','Amir Fatah Sofyan','ANDI','2011-0516'); insert into Buku values('BB9','B09','Amir Fatah Sofyan','ANDI','2011-0516'); insert into Buku values('BB10','B10','Amir Fatah Sofyan','ANDI','2011-0516'); insert insert insert insert insert insert insert insert 18'); insert 18'); insert 18'); insert 18'); insert insert insert insert insert insert into into into into into into into Buku Buku Buku Buku Buku Buku Buku values('CC1','C01','Kusrini','ANDI','2011-05-17'); values('CC2','C02','Kusrini','ANDI','2011-05-17'); values('CC3','C03','Kusrini','ANDI','2011-05-17'); values('CC4','C04','Kusrini','ANDI','2011-05-17'); values('CC5','C05','Kusrini','ANDI','2011-05-17'); values('CC6','C06','Kusrini','ANDI','2011-05-17'); values('CC7','C07','Kusrini','ANDI','2011-05-17');

into Buku values('DD1','D01','Muhammad Suyanto','ANDI','2011-05into Buku values('DD2','D02','Muhammad Suyanto','ANDI','2011-05into Buku values('DD3','D03','Muhammad Suyanto','ANDI','2011-05into Buku values('DD4','D04','Muhammad Suyanto','ANDI','2011-05into into into into into into Buku Buku Buku Buku Buku Buku values('EE1','E01','Drs.M.Ali values('EE2','E02','Drs.M.Ali values('EE3','E03','Drs.M.Ali values('EE4','E04','Drs.M.Ali values('EE5','E05','Drs.M.Ali values('EE6','E06','Drs.M.Ali K.','Amanah','2011-05-19'); K.','Amanah','2011-05-19'); K.','Amanah','2011-05-19'); K.','Amanah','2011-05-19'); K.','Amanah','2011-05-19'); K.','Amanah','2011-05-19');

insert into 05-19'); insert into 05-19'); insert into 05-19'); insert into 05-19'); insert into 05-19'); insert into 05-20'); insert into 05-20'); insert into 05-20'); insert into 05-20'); insert into 05-20'); insert into 05-20');

Buku values('FF1','F01','John Surjadi Hartanto','Indah','2011Buku values('FF2','F02','John Surjadi Hartanto','Indah','2011Buku values('FF3','F03','John Surjadi Hartanto','Indah','2011Buku values('FF4','F04','John Surjadi Hartanto','Indah','2011Buku values('FF5','F05','John Surjadi Hartanto','Indah','2011Buku values('GG1','G01','Andri Kristanto','Cable Book','2011Buku values('GG2','G02','Andri Kristanto','Cable Book','2011Buku values('GG3','G03','Andri Kristanto','Cable Book','2011Buku values('GG4','G04','Andri Kristanto','Cable Book','2011Buku values('GG5','G05','Andri Kristanto','Cable Book','2011Buku values('GG6','G06','Andri Kristanto','Cable Book','2011-

insert into Buku values('HH1','H01','T. Candra','Evergreen','2011-05-21'); insert into Buku values('HH2','H02','T. Candra','Evergreen','2011-05-21'); insert into Buku values('HH3','H03','T. Candra','Evergreen','2011-05-21'); insert into Buku values('II1','I01','Melwin Sfafrizal','ANDI','2011-0522'); insert into Buku values('II2','I02','Melwin Sfafrizal','ANDI','2011-0522');

insert 22'); insert 22'); insert 22'); insert 22'); insert 22'); select select select select

into Buku values('II3','I03','Melwin Sfafrizal','ANDI','2011-05into Buku values('II4','I04','Melwin Sfafrizal','ANDI','2011-05into Buku values('II5','I05','Melwin Sfafrizal','ANDI','2011-05into Buku values('II6','I06','Melwin Sfafrizal','ANDI','2011-05into Buku values('II7','I07','Melwin Sfafrizal','ANDI','2011-05* * * * from from from from Buku Anggota Judul_Buku Buku_Keluar

You're Reading a Free Preview

Herunterladen
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->