P. 1
Makalah Program Aplikasi Loundry

Makalah Program Aplikasi Loundry

|Views: 836|Likes:
Veröffentlicht vonMuhammad Rizal Z

More info:

Categories:Types, Research
Published by: Muhammad Rizal Z on Feb 08, 2012
Urheberrecht:Attribution Non-commercial

Availability:

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

04/30/2013

pdf

text

original

PROGRAM APLIKASI LOUNDRY

Makalah Pemograman Visual Basic.Net 2005

Disusun Oleh : Nama : Sella Hendra Asfitri Nim : 10260154 Kelas : III/C

AMIK HASS BANDUNG MANAJEMEN INFORMATIKA DIPLOMA III (D3) TAHUN AJARAN 2010/2011

1

KATA PENGANTAR

Puji dan syukur kita panjatkan kehadirat Tuhan Yang Maha Esa, karena berkat rahmat dan hidayah Nya penulis dapat menyelesaikan makalah ini dengan Teknik Pemrograman Objek dengan Visual Studio 2005 yang berjudul ”PROGRAM APLIKASI LOUNDY”. Penyelesaian makalah ini tidak terlepas dari bantuan berbagai pihak. Oleh karna itu dengan kerendahan hati penulis mengucapkan terima kasih kepada : 1. Dosen pembimbing yang telah banyak memberi saran dan masukan tentang tugas. 2. Kedua orang tua yang mendukung baik secara moril maupun materil. 3. Sahabat penulis yang selalu menyemangati dan selalu menemani disaat penulis membutuhkan dukungan. Penulis menyadari masih banyak kekurangan dan masih jauh dari kesempurnaan dalam makalah yang penulis buat ini, untuk itu penulis mengharapkan kritik dan saran dari temanteman untuk menyempurnakan makalah ini. Semoga Makalah ini bermanfaat bagi pembaca sekalian.

Bandung, Januari 2012

Penulis

2

DAFTAR ISI

KATA PENGANTAR.............................................................................................2 DAFTAR ISI......................................................................................................3 BAB I.............................................................................................................5 PENDAHULUAN.................................................................................................5 Latar belakang..............................................................................................5 Manfaat ......................................................................................................5 Tujuan........................................................................................................6 BAB II............................................................................................................7 PERANCANGAN PROGRAM....................................................................................7 Pembahasan.................................................................................................7 1.1 Definisi Sistem Operasi.............................................................................7 1.2 Pengertian Visual Basic 2005......................................................................7 1.3 Kelebihan dan kekurangan Visual Basic 2005...................................................7 1.4 Pengertian Microsoft Access 2002................................................................8 1.5 Kelebihan dan Kekurangan Microsoft Access 2002.............................................8 Rancangan Database.......................................................................................8 2.1 Struktur Tabel.......................................................................................8 2.2 Relationship Diagram.............................................................................10 Rancangan Interface......................................................................................11 3.1 Splash Screen.......................................................................................12 3.2 Menu Utama........................................................................................13 3.3 LogIn Form..........................................................................................14 3.4 Form User...........................................................................................14 3.5 Form Barang........................................................................................15 3.6 Form Kurir..........................................................................................16 3.7 Form Konsumen....................................................................................17 3.8 Form Transaksi Setoran Cucian..................................................................18 Coding (Kode Program)...................................................................................19 4.1 Coding Splash Screen.............................................................................19

3

4.2 Coding Menu Utama...............................................................................20 4.3 Coding LogIn Form.................................................................................24 4.4 Coding Form User..................................................................................26 4.5 Coding Form Barang...............................................................................28 4.6 Coding Form Kurir.................................................................................30 4.7 Coding Form Konsumen...........................................................................33 4.8 Coding Form Transaksi Setoran Cucian........................................................35 4.9 Coding Form Transaksi Pengiriman Cucian....................................................40 Laporan.....................................................................................................44 5.1 Laporan Form User ...............................................................................44 5.2 Laporan Form Barang ............................................................................44 5.3 Laporan Form Kurir................................................................................45 5.4 Laporan Form Konsumen.........................................................................45 5.5Laporan Form Transaksi Setoran Cucian........................................................46 5.6 Laporan Form Transaksi Pengiriman Cucian..................................................46 BAB III..........................................................................................................47 Implementasi.................................................................................................47 Spesifikasi Hardware Dan Software....................................................................47 Cara Pengoperasian Program...........................................................................47 BAB IV..........................................................................................................49 PENUTUP......................................................................................................49 Kesimpulan.................................................................................................49 Saran........................................................................................................49 Daftar Pustaka................................................................................................50

4

BAB I PENDAHULUAN
Latar belakang
Microsoft berkonsentrasi dalam mengembangkan Microsoft .NET Framework 2.0, dan tentunya alat bantu untuk membangun program di atasnya. Hingga pada tahun 2005, mereka pun merilis versi terbaru dari Visual Basic .NET, yang kali ini disebut dengan Visual Basic 2005 (dengan membuang kata ".NET"), bersama-sama dengan beberapa aplikasi pengembangan lainnya. Untuk rilis 2005 ini, Microsoft menambahkan beberapa fitur baru, di antaranya adalah:
a.

Edit and Continue Fitur ini sebelumnya terdapat di dalam Visual Basic akan tetapi dihapus di dalam Visual Basic .NET. Dengan keberadaan fitur ini, para programmer dapat memodifikasi kode pada saat program dieksekusi dan melanjutkan proses eksekusi dengan kode yang telah dimodifikasi tersebut. Evaluasi ekspresi pada saat waktu desain.

Munculnya Pseudo-NameSpace "My", yang menyediakan: o Akses yang mudah terhadap beberapa area tertentu dari dalam .NET Framework yang tanpanya membutuhkan kode yang sangat signifikan. o Kelas-kelas yang dibuat secara dinamis (khususnya My.Forms). c. Peningkatan yang dilakukan terhadap konverter kode sumber dari Visual Basic ke Visual Basic .NET. d. Penggunaan kata kunci (keyword) Using, yang menyederhanakan penggunaan objekobjek yang membutuhkan pola Dispose untuk membebaskan sumber daya yang sudah tidak terpakai. e. Just My Code, yang menyembunyikan kode reusable yang ditulis oleh alat bantu Intergrated Development Environment (IDE) Visual Studio .NET. f. Pengikatan sumber data (Data Source binding), yang mampu mempermudah pengembangan aplikasi Basis Data berbasis Klien/Server.
b.

Fungsi-fungsi yang tersebut di atas (khususnya My) ditujukan untuk memfokuskan Visual Basic .NET sebagai sebuah platform pengembangan aplikasi secara cepat dan "menjauhkannya" dari bahasa C#.

Manfaat
- Memberi informasi kepada pembaca mengenai bahasa pemrograman Visual Basic - Makalah ini diharapkan menjadi sumbangan pemikiran bagi para pembaca untuk mengembangkan bahasa pemrograman dimasa sekarang.

5

Tujuan
- Untuk memenuhi tugas Tehnik Pemrograman.
- Untuk memberi pengetahuan kepada pembaca tentang bahasa pemograman Visual Basic 2005.

6

BAB II PERANCANGAN PROGRAM
Pembahasan
1.1 Definisi Sistem Operasi
Sistem informasi dapat didefinisikan sebagai suatu kumpulan data yang sudah diolah, terintegrasi dan saling melengkapi yang menghasilkan informasi yang mempunyai nilai atau berguna dalam pengambilan keputusan. Sistem informasi akuntansi pada aplikasi ini merupakan sistem informasi yang memproses data transaksi bisnis sehingga menghasilkan keluaran berupa informasi keuangan yang berguna bagi pemakainya. 1.2 Pengertian Visual Basic 2005 Visual Basic 2005 adalah salah satu bahasa pemrograman yang ditargetkan dalam Framework .NET. Seperti bahasa sehari-hari, Visual Basic memiliki sintaks dan beberapa kata-kata yang valid yang bisa digunakan dalam membuat aplikasi. Visual Basic merupakan pilihan yang populer bagi yang mulai belajar pemrograman karena sintaks penulisan kodenya begitu mudah dibandingkan dengan bahasa pemrograman yang lain.

1.3 Kelebihan dan kekurangan Visual Basic 2005
Kelebihan : 1. Pengguna dengan menggunakan. dasar pemrograman apapun bisa dengan mudah

2. Ketika kita melakukan instalasi program lain yang mendukung penggunaannya dalam VB, maka komponen dari program tersebut bisa di masukkan dalam daftar komponen VB. 3. Ketika kita melakukan kesalahan penulisan kode, VB secara otomatis memberitahuinya dan tidak perlu bersusah oayah mencarinya lagi dalam list code.

Kekurangan : 1. Sifat Komersial. 2. File VB sering menjadi target serangan virus.

7

3. Dokumentasi sebenarnya lengkap dalam MSDN, namun untuk instalasi MSDN membutuhkan biaya dan space hardisk yang besar.

1.4 Pengertian Microsoft Access 2002 Microsoft Access merupakan salah satu software pengolah database yang berjalan dibawah sistem windows. Microsoft Access merupakan salah satu produk Office dari Microsoft yang dapat menangani database dengan skala besar maupun kecil. Dalam pengolahan database, Microsoft Access ini memiliki sarana atau objekobjek yang dapat mempermudah pekerjaan bagi pengguna. Microsoft Access 2002 yang untuk selanjutnya disingkat Access 2002 merupakan salah satu program aplikasi basis data (database) paling lengkap dan canggih untuk saat ini, yang digunakan untuk merancang, membuat dan mengelola database secara lebih mudah. Software Access 2002 pada umumnya tergabung dalam paket software Microsoft Office 2002 yang tersimpan dalam CD-ROM.

1.5 Kelebihan dan Kekurangan Microsoft Access 2002 Kelebihan : Salah satu keunggulan Microsoft Access dilihat dari perspektif programmer adalah kompatibilitasnya dengan bahasa pemrograman Structured Query Language (SQL). Para pengguna dapat mencampurkan dan menggunakan kedua jenis bahasa tersebut (VBA dan Macro) untuk memprogram form dan logika dan juga untuk mengaplikasikan konsep berorientasi objek. Kekurangan : Microsoft Access kurang begitu bagus jika diakses melalui jaringan sehingga aplikasi-aplikasi yang digunakan oleh banyak pengguna cenderung menggunakan solusi sistem manajemen basis data yang bersifat klien atau server.

Rancangan Database
2.1 Struktur Tabel Nama Database : DBLoundryUAS Keterangan : * : Primary Key (PK)

Tabel User Field Name *Kode_User Nama_User

Data Type Text Text

Descriptions Kode Pengguna/User untuk LogIn (PK) Nama Pengguna/ User

8

Password_User Status_User

Text Text

Password Pengguna/User Status Administrator, Operator Pengguna/User

b. Tabel barang Field Name *Kode_Brg Nama_Brg Harga_Brg

Data Type Text Text Numeric

Descriptions Kode Barang Nama Barang Harga Barang /Satuan

c. Tabel Kurir Field Name *Kode_Kurir Nama_Kurir

Data Type Text Text

Descriptions Kode Pengirim/Kurir (PK) Nama Pengirim/Kurir

Tabel Konsumen
Field Name *Kode_Kon Nama_Kon Alamat_Kon Telp_Kon Data Type Text Text Text Text Descriptions Kode Konsumen (PK) Nama Konsumen Alamat/Tempat Tinggal Lengkap Konsumen Telepon Konsumen

Tabel Transaksi Setoran Cucian
Field Name *No_Loundry No_Pesanan Kode_Kon Kode_Brg Jumlah Sub_Total Total Uang_Muka Sisa Data Type Text Text Text Text Numeric Numeric Numeric Numeric Numeric Descriptions Nomor Tempat Loundry (PK) Nomor Pesanan Konsumen Kode Konsumen Kode Barang Jumlah Pakaian / Barang yang Dicuci Harga Keseluruhan Pesanan Harga Keseluruhan Pesanan Uang Muka / Separuh Harga (DP) Sisa dari Uang Muka / DP / Kekurangan yang Harus

9

Dibayar

Tabel Transaksi Pengiriman Cucian
Field Name *No_Kirim Tanggal_Kirim No_Pesanan Kode_Kon Kode_Kurir Jumlah_Brg Total Uang_Muka Kurang Dibayar Kembali Data Type Text Text Text Text Text Numeric Numeric Numeric Numeric Numeric Numeric Descriptions No Kirim untuk Memudahkan Petugas / Kurir Mengirim Barang Tanggal Kirim / Pengiriman Barang Nomor Pesanan Konsumen Kode Konsumen Kode Kurir Jumlah Pakaian / Barang yang Dicuci Harga Keseluruhan Pesanan Uang Muka / Separuh Harga (DP) Sisa dari Uang Muka / DP / Kekurangan yang Harus Dibayar Sisa dari Uang Muka / DP / Kekurangan yang Akan Dibayar Kembalian dari Pembayaran

2.2 Relationship Diagram Berikut ini adalah bentuk relationship diagram dari DBLoundryUAS:

10

Rancangan Interface
Berikut ini adalah Rancangan interface dari “Program Aplikasi Loundry“:

11

3.1 Splash Screen

12

3.2 Menu Utama

13

3.3 LogIn Form

3.4 Form User

14

3.5 Form Barang

15

3.6 Form Kurir

16

3.7 Form Konsumen

17

3.8 Form Transaksi Setoran Cucian

3.9 Form Transaksi Pengiriman Cucian

18

Coding (Kode Program)
Berikut ini merupakan coding dari setiap Form dalam “Program Aplikasi Loundry”:

4.1 Coding Splash Screen
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 Timer1.Start()

19

'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 '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) 'Copyright info End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If ProgressBar1.Value < 100 Then ProgressBar1.Value += 4 ElseIf ProgressBar1.Value = 100 Then Timer1.Stop() Me.Hide() MDIMenu.Show() End If End Sub End Class

4.2 Coding Menu Utama
Imports System.Windows.Forms Public Class MDIMenu Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) ' Create a new instance of the child form. Dim ChildForm As New System.Windows.Forms.Form ' Make it a child of this MDI form before showing it. ChildForm.MdiParent = Me m_ChildFormNumber += 1 ChildForm.Text = "Window " & m_ChildFormNumber ChildForm.Show() End Sub

20

Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs) Dim OpenFileDialog As New OpenFileDialog OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then Dim FileName As String = OpenFileDialog.FileName ' TODO: Add code here to open the file. End If End Sub Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Dim SaveFileDialog As New SaveFileDialog SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then Dim FileName As String = SaveFileDialog.FileName ' TODO: Add code here to save the current contents of the form to a file. End If End Sub Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ExitToolStripMenuItem.Click Global.System.Windows.Forms.Application.Exit() End Sub Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) ' Use My.Computer.Clipboard to insert the selected text or images into the clipboard End Sub Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) ' Use My.Computer.Clipboard to insert the selected text or images into the clipboard End Sub Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) 'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData to retrieve information from the clipboard. End Sub

Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.Cascade) End Sub Private Sub TileVerticleToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.TileVertical) End Sub Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.TileHorizontal) End Sub Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)

21

Me.LayoutMdi(MdiLayout.ArrangeIcons) End Sub Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) ' Close all child forms of the parent. For Each ChildForm As Form In Me.MdiChildren ChildForm.Close() Next End Sub Private m_ChildFormNumber As Integer = 0 Private Sub DataUserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataUserToolStripMenuItem.Click Dim form As New frUser() form.Show() End Sub Private Sub DataKonsumenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataKonsumenToolStripMenuItem.Click Dim form As New Konsumen() form.Show() End Sub Private Sub DataKarirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataKarirToolStripMenuItem.Click Dim form As New Kurir() form.Show() End Sub Private Sub DataBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataBarangToolStripMenuItem.Click Dim form As New Barang() form.Show() End Sub Private Sub LogInToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tslogin.Click Dim form As New LogIn() form.Show() End Sub Private Sub SetoranCucianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetoranCucianToolStripMenuItem.Click Dim form As New frSetoranCucian() form.Show() End Sub Private Sub ToolsMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolsLaporan.Click End Sub Private Sub DataUserToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataUserToolStripMenuItem1.Click

22

frrptUser.Show() End Sub Private Sub DataKonsumenToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataKonsumenToolStripMenuItem1.Click frrptKonsumen.Show() End Sub Private Sub DataKurirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataKurirToolStripMenuItem.Click frrptKurir.Show() End Sub Private Sub DataBarangToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataBarangToolStripMenuItem1.Click frrptBarang.Show() End Sub Private Sub MDIMenu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub PengirimanCucianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PengirimanCucianToolStripMenuItem.Click TPengirimanCucian.Show() End Sub Private Sub DataSetoranCucianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataSetoranCucianToolStripMenuItem.Click frrptSetoranCucian.Show() End Sub Private Sub DataPengirimanCucianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPengirimanCucianToolStripMenuItem.Click frrptPengirimanCucian.Show() End Sub Private Sub LogOutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOutToolStripMenuItem.Click tsMaster.Enabled = False tsTransaksi.Enabled = False ToolsLaporan.Enabled = False tslogin.Enabled = True End Sub Private Sub Toolskeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Toolskeluar.Click MsgBox("Anda Yakin Keluar") Close() End Sub End Class

23

4.3 Coding LogIn Form
Public Class LogIn Dim KNS As New OleDb.OleDbConnection Dim DA As New OleDb.OleDbDataAdapter Dim DT, DT2 As New DataTable Dim SQL, SQL2 As String Private Sub LogIn_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load KNS.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb" End Sub Sub cari() DT.Clear() SQL = "SELECT * FROM tbUser WHERE Nama_User='" & txtNamaUser.Text & "'" DA.SelectCommand = New OleDb.OleDbCommand(SQL, KNS) DA.Fill(DT) End Sub Sub cari2() DT2.Clear() SQL2 = "SELECT * FROM tbUser WHERE Password_User='" & txtPassUser.Text & "'" DA.SelectCommand = New OleDb.OleDbCommand(SQL, KNS) DA.Fill(DT2) End Sub Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click On Error Resume Next cari() cari2() If DT.Rows.Count <> 0 And txtPassUser.Text = DT2.Rows(1)(2) Then If DT2.Rows.Count <> 0 Then MessageBox.Show("ANDA BERHASIL LOGIN", "INFORMASI", MessageBoxButtons.OK, MessageBoxIcon.Information) MDIMenu.tsSystem.Enabled = True MDIMenu.tsMaster.Enabled = True MDIMenu.tsTransaksi.Enabled = True MDIMenu.tslogin.Enabled = False MDIMenu.LogOutToolStripMenuItem.Enabled = True Me.Close() Else MessageBox.Show("user atau password salah!!", "INFORMASI", MessageBoxButtons.OK, MessageBoxIcon.Information) txtNamaUser.Clear() txtPassUser.Clear() txtNamaUser.Focus() End If Else

24

MessageBox.Show("GAGAL LOGIN", "INFORMASI", MessageBoxButtons.OK, MessageBoxIcon.Information) txtNamaUser.Focus() End If End Sub Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click Close() End Sub End Class

25

4.4 Coding Form User
Public Class frUser Dim daUser As OleDb.OleDbDataAdapter Dim con As New OleDb.OleDbConnection(Koneksi("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb")) Dim dtUser As New DataTable() Dim drUser As DataRow Function Koneksi(ByVal strDatabase As String) As String Dim kalimat As String kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;" kalimat &= "Data Source=" & strDatabase & "" Return kalimat End Function Private Sub frUser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DbLuondryUASDataSet.tbUser' table. You can move, or remove it, as needed. Me.TbUserTableAdapter.Fill(Me.DbLuondryUASDataSet.tbUser) Dim dc(1) As DataColumn Try daUser = New OleDb.OleDbDataAdapter("select * from tbUser", con) daUser = New OleDb.OleDbDataAdapter("select * from tbUser", con) daUser.Fill(dtUser) dc(0) = dtUser.Columns("Kode_User") dtUser.PrimaryKey = dc dgUser.DataSource = dtUser Catch errConn As OleDb.OleDbException MsgBox(errConn.Message) End Try End Sub Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click Try Dim cbUser As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daUser) drUser = dtUser.NewRow drUser("Kode_User") = txtKodeUser.Text drUser("Nama_User") = txtNamaUser.Text drUser("Password_User") = txtPasswordUser.Text drUser("Status_User") = txtStatusUser.Text dtUser.Rows.Add(drUser) con.Open() daUser.Update(dtUser) dtUser.AcceptChanges() con.Close() Catch errTambah As Exception

26

MsgBox(errTambah.Message) End Try kosong() End Sub Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBatal.Click kosong() End Sub Private Sub kosong() txtKodeUser.Text = "" txtNamaUser.Text = "" txtPasswordUser.Text = "" txtStatusUser.Text = "" txtKodeUser.Focus() End Sub Private Sub txtCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCari.Click Try drUser = dtUser.Rows.Find(txtKodeUser.Text) txtKodeUser.Text = drUser("Kode_User").ToString txtNamaUser.Text = drUser("Nama_User").ToString txtPasswordUser.Text = drUser("Password_User").ToString txtStatusUser.Text = drUser("Status_User").ToString Catch errCari As Exception MsgBox(errCari.Message) End Try End Sub Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click Try Dim cbUser As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daUser) drUser.Delete() daUser.DeleteCommand = cbUser.GetDeleteCommand daUser.Update(dtUser) dtUser.AcceptChanges() daUser.DeleteCommand.Connection.Close() Catch errHapus As Exception MsgBox(errHapus.Message) End Try End Sub Private Sub btnTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

27

btnTutup.Click MsgBox("Anda Yakin Keluar! ") Close() End Sub Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click Try drUser = dtUser.Rows.Find(txtKodeUser.Text) If (txtKodeUser.Text = drUser("Kode_User")) Then MsgBox("Kode_User Sudah terdaftar", MsgBoxStyle.Information) txtKodeUser.Text = "" txtKodeUser.Focus() Else txtKodeUser.Focus() End If Catch errCari As Exception txtNamaUser.Focus() End Try End Sub End Class

4.5 Coding Form Barang
public Class Barang Dim daBrg As OleDb.OleDbDataAdapter Dim con As New OleDb.OleDbConnection(Koneksi("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb")) Dim dtBrg As New DataTable() Dim drBrg As DataRow Function Koneksi(ByVal strDatabase As String) As String Dim kalimat As String kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;" kalimat &= "Data Source=" & strDatabase & "" Return kalimat End Function Private Sub Barang_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DbLuondryUASDataSet.tbBarang' table. You can move, or remove it, as needed. Me.TbBarangTableAdapter.Fill(Me.DbLuondryUASDataSet.tbBarang) Dim dc(1) As DataColumn Try daBrg = New OleDb.OleDbDataAdapter("select * from tbBarang", con) daBrg = New OleDb.OleDbDataAdapter("select * from tbBarang", con) daBrg.Fill(dtBrg) dc(0) = dtBrg.Columns("Kode_brg")

28

dtBrg.PrimaryKey = dc dgBarang.DataSource = dtBrg Catch errConn As OleDb.OleDbException MsgBox(errConn.Message) End Try End Sub Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click Try Dim cbbrg As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daBrg) drBrg = dtBrg.NewRow drBrg("Kode_Brg") = txtKodeBarang.Text drBrg("Nama_Brg") = txtNamaBarang.Text drBrg("Harga_Brg") = txtHargaBarang.Text dtBrg.Rows.Add(drBrg) con.Open() daBrg.Update(dtBrg) dtBrg.AcceptChanges() con.Close() Catch errTambah As Exception MsgBox(errTambah.Message) End Try kosong() End Sub Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBatal.Click kosong() End Sub Private Sub kosong() txtKodeBarang.Text = "" txtNamaBarang.Text = "" txtHargaBarang.Text = "" txtKodeBarang.Focus() End Sub Private Sub txtCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCari.Click Try drBrg = dtBrg.Rows.Find(txtKodeBarang.Text) txtKodeBarang.Text = drBrg("Kode_Brg").ToString txtNamaBarang.Text = drBrg("Nama_Brg").ToString txtHargaBarang.Text = drBrg("Harga_Brg").ToString Catch errCari As Exception MsgBox(errCari.Message)

29

End Try End Sub Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click Try Dim cbBrg As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daBrg) drBrg.Delete() daBrg.DeleteCommand = cbBrg.GetDeleteCommand daBrg.Update(dtBrg) dtBrg.AcceptChanges() daBrg.DeleteCommand.Connection.Close() Catch errHapus As Exception MsgBox(errHapus.Message) End Try End Sub Private Sub btnTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTutup.Click MsgBox("Anda Yakin Keluar! ") Close() End Sub Private Sub txtKodeBarang_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtKodeBarang.LostFocus Try drBrg = dtBrg.Rows.Find(txtKodeBarang.Text) If (txtKodeBarang.Text = drBrg("Kode_Brg")) Then MsgBox("Kode_Brg Sudah terdaftar", MsgBoxStyle.Information) txtKodeBarang.Text = "" txtKodeBarang.Focus() Else txtKodeBarang.Focus() End If Catch errCari As Exception txtNamaBarang.Focus() End Try End Sub End Class

4.6 Coding Form Kurir
Public Class Kurir Dim daKurir As OleDb.OleDbDataAdapter

30

Dim con As New OleDb.OleDbConnection(Koneksi("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb")) Dim dtKurir As New DataTable() Dim drKurir As DataRow Function Koneksi(ByVal strDatabase As String) As String Dim kalimat As String kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;" kalimat &= "Data Source=" & strDatabase & "" Return kalimat End Function Private Sub Kurir_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DbLuondryUASDataSet.tbKurir' table. You can move, or remove it, as needed. Me.TbKurirTableAdapter.Fill(Me.DbLuondryUASDataSet.tbKurir) Dim dc(1) As DataColumn Try daKurir = New OleDb.OleDbDataAdapter("select * from tbKurir", con) daKurir = New OleDb.OleDbDataAdapter("select * from tbKurir", con) daKurir.Fill(dtKurir) dc(0) = dtKurir.Columns("Kode_Kurir") dtKurir.PrimaryKey = dc dgKurir.DataSource = dtKurir Catch errConn As OleDb.OleDbException MsgBox(errConn.Message) End Try End Sub Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click Try Dim cbbrg As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daKurir) drKurir = dtKurir.NewRow drKurir("Kode_Kurir") = txtKodeKurir.Text drKurir("Nama_Kurir") = txtNamaKurir.Text dtKurir.Rows.Add(drKurir) con.Open() daKurir.Update(dtKurir) dtKurir.AcceptChanges() con.Close() Catch errTambah As Exception MsgBox(errTambah.Message) End Try kosong() End Sub Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

31

btnBatal.Click kosong() End Sub Private Sub kosong() txtKodeKurir.Text = "" txtNamaKurir.Text = "" txtKodeKurir.Focus() End Sub Private Sub txtCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCari.Click Try drKurir = dtKurir.Rows.Find(txtKodeKurir.Text) txtKodeKurir.Text = drKurir("Kode_Kurir").ToString txtNamaKurir.Text = drKurir("Nama_Kurir").ToString Catch errCari As Exception MsgBox(errCari.Message) End Try End Sub Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click Try Dim cbKurir As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daKurir) drKurir.Delete() daKurir.DeleteCommand = cbKurir.GetDeleteCommand daKurir.Update(dtKurir) dtKurir.AcceptChanges() daKurir.DeleteCommand.Connection.Close() Catch errHapus As Exception MsgBox(errHapus.Message) End Try End Sub Private Sub btnTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTutup.Click MsgBox("Anda Yakin Keluar! ") Close() End Sub Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click Try drKurir = dtKurir.Rows.Find(txtKodeKurir.Text)

32

If (txtKodeKurir.Text = drKurir("Kode_Kurir")) Then MsgBox("Kode_Kurir Sudah terdaftar", MsgBoxStyle.Information) txtKodeKurir.Text = "" txtKodeKurir.Focus() Else txtKodeKurir.Focus() End If Catch errCari As Exception txtNamaKurir.Focus() End Try End Sub End Class

4.7 Coding Form Konsumen
Public Class Konsumen Dim daKon As OleDb.OleDbDataAdapter Dim con As New OleDb.OleDbConnection(Koneksi("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb")) Dim dtKon As New DataTable() Dim drKon As DataRow Function Koneksi(ByVal strDatabase As String) As String Dim kalimat As String kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;" kalimat &= "Data Source=" & strDatabase & "" Return kalimat End Function Private Sub Konsumen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DbLuondryUASDataSet.tbKonsumen' table. You can move, or remove it, as needed. Me.TbKonsumenTableAdapter.Fill(Me.DbLuondryUASDataSet.tbKonsumen) Dim dc(1) As DataColumn Try 'daKon = New OleDb.OleDbDataAdapter("select * from tbKonsumen", con) daKon = New OleDb.OleDbDataAdapter("select * from tbKonsumen", con) daKon.Fill(dtKon) dc(0) = dtKon.Columns("Kode_Kon") dtKon.PrimaryKey = dc dgKonsumen.DataSource = dtKon Catch errConn As OleDb.OleDbException MsgBox(errConn.Message) End Try End Sub Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click Try

33

Dim cbKon As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daKon) drKon = dtKon.NewRow drKon("Kode_Kon") = txtKodeKonsumen.Text drKon("Nama_Kon") = txtNamaKonsumen.Text drKon("Alamat_Kon") = txtAlamatKonsumen.Text drKon("Telp_Kon") = txtTelpKonsumen.Text dtKon.Rows.Add(drKon) con.Open() daKon.Update(dtKon) dtKon.AcceptChanges() con.Close() Catch errTambah As Exception MsgBox(errTambah.Message) End Try kosong() End Sub Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBatal.Click kosong() End Sub Private Sub kosong() txtKodeKonsumen.Text = "" txtNamaKonsumen.Text = "" txtAlamatKonsumen.Text = "" txtTelpKonsumen.Text = "" txtKodeKonsumen.Focus() End Sub Private Sub txtCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCari.Click Try drKon = dtKon.Rows.Find(txtKodeKonsumen.Text) txtKodeKonsumen.Text = drKon("Kode_Kon").ToString txtNamaKonsumen.Text = drKon("Nama_Kon").ToString txtAlamatKonsumen.Text = drKon("Alamat_Kon").ToString txtTelpKonsumen.Text = drKon("Telp_Kon").ToString Catch errCari As Exception MsgBox(errCari.Message) End Try End Sub Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click Try Dim cbKon As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daKon)

34

drKon.Delete() daKon.DeleteCommand = cbKon.GetDeleteCommand daKon.Update(dtKon) dtKon.AcceptChanges() daKon.DeleteCommand.Connection.Close() Catch errHapus As Exception MsgBox(errHapus.Message) End Try End Sub Private Sub btnTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTutup.Click MsgBox("Anda Yakin Keluar! ") Close() End Sub Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click Try drKon = dtKon.Rows.Find(txtKodeKonsumen.Text) If (txtKodeKonsumen.Text = drKon("Kode_Kon")) Then MsgBox("Kode_Kon Sudah terdaftar", MsgBoxStyle.Information) txtKodeKonsumen.Text = "" txtKodeKonsumen.Focus() Else txtKodeKonsumen.Focus() End If Catch errCari As Exception txtNamaKonsumen.Focus() End Try End Sub End Class

4.8 Coding Form Transaksi Setoran Cucian
Public Class frSetoranCucian Dim daKon As OleDb.OleDbDataAdapter Dim datran As OleDb.OleDbDataAdapter Dim daBrg As OleDb.OleDbDataAdapter Dim con As New OleDb.OleDbConnection(Koneksi("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb")) Dim dtKon As New DataTable() Dim dtBrg As New DataTable() Dim dttran As New DataTable() Dim drKon As DataRow

35

Dim drtran As DataRow Dim drBrg As DataRow Function Koneksi(ByVal strDatabase As String) As String Dim kalimat As String kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;" kalimat &= "Data Source=" & strDatabase & "" Return kalimat End Function Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTutup.Click MsgBox("Anda Yakin Keluar! ") Close() End Sub Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBatal.Click kosong() End Sub Private Sub kosong() txtNomorLoundry.Text = "" dtSetoranCucian.Text = "" cbKodeKon.Text = "" txtNamaKon.Text = "" txtAlamatKon.Text = "" txtTelpKon.Text = "" cbKode.Text = "" Txtnmbrg.Text = "" txtharga.Text = "" txtJumlah.Text = "" txtSubTotal.Text = "" txtTotal.Text = "" txtUangMuka.Text = "" txtTotal.Text = "" txtSisa.Text = "" txtNoPesanan.Text = "" txtNomorLoundry.Focus() End Sub Private Sub frSetoranCucian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DbLuondryUASDataSet1.tbTransaksi' table. You can move, or remove it, as needed. Me.TbTransaksiTableAdapter.Fill(Me.DbLuondryUASDataSet1.tbTransaksi) Dim dc(1) As DataColumn Try daKon = New OleDb.OleDbDataAdapter("select * from tbKonsumen", con) daKon.Fill(dtKon) dc(0) = dtKon.Columns("Kode_Kon") dtKon.PrimaryKey = dc With cbKodeKon .DataSource = dtKon .DisplayMember = ("Kode_Kon") .ValueMember = ("Kode_Kon")

36

End With daBrg = New OleDb.OleDbDataAdapter("select * from tbBarang", con) daBrg.Fill(dtBrg) dc(0) = dtBrg.Columns("Kode_Brg") dtBrg.PrimaryKey = dc With cbKode .DataSource = dtBrg .DisplayMember = ("Kode_Brg") .ValueMember = ("Kode_Brg") End With datran = New OleDb.OleDbDataAdapter("select * from tbTransaksi", con) datran.Fill(dttran) dc(0) = dttran.Columns("No_Loundry") dttran.PrimaryKey = dc DataGridView1.DataSource = dttran Catch errConn As OleDb.OleDbException MsgBox(errConn.Message) End Try End Sub Private Sub btnLihatKdPakaian_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLihatKdPakaian.Click Dim form As New Barang() form.Show() End Sub Private Sub btnLihatKdKonsumen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLihatKdKonsumen.Click Dim form As New Konsumen() form.Show() End Sub Private Sub cbKode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbKode.SelectedIndexChanged Try Dim drBrg As DataRow drBrg = dtBrg.Rows.Find(cbKode.Text) Txtnmbrg.Text = drBrg("Nama_Brg").ToString txtharga.Text = drBrg("Harga_Brg").ToString Catch errTampil As Exception End Try End Sub Private Sub cbKodeKon_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As

37

System.EventArgs) Handles cbKodeKon.SelectedIndexChanged Try Dim drKon As DataRow drKon = dtKon.Rows.Find(cbKodeKon.Text) txtNamaKon.Text = drKon("Nama_Kon").ToString txtAlamatKon.Text = drKon("Alamat_Kon").ToString txtTelpKon.Text = drKon("Telp_Kon").ToString Catch errTampil As Exception End Try End Sub Private Sub btnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProses.Click Dim harga, banyak, total, biaya, muka As Decimal harga = Val(txtharga.Text) banyak = Val(txtJumlah.Text) muka = Val(txtUangMuka.Text) biaya = harga * banyak total = muka - biaya If total < 0 Then Label8.Text = "Kekurangan" total = total * -1 Else Label8.Text = "Kembali" End If txtSisa.Text = total End Sub Private Sub txtJumlah_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtJumlah.TextChanged Dim harga, jumlah, total As Decimal harga = Val(txtharga.Text) jumlah = Val(txtJumlah.Text) total = harga * jumlah txtSubTotal.Text = total txtTotal.Text = total End Sub Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click Try Dim cbtran As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(datran) drtran = dttran.NewRow

38

drtran("No_Loundry") = txtNomorLoundry.Text drtran("No_Pesanan") = txtNoPesanan.Text drtran("Tanggal_Pesan") = dtSetoranCucian.Text drtran("Kode_Kon") = cbKodeKon.Text drtran("Kode_Brg") = cbKode.Text drtran("Jumlah") = txtJumlah.Text drtran("Sub_Total") = txtSubTotal.Text drtran("Total") = txtTotal.Text drtran("Uang_Muka") = txtUangMuka.Text drtran("Sisa") = txtSisa.Text dttran.Rows.Add(drtran) con.Open() datran.Update(dttran) dttran.AcceptChanges() con.Close() Catch errTambah As Exception MsgBox(errTambah.Message) End Try kosong() End Sub Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick End Sub Private Sub btnHapus_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click Try Dim cbtran As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(datran) drtran.Delete() datran.DeleteCommand = cbtran.GetDeleteCommand datran.Update(dtBrg) dttran.AcceptChanges() datran.DeleteCommand.Connection.Close() Catch errHapus As Exception MsgBox(errHapus.Message) End Try End Sub Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click Try drtran = dttran.Rows.Find(txtNomorLoundry.Text)

39

If (txtNomorLoundry.Text = drtran("No_Loundry")) Then MsgBox("No_Loundry Sudah terdaftar", MsgBoxStyle.Information) txtNomorLoundry.Text = "" txtNomorLoundry.Focus() Else txtNomorLoundry.Focus() End If Catch errCari As Exception txtNoPesanan.Focus() End Try End Sub End Class

4.9 Coding Form Transaksi Pengiriman Cucian
Public Class TPengirimanCucian Dim daKurir As OleDb.OleDbDataAdapter Dim daPengirim As OleDb.OleDbDataAdapter Dim daTran As OleDb.OleDbDataAdapter Dim con As New OleDb.OleDbConnection(Koneksi("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDoct\Visual Studio 2005\Projects\Loundry _ Sella Hendra _ UAS\Loundry _ Sella Hendra _ UAS\dbLuondryUAS.mdb")) Dim dtKurir As New DataTable() Dim dtPengirim As New DataTable() Dim dtTran As New DataTable() Dim drKurir As DataRow Dim drPengirim As DataRow Dim drTran As DataRow Function Koneksi(ByVal strDatabase As String) As String Dim kalimat As String kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;" kalimat &= "Data Source=" & strDatabase & "" Return kalimat End Function Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click MsgBox("Anda Yakin Keluar! ") Close() End Sub Private Sub TPengirimanCucian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'DbLuondryUASDataSet2.tbTPengiriman' table. You can move, or remove it, as needed. Me.TbTPengirimanTableAdapter.Fill(Me.DbLuondryUASDataSet2.tbTPengiriman) Dim dc(1) As DataColumn Try daTran = New OleDb.OleDbDataAdapter("select tr.* ,kon.nama_kon,kon.alamat_kon,kon.telp_kon from tbTransaksi tr inner join tbKonsumen kon on tr.kode_kon = kon.kode_kon", con) daTran.Fill(dtTran)

40

dc(0) = dtTran.Columns("No_Pesanan") dtTran.PrimaryKey = dc With cbNoPesanan .DataSource = dtTran .DisplayMember = ("No_Pesanan") .ValueMember = ("No_Pesanan") End With daKurir = New OleDb.OleDbDataAdapter("select * from tbKurir", con) daKurir.Fill(dtKurir) dc(0) = dtKurir.Columns("Kode_Kurir") dtKurir.PrimaryKey = dc With cbKurir .DataSource = dtKurir .DisplayMember = ("Kode_Kurir") .ValueMember = ("Kode_Kurir") End With daPengirim = New OleDb.OleDbDataAdapter("select * from tbTPengiriman", con) daPengirim.Fill(dtPengirim) dc(0) = dtPengirim.Columns("No_Kirim") dtPengirim.PrimaryKey = dc DataGridView1.DataSource = dtPengirim Catch errConn As OleDb.OleDbException MsgBox(errConn.Message) End Try End Sub Private Sub cbNoPesanan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbNoPesanan.SelectedIndexChanged Try Dim drTran As DataRow drTran = dtTran.Rows.Find(cbNoPesanan.Text) txtKodeKon.Text = drTran("Kode_Kon").ToString txtNamaKon.Text = drTran("Nama_Kon").ToString txtAlamat.Text = drTran("Alamat_Kon").ToString txtTelp.Text = drTran("Telp_Kon").ToString txtTglPesan.Text = drTran("Tanggal_Pesan").ToString txtJmlhBrg.Text = drTran("Jumlah").ToString txtTotal.Text = drTran("Total").ToString txtUangMuka.Text = drTran("Uang_Muka").ToString txtKurang.Text = drTran("Sisa").ToString Catch errTampil As Exception End Try End Sub

41

Private Sub cbKurir_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbKurir.SelectedIndexChanged Try Dim drKurir As DataRow drKurir = dtKurir.Rows.Find(cbKurir.Text) txtNamaKurir.Text = drKurir("Nama_Kurir").ToString Catch errTampil As Exception End Try End Sub Private Sub btnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProses.Click Dim Kurang, bayar, Kembali As Decimal Kurang = Val(txtKurang.Text) bayar = Val(txtDibayar.Text) Kembali = Val(txtKembali.Text) Kembali = bayar - Kurang If Kembali < 0 Then Label13.Text = "Kekurangan" Else Label13.Text = "Kembali" End If txtKembali.Text = Kembali End Sub Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBatal.Click kosong() End Sub Private Sub kosong() txtNoKirim.Text = "" DateTimePicker1.Text = "" cbNoPesanan.Text = "" txtKodeKon.Text = "" txtTglPesan.Text = "" txtNamaKon.Text = "" txtAlamat.Text = "" txtTelp.Text = "" cbKurir.Text = "" txtNamaKurir.Text = "" txtJmlhBrg.Text = "" txtTotal.Text = "" txtUangMuka.Text = "" txtKurang.Text = "" txtDibayar.Text = ""

42

txtKembali.Text = "" txtNoKirim.Focus() End Sub Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click Try Dim cbPengirim As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daPengirim) drPengirim = dtPengirim.NewRow drPengirim("No_Kirim") = txtNoKirim.Text drPengirim("Tanggal_Kirim") = DateTimePicker1.Text drPengirim("No_Pesanan") = cbNoPesanan.Text drPengirim("Kode_Kon") = txtKodeKon.Text drPengirim("Kode_Kurir") = cbKurir.Text drPengirim("Jumlah_Brg") = txtJmlhBrg.Text drPengirim("Total") = txtTotal.Text drPengirim("Uang_Muka") = txtUangMuka.Text drPengirim("Kurang") = txtKurang.Text drPengirim("Dibayar") = txtDibayar.Text drPengirim("Kembali") = txtKembali.Text() dtPengirim.Rows.Add(drPengirim) con.Open() daPengirim.Update(dtPengirim) dtPengirim.AcceptChanges() con.Close() Catch errTambah As Exception MsgBox(errTambah.Message) End Try kosong() End Sub Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click Try drPengirim = dtPengirim.Rows.Find(txtNoKirim.Text) If (txtNoKirim.Text = drPengirim("No_Kirim")) Then MsgBox("No_Kirim Sudah terdaftar", MsgBoxStyle.Information) txtNoKirim.Text = "" txtNoKirim.Focus() Else txtNoKirim.Focus() End If Catch errCari As Exception txtKodeKon.Focus() End Try End Sub End Class

43

Laporan
Berikut ini adalah Laporan dari “Program Aplikasi Loundry“: 5.1 Laporan Form User

P 5.2 Laporan Form Barang

44

5.3 Laporan Form Kurir

5.4 Laporan Form Konsumen

45

5.5Laporan Form Transaksi Setoran Cucian

5.6 Laporan Form Transaksi Pengiriman Cucian

46

BAB III Implementasi

Spesifikasi Hardware Dan Software
Hardware Yang Digunakan : 1. Sistem Operasi MS Windows XP Professional 32-Bit SP3 2. Proccesor Intel Atom 330 @ 1.60ghz 3. RAM 1.0GB Single-Channel DDR2 4. Motherboard BYON Queva W9121 (CPU 1) 5. VGA HSD121PHW1 Sis Mirage 3 Graphics, 256 Mb 6. Hard Drives 313GB Seagate ST9320325AS (SATA)

Software Yang Digunakan :

1. MS Office 2007 2. Vb.net 2005

Cara Pengoperasian Program
Cara pengoperasian program dengan cara mengoneksikann terlebih dahulu database ke program aplikasi service kendaraan dengan cara :

Tools – Connect to database

47

48

BAB IV PENUTUP
Kesimpulan
Secara umum makalah pemograman berorientasi objek dengan Visual Studio 2005 dengan judul “Program Aplikasi Loundry” ini dibuat untuk mengetahui bagaimana mengelola system informasi akademik dengan baik agar mudah di mengerti dan di pahami oleh pihak yang memerlukan informasi tersebut.

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 dari sumber-sumber lain yang membantu dalam mempelajari database dan aplikasi visual studio.  Aplikasi visual studio 2005 dirancang agar lebih mudah di pelajari dan dipakai dalam aplikasi-aplikasi yang akan dibuat sesuai dengan kebutuhan tidak hanya database saja, tapi pembuatan aplikasi lainnya.

49

Daftar Pustaka

http://www.konsultasivb.com |2012 http://www.google.co.id

50

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)//-->