Program Aplikasi Rental DVD

Dewasa ini kemajuan teknologi terasa semakin pesat, terutama pada bidang teknologi informasi. Informasi merupakan salahsatu bagian untuk dapat mendukung kemajuan suatu perusahaan maupun instansi dengan tujuan memperkecil pengeluaran biaya dan mempersingkat watu kerja. Atas dasar tujuan tersebut perlu dilakukan dukungan penuh dengan keberadaan sistem informasi. Dengan demikian untuk bisa menghasilkan suatu informasi yang berkualitas yang memenuhi persyaratan suatu informasi seperti akurat, relevan, dan tepat waktu diperlukankeberadaan sistem teknologi informasi yang handal


            1.2 MANFAAT
·      Dapat memberi informasi kepada pembaca mengenai bahasa pemrograman visual basic 2010 dan mysql
·      Dengan adanya makalah ini diharapkan menjadi sumbangan pemikiran bagi para pembaca untuk mengembangkan bahasa pemrograman di masa sekarang.
            1.3 TUJUAN
·         Untuk memenuhi tugas Sistem Basis Data

·         Untuk memberi wawasan kepada pembaca tentang bahasa pemrograman visual basic dan juga mysql.

            2.1 PEMBAHASAN
                        a. Definisi sistem operasi
                                                Sistem informasi dapat didefinisikan sebagai suatu kumpulan data yang sudah diolah, terintregasi dan saling melengkapi yang menghasilkan informasi yang mempunyai nilai atau berguna dalam pengambilan keputusan. Sistem informasi pada aplikasi ini merupakan sistem informasi yang memproses data sehingga menghasilkan keluaran berupa informasi keuangan yang berguna bagi penggunanya.
                        b. Pengertian visual basic 2010
                                  Visual studio 2010 pada dasarnya adalah sebuah bahasa pemrograman komputer. Dimana pengertian dari bahasa pemrograman itu adalah perintah-perintah atau intruksi yang dimengerti oleh komputer untuk melakukan tugas tertentu.
                        c. Kelebihan dan kekurangan visual basic 2010
                        Kelebihan dari visual basic 2010:
1.      Bahasa yang sederhana. Banyak hal yang mungkin sulit untuk dilakukan jika kita menggunakan bahasa pemrograman lainnya.
2.      Karena visual basic 2010 sangat populer, maka sangat banyak sumber-sumber yang dapat kita gunakan untuk belajar dan mengembangkan kemampuan.
3.      Kita bisa memperoleh banyak tools baik gratis maupun tidak di internet yang akan sangat membantu menghemat waktu kita dalam pemrograman.
Kelemahan dari visual basic 2010:
1.      Visual basic adalah bahasa pemrograman yang powerfull, tetapi sebenarnya tidak terlalu bagus untuk membuat game-game yang benar-benar memuaskan.
2.      Lebih lambat dibandingkan dengan bahasa pemrograman lain.
                        d. Pengertian mySql
                                                XAMPP ialah perangkat lunak yang mendukung banyak sistem operasi, merupakan campuran dari beberapa program.
                        e. Kelebihan dan kekurangan mySql
                        Kelebihan mysql:
1.      Merupakan DBMS yang gratis / open source berlisensi GPL (Generic Public License).
2.      Cocok untuk perusahaan yang berskala kecil.
3.      Tidak membuutuhkan spesifikasi hardware yang tinggi untuk menjalankan mysql ini bahkan dengan spesifikasi hardware yang minimal sekalipun.
Kelemahan mysql:
1.      Tidak cocok untuk menangani data dengan jumlah yang besar, baik untuk menyimpan data maupun untuk memproses data.
2.      Memiliki keterbatasan kemampuan kinerja pada server ketika data yang disimpan telah melebihi batas maksimal kemampuan daya tampung server karena tidak menerapkan konsep teknologi cluster server.
3.      Untuk koneksi bahasa pemrograman visual seperti VB, delphi, dan foxpro mysql kurang support, karena koneksi ini menyebabkan field yang dibaca harus sesuai dengan koneksi dari program visual tersebut dan ini yang menyebabkan mysql jarang di pakai dalam program visual.
            2.2 RANCANGAN DATABASE
                        a. struktur tabel
                                    Nama Database : sewadvd
·         Tabel admin






·         Tabel kaset
·         Tabel kelompok_film
·         Tabel kostumer
·         Tabel pengembalian
·         Tabel Pinjaman
·         Tabel sewa


b. Relationship

            2.3 RANCANGAN INTERFACE
                       a. Menu utama



Public Class FormMain
    Sub Terkunci()
        LogMasukToolStripMenuItem.Enabled = True
        LogKeluarToolStripMenuItem.Enabled = False
        KeluarToolStripMenuItem.Enabled = True
        MasterToolStripMenuItem.Enabled = False
        TransaksiToolStripMenuItem.Enabled = False
        LaporanToolStripMenuItem.Enabled = False
      

    End Sub

    Private Sub FormMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Call Terkunci()
    End Sub

    Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
        End
    End Sub

    Private Sub LogMasukToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogMasukToolStripMenuItem.Click
        FormLogin.ShowDialog()
    End Sub

    Private Sub LogKeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogKeluarToolStripMenuItem.Click
        Call Terkunci()
    End Sub

    Private Sub PetugasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PetugasToolStripMenuItem.Click
        FormPetugas.ShowDialog()

    End Sub

    Private Sub AnggotaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnggotaToolStripMenuItem.Click
        FormKostumer.ShowDialog()
    End Sub

    Private Sub FilmToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FilmToolStripMenuItem.Click
        FormKelompokFilm.ShowDialog()

    End Sub

    Private Sub PeminjamanFilmToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PeminjamanFilmToolStripMenuItem.Click
        FormPinjaman.ShowDialog()
    End Sub

    Private Sub PengembalianFilmToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PengembalianFilmToolStripMenuItem.Click
        FormPengembalian.ShowDialog()
    End Sub

    Private Sub LaporanToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanToolStripMenuItem1.Click
        LaporanPinjaman.ShowDialog()
    End Sub

    Private Sub LaporanPetugasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanPetugasToolStripMenuItem.Click
        LaporanPetugas.ShowDialog()
    End Sub

    Private Sub LaporanAnggotaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanAnggotaToolStripMenuItem.Click
        LaporanKostumer.ShowDialog()
    End Sub

    Private Sub LaporanPengembalianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanPengembalianToolStripMenuItem.Click
        LaporanPengembalian.ShowDialog()
    End Sub
End Class
                        b. Login form
Imports System.Data.Odbc
Public Class FormLogin
    Dim CMD As New OdbcCommand
    Dim RD As OdbcDataReader

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Then
            MsgBox("data login belum lengkap")
            Exit Sub
        Else
            Call bukaDB()
            CMD = New OdbcCommand("select * from admin where nama='" & TextBox1.Text & "' and password='" & TextBox2.Text & "'", konek)
            RD = CMD.ExecuteReader
            RD.Read()
            If RD.HasRows Then
                Me.Close()
                FormMain.Show()
                FormMain.LogMasukToolStripMenuItem.Enabled = False
                FormMain.LogKeluarToolStripMenuItem.Enabled = True
                FormMain.KeluarToolStripMenuItem.Enabled = False
                FormMain.MasterToolStripMenuItem.Enabled = True
                FormMain.TransaksiToolStripMenuItem.Enabled = True
                FormMain.LaporanToolStripMenuItem.Enabled = True
              
            Else
                MsgBox("Nama Petugas atau Password salah")
            End If
        End If
    End Sub

    Private Sub FormLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.MaxLength = 6
        TextBox2.PasswordChar = "X"
        TextBox1.Clear()
        TextBox2.Clear()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub
End Class
c. Form Petugas
Imports System.Data.Odbc

Public Class FormPetugas
    Dim databaru As Boolean


    Private Sub FormPetugas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        databaru = False
        isigrid()
        Me.TextBox1.Enabled = False
        Me.TextBox2.Enabled = False
        Me.TextBox3.Enabled = False

        Me.Button3.Enabled = False
        Me.Button4.Enabled = False


    End Sub

  

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bersih()
        TextBox1.Focus()
        ttp()
        databaru = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim simpan As String
        Dim pesan As Integer

        If TextBox1.Text = "" Then Exit Sub
        If databaru Then
            pesan = MsgBox("Apakah Anda Yakin Data Akan ditambahkan ke Database ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "INSERT INTO admin(id_admin,nama,password) VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "') "
        Else
            pesan = MsgBox("Anda yakin data ini akan di update ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "UPDATE admin SET " _
                + "id_admin = '" & TextBox1.Text & "'," _
                + "nama ='" & TextBox2.Text & "'," _
                + "password ='" & TextBox3.Text & "' WHERE id_admin = '" & TextBox1.Text & "' "
        End If
        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub
    Sub isigrid()
        bukaDB()
        DA = New Odbc.OdbcDataAdapter("SELECT * FROM admin", konek)
        DS = New DataSet
        DS.Clear()
        DA.Fill(DS, "admin")
        DataGridView1.DataSource = (DS.Tables("admin"))
        DataGridView1.Enabled = True
    End Sub

    Sub bersih()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
       
    End Sub
    Private Sub jalankansql(ByVal sQl As String)
        Dim objcmd As New System.Data.Odbc.OdbcCommand
        Call bukaDB()
        Try
            objcmd.Connection = konek
            objcmd.CommandType = CommandType.Text
            objcmd.CommandText = sQl
            objcmd.ExecuteNonQuery()
            objcmd.Dispose()
            MsgBox("Data Sudah Disimpan", vbInformation)
        Catch ex As Exception
            MsgBox("Tidak Bisa Menyimpan data ke Server" & ex.Message)
        End Try
    End Sub

    Sub ttp()
        Me.TextBox1.Enabled = True
        Me.TextBox2.Enabled = True
        Me.TextBox3.Enabled = True
      
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub
    Sub ttpcari()
        Me.TextBox1.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub

    Private Sub isiTextBox(ByVal x As Integer)
        Try
            TextBox1.Text = DataGridView1.Rows(x).Cells(0).Value
            TextBox2.Text = DataGridView1.Rows(x).Cells(1).Value
            TextBox3.Text = DataGridView1.Rows(x).Cells(2).Value
          
        Catch ex As Exception
        End Try
    End Sub
    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub



    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Close()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bersih()
        TextBox1.Focus()
        ttpcari()
        databaru = True
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim simpan
        simpan = "UPDATE admin SET " _
              + "id_admin = '" & TextBox1.Text & "'," _
              + "nama ='" & TextBox2.Text & "'," _
              + "password ='" & TextBox3.Text & "' WHERE id_admin = '" & TextBox1.Text & "' "

        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
       
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim hapussql As String
        Dim pesan As Integer
        pesan = MsgBox("Apakah anda yakin akan menghapus data ,, " + TextBox2.Text, vbExclamation + vbYesNo, "Perhatian")
        If pesan = vbNo Then Exit Sub
        hapussql = "DELETE FROM admin where id_admin= '" & TextBox1.Text & " ' "
        jalankansql(hapussql)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
        Call bersih()
    End Sub
End Class





-          Crystal Report
d. Form Data anggota / Kostumer

Imports System.Data.Odbc

Public Class FormKostumer
    Dim databaru As Boolean


    Private Sub FormDataAnggota_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        databaru = False
        isigrid()
        Me.TextBox1.Enabled = False
        Me.TextBox2.Enabled = False
        Me.TextBox3.Enabled = False
        Me.TextBox4.Enabled = False
        Me.TextBox5.Enabled = False
        Me.Button3.Enabled = False
        Me.Button4.Enabled = False


    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bersih()
        TextBox1.Focus()
        ttp()
        databaru = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim simpan As String
        Dim pesan As Integer

        If TextBox1.Text = "" Then Exit Sub
        If databaru Then
            pesan = MsgBox("Apakah Anda Yakin Data Akan ditambahkan ke Database ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "INSERT INTO kostumer(no_identitas,jenis_identitas,nama,alamat,no_telpon) VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "'," _
                + " '" & TextBox4.Text & "','" & TextBox5.Text & "') "
        Else
            pesan = MsgBox("Anda yakin data ini akan di update ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "UPDATE kostumer SET " _
                + "no_identitas = '" & TextBox1.Text & "'," _
                + "jenis_identitas ='" & TextBox2.Text & "'," _
                + "nama ='" & TextBox3.Text & "'," _
                + "alamat ='" & TextBox4.Text & "'," _
                + "no_telpon ='" & TextBox5.Text & "' WHERE no_identitas = '" & TextBox1.Text & "' "
        End If
        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub
    Sub isigrid()
        bukaDB()
        DA = New Odbc.OdbcDataAdapter("SELECT * FROM kostumer", konek)
        DS = New DataSet
        DS.Clear()
        DA.Fill(DS, "kostumer")
        DataGridView1.DataSource = (DS.Tables("kostumer"))
        DataGridView1.Enabled = True
    End Sub

    Sub bersih()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
    End Sub
    Private Sub jalankansql(ByVal sQl As String)
        Dim objcmd As New System.Data.Odbc.OdbcCommand
        Call bukaDB()
        Try
            objcmd.Connection = konek
            objcmd.CommandType = CommandType.Text
            objcmd.CommandText = sQl
            objcmd.ExecuteNonQuery()
            objcmd.Dispose()
            MsgBox("Data Sudah Disimpan", vbInformation)
        Catch ex As Exception
            MsgBox("Tidak Bisa Menyimpan data ke Server" & ex.Message)
        End Try
    End Sub

    Sub ttp()
        Me.TextBox1.Enabled = True
        Me.TextBox2.Enabled = True
        Me.TextBox3.Enabled = True
        Me.TextBox4.Enabled = True
        Me.TextBox5.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub
    Sub ttpcari()
        Me.TextBox1.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub

    Private Sub isiTextBox(ByVal x As Integer)
        Try
            TextBox1.Text = DataGridView1.Rows(x).Cells(0).Value
            TextBox2.Text = DataGridView1.Rows(x).Cells(1).Value
            TextBox3.Text = DataGridView1.Rows(x).Cells(2).Value
            TextBox4.Text = DataGridView1.Rows(x).Cells(3).Value
            TextBox5.Text = DataGridView1.Rows(x).Cells(4).Value
        Catch ex As Exception
        End Try
    End Sub
    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        isiTextBox(e.RowIndex)
        DATABARU = False
    End Sub



    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bersih()
        TextBox1.Focus()
        ttpcari()
        databaru = True
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim simpan
        simpan = "UPDATE kostumer SET " _
               + "no_identitas = '" & TextBox1.Text & "'," _
               + "jenis_identitas ='" & TextBox2.Text & "'," _
               + "nama ='" & TextBox3.Text & "'," _
               + "alamat ='" & TextBox4.Text & "'," _
               + "no_telpon ='" & TextBox5.Text & "' WHERE no_identitas = '" & TextBox1.Text & "' "

        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim hapussql As String
        Dim pesan As Integer
        pesan = MsgBox("Apakah anda yakin akan menghapus data ,, " + TextBox2.Text, vbExclamation + vbYesNo, "Perhatian")
        If pesan = vbNo Then Exit Sub
        hapussql = "DELETE FROM kostumer where no_identitas= '" & TextBox1.Text & " ' "
        jalankansql(hapussql)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
        Call bersih()
    End Sub
End Class

      Crystal Report
      



e. Form Kelompok film

Imports System.Data.Odbc

Public Class FormKelompokFilm
    Dim databaru As Boolean


    Private Sub FormKelompokFilm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        databaru = False
        isigrid()
        Me.TextBox1.Enabled = False
        Me.TextBox2.Enabled = False
        Me.TextBox3.Enabled = False



    End Sub



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bersih()
        TextBox1.Focus()
        ttp()
        databaru = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim simpan As String
        Dim pesan As Integer

        If TextBox1.Text = "" Then Exit Sub
        If databaru Then
            pesan = MsgBox("Apakah Anda Yakin Data Akan ditambahkan ke Database ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "INSERT INTO Kelompok_film(kd_film,genre,harga_sewa) VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "') "
        Else
            pesan = MsgBox("Anda yakin data ini akan di update ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "UPDATE Kelompok_film SET " _
                + "kd_film = '" & TextBox1.Text & "'," _
                + "genre = '" & TextBox2.Text & "'," _
                + "harga_sewa ='" & TextBox3.Text & "' WHERE kd_film = '" & TextBox1.Text & "' "

        End If
        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub
    Sub isigrid()
        bukaDB()
        DA = New Odbc.OdbcDataAdapter("SELECT * FROM kelompok_film", konek)
        DS = New DataSet
        DS.Clear()
        DA.Fill(DS, "kelompok_film")
        DataGridView1.DataSource = (DS.Tables("kelompok_film"))
        DataGridView1.Enabled = True
    End Sub

    Sub bersih()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""

    End Sub
    Private Sub jalankansql(ByVal sQl As String)
        Dim objcmd As New System.Data.Odbc.OdbcCommand
        Call bukaDB()
        Try
            objcmd.Connection = konek
            objcmd.CommandType = CommandType.Text
            objcmd.CommandText = sQl
            objcmd.ExecuteNonQuery()
            objcmd.Dispose()
            MsgBox("Data Sudah Disimpan", vbInformation)
        Catch ex As Exception
            MsgBox("Tidak Bisa Menyimpan data ke Server" & ex.Message)
        End Try
    End Sub

    Sub ttp()
        Me.TextBox1.Enabled = True
        Me.TextBox2.Enabled = True
        Me.TextBox3.Enabled = True
    End Sub
    Sub ttpcari()
        Me.TextBox1.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub

    Private Sub isiTextBox(ByVal x As Integer)
        Try
            TextBox1.Text = DataGridView1.Rows(x).Cells(0).Value
            TextBox2.Text = DataGridView1.Rows(x).Cells(1).Value
            TextBox3.Text = DataGridView1.Rows(x).Cells(2).Value

        Catch ex As Exception
        End Try
    End Sub
    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub



    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bersih()
        TextBox1.Focus()
        ttpcari()
        databaru = True
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim simpan
        simpan = "UPDATE Kelompok_film SET " _
               + "kd_film = '" & TextBox1.Text & "'," _
               + "genre = '" & TextBox2.Text & "'," _
               + "harga_sewa ='" & TextBox3.Text & "' WHERE kd_film = '" & TextBox1.Text & "' "

        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim hapussql As String
        Dim pesan As Integer
        pesan = MsgBox("Apakah anda yakin akan menghapus data ,, " + TextBox2.Text, vbExclamation + vbYesNo, "Perhatian")
        If pesan = vbNo Then Exit Sub
        hapussql = "DELETE FROM Kelompok_film where kd_film= '" & TextBox1.Text & " ' "
        jalankansql(hapussql)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
        Call bersih()
    End Sub
End Class

       - Crystal report nya

f. Form Pinjaman film

Imports System.Data.Odbc

Public Class FormPinjaman
    Dim databaru As Boolean


    Private Sub FormPinjaman_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        databaru = False
        isigrid()
        Me.TextBox1.Enabled = False
        Me.TextBox2.Enabled = False
        Me.TextBox3.Enabled = False
        Me.TextBox4.Enabled = False
        Me.TextBox6.Enabled = False
        Me.TextBox7.Enabled = False

        Me.Button3.Enabled = False
        Me.Button4.Enabled = False


    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bersih()
        TextBox1.Focus()
        ttp()
        databaru = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim simpan As String
        Dim pesan As Integer

        If TextBox1.Text = "" Then Exit Sub
        If databaru Then
            pesan = MsgBox("Apakah Anda Yakin Data Akan ditambahkan ke Database ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If



            simpan = "INSERT INTO Pinjaman(  kd_sewa,no_identitas,tgl_sewa,total_film,tot_harga,denda) VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "'," _
                + " '" & TextBox4.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "') "
        Else
            pesan = MsgBox("Anda yakin data ini akan di update ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "UPDATE Pinjaman SET " _
                + "kd_sewa = '" & TextBox1.Text & "'," _
                + "no_identitas ='" & TextBox2.Text & "'," _
                + "tgl_sewa ='" & TextBox3.Text & "'," _
                + "total_film ='" & TextBox4.Text & "'," _
                + "tot_harga ='" & TextBox6.Text & "'," _
                + "denda ='" & TextBox7.Text & "' WHERE kd_sewa = '" & TextBox1.Text & "' "
        End If
        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub
    Sub isigrid()
        bukaDB()
        DA = New Odbc.OdbcDataAdapter("SELECT * FROM Pinjaman", konek)
        DS = New DataSet
        DS.Clear()
        DA.Fill(DS, "Pinjaman")
        DataGridView1.DataSource = (DS.Tables("Pinjaman"))
        DataGridView1.Enabled = True
    End Sub

    Sub bersih()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
    End Sub
    Private Sub jalankansql(ByVal sQl As String)
        Dim objcmd As New System.Data.Odbc.OdbcCommand
        Call bukaDB()
        Try
            objcmd.Connection = konek
            objcmd.CommandType = CommandType.Text
            objcmd.CommandText = sQl
            objcmd.ExecuteNonQuery()
            objcmd.Dispose()
            MsgBox("Data Sudah Disimpan", vbInformation)
        Catch ex As Exception
            MsgBox("Tidak Bisa Menyimpan data ke Server" & ex.Message)
        End Try
    End Sub

    Sub ttp()
        Me.TextBox1.Enabled = True
        Me.TextBox2.Enabled = True
        Me.TextBox3.Enabled = True
        Me.TextBox4.Enabled = True
        Me.TextBox6.Enabled = True
        Me.TextBox7.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub
    Sub ttpcari()
        Me.TextBox1.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub

    Private Sub isiTextBox(ByVal x As Integer)
        Try
            TextBox1.Text = DataGridView1.Rows(x).Cells(0).Value
            TextBox2.Text = DataGridView1.Rows(x).Cells(1).Value
            TextBox3.Text = DataGridView1.Rows(x).Cells(2).Value
            TextBox4.Text = DataGridView1.Rows(x).Cells(3).Value
            TextBox6.Text = DataGridView1.Rows(x).Cells(4).Value
            TextBox7.Text = DataGridView1.Rows(x).Cells(5).Value
        Catch ex As Exception
        End Try
    End Sub
    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub



    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bersih()
        TextBox1.Focus()
        ttpcari()
        databaru = True
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim simpan
        simpan = "UPDATE Pinjaman SET " _
               + "kd_sewa = '" & TextBox1.Text & "'," _
               + "no_identitas ='" & TextBox2.Text & "'," _
               + "tgl_sewa ='" & TextBox3.Text & "'," _
               + "total_film ='" & TextBox4.Text & "'," _
               + "tot_harga ='" & TextBox6.Text & "'," _
               + "denda ='" & TextBox7.Text & "' WHERE kd_sewa = '" & TextBox1.Text & "' "

        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim hapussql As String
        Dim pesan As Integer
        pesan = MsgBox("Apakah anda yakin akan menghapus data ,, " + TextBox2.Text, vbExclamation + vbYesNo, "Perhatian")
        If pesan = vbNo Then Exit Sub
        hapussql = "DELETE FROM pinjaman where kd_sewa= '" & TextBox1.Text & " ' "
        jalankansql(hapussql)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
        Call bersih()
    End Sub
End Class

       - Crystal Report
g. Form pengembalian film
Imports System.Data.Odbc

Public Class FormPengembalian
    Dim databaru As Boolean


    Private Sub FormPengembalian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        databaru = False
        isigrid()
        Me.TextBox1.Enabled = False
        Me.TextBox2.Enabled = False
        Me.TextBox3.Enabled = False
        Me.TextBox4.Enabled = False
        Me.TextBox7.Enabled = False

        Me.Button3.Enabled = False
        Me.Button4.Enabled = False


    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bersih()
        TextBox1.Focus()
        ttp()
        databaru = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim simpan As String
        Dim pesan As Integer

        If TextBox1.Text = "" Then Exit Sub
        If databaru Then
            pesan = MsgBox("Apakah Anda Yakin Data Akan ditambahkan ke Database ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If



            simpan = "INSERT INTO Pengembalian(  kd_sewa,no_identitas,tgl_sewa,tgl_kembali,denda) VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "'," _
                + " '" & TextBox4.Text & "','" & TextBox7.Text & "') "
        Else
            pesan = MsgBox("Anda yakin data ini akan di update ?", vbYesNo + vbInformation, "Perhatian")
            If pesan = vbYesNo Then
                Exit Sub
            End If
            simpan = "UPDATE Pengembalian SET " _
                + "kd_sewa = '" & TextBox1.Text & "'," _
                + "no_identitas ='" & TextBox2.Text & "'," _
                + "tgl_sewa ='" & TextBox3.Text & "'," _
                + "tgl_kembali ='" & TextBox4.Text & "'," _
                + "denda ='" & TextBox7.Text & "' WHERE kd_sewa = '" & TextBox1.Text & "' "
        End If
        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub
    Sub isigrid()
        bukaDB()
        DA = New Odbc.OdbcDataAdapter("SELECT * FROM Pengembalian", konek)
        DS = New DataSet
        DS.Clear()
        DA.Fill(DS, "Pengembalian")
        DataGridView1.DataSource = (DS.Tables("Pengembalian"))
        DataGridView1.Enabled = True
    End Sub

    Sub bersih()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox7.Text = ""
    End Sub
    Private Sub jalankansql(ByVal sQl As String)
        Dim objcmd As New System.Data.Odbc.OdbcCommand
        Call bukaDB()
        Try
            objcmd.Connection = konek
            objcmd.CommandType = CommandType.Text
            objcmd.CommandText = sQl
            objcmd.ExecuteNonQuery()
            objcmd.Dispose()
            MsgBox("Data Sudah Disimpan", vbInformation)
        Catch ex As Exception
            MsgBox("Tidak Bisa Menyimpan data ke Server" & ex.Message)
        End Try
    End Sub

    Sub ttp()
        Me.TextBox1.Enabled = True
        Me.TextBox2.Enabled = True
        Me.TextBox3.Enabled = True
        Me.TextBox4.Enabled = True
        Me.TextBox7.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub
    Sub ttpcari()
        Me.TextBox1.Enabled = True
        Me.Button3.Enabled = True
        Me.Button4.Enabled = True

    End Sub

    Private Sub isiTextBox(ByVal x As Integer)
        Try
            TextBox1.Text = DataGridView1.Rows(x).Cells(0).Value
            TextBox2.Text = DataGridView1.Rows(x).Cells(1).Value
            TextBox3.Text = DataGridView1.Rows(x).Cells(2).Value
            TextBox4.Text = DataGridView1.Rows(x).Cells(3).Value
            TextBox7.Text = DataGridView1.Rows(x).Cells(4).Value
        Catch ex As Exception
        End Try
    End Sub
    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        isiTextBox(e.RowIndex)
        databaru = False
    End Sub



    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Close()
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bersih()
        TextBox1.Focus()
        ttpcari()
        databaru = True
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim simpan
        simpan = "UPDATE Pengembalian SET " _
             + "kd_sewa = '" & TextBox1.Text & "'," _
             + "no_identitas ='" & TextBox2.Text & "'," _
             + "tgl_sewa ='" & TextBox3.Text & "'," _
             + "tgl_kembali ='" & TextBox4.Text & "'," _
             + "denda ='" & TextBox7.Text & "' WHERE kd_sewa = '" & TextBox1.Text & "' "

        jalankansql(simpan)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim hapussql As String
        Dim pesan As Integer
        pesan = MsgBox("Apakah anda yakin akan menghapus data ,, " + TextBox2.Text, vbExclamation + vbYesNo, "Perhatian")
        If pesan = vbNo Then Exit Sub
        hapussql = "DELETE FROM pengembalian where kd_sewa= '" & TextBox1.Text & " ' "
        jalankansql(hapussql)
        Me.Cursor = Cursors.WaitCursor
        DataGridView1.Refresh()
        isigrid()
        Me.Cursor = Cursors.Default
        Call bersih()
    End Sub
End Class

-          Crystal Report


BAB III
IMPLEMENTASI
            3.1 Spesifikasi hardware dan software
                        a. Hardware yang digunakan: 
1. Sistem operasi MS Windows 8 32-bit
                                    2. Processor Intel core I3 @1.8 ghz
                                    3. RAM 2GB
                                    4. VGA Nvidia Geforce 720m
                                    5. Hard Drives 500GB
                        b. Software yang digunakan:
                                    1. Microsoft visual studio 2010
                                    2. Xampp
            3.2 Cara pengoperasian program
                        Cara pengoperasian program dengan cara mengoneksikan terlebih dahulu database ke program aplikasi dengan cara :
Tools -> Connect to database


BAB IV
PENUTUP
            4.1 KESIMPULAN
                        Secara umum makalah perograman ini berorientasi objek dengan visual studio 2010 dengan judul  “Program Aplikasi Rental kaset DVD” ini dibuat untuk mengetahui bagaimana mengelola sebuah sistem operasi dengan baik agar mudah dimengerti dan dipahami oleh pihak yang memerlukan informasi tersebut.
            4.2 SARAN    
·           Diharapkan makalah ini berguna dan dapat menjadi sarana pembelajar oleh pembaca, semoga pembaca menjadi lebih paham mengenai database dan aplikasi lain pendukungnya.
·           Selain memahami database yang ada pada makalah ini, diharapkan pembaca juga bisa memperoleh informasi dalam mempelajari database dan aplikasi visual studio.
·           Aplikasi visual studio 2010 dirancang agar lebih mudah dipelajari dan dipakai dalam aplikasi-aplikasi yang akan dibuat sesuai dengan kebutuhan tidak hanya database saja, tapi pembuatan aplikasi lainnya.

0 Komentar untuk "Program Aplikasi Rental DVD"

Silakan tinggalkan komentar anda. DILARANG KERAS menyimpan link blog/web pada komentar dengan tujuan backlink, Spam.

 
Copyright © 2014 Tutorial Kampus - All Rights Reserved
Template By. Catatan Info