LAMPIRAN
LISTING PROGRAM :
Public Class awal
Private Sub awal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
LoginForm1.Show() End Sub
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
End Sub End Class
Public Class LoginForm1
Dim sql As String
Dim Login As DataTable
Dim tulisan(2) As String Dim i, j As Integer
Private Sub bersih() txtuser.Text = "" txtpass.Text = "" txtuser.Focus() End Sub
Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnlogin.Click
Login = proses.executequery("select * from tabel_petugas where nama_petugas ='" & txtuser.Text & "' AND password ='" & txtpass.Text & "'")
If Login.Rows.Count = 0 Then
MessageBox.Show(" Login tidak berhasil...!!", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtuser.Focus() Call bersih() Else
MessageBox.Show(" Data ada... Anda Dapat Memasukkan Sistem aplikasi !!", " informasi", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
formutama.Show() Me.Close()
End Sub
Me.Close() End Sub
Private Sub txtuser_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtuser.KeyPress
If e.KeyChar = Chr(13) Then txtpass.Focus()
End If
If e.KeyChar = Chr(13) Then
Login = proses.executequery(" select * from tabel_petugas where nama_petugas=' " & txtuser.Text & "'")
If Login.Rows.Count = 0 Then
MessageBox.Show("kode tidak di temukan...!!!", "Information ", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtuser.Focus() End If
End If
End Sub
Private Sub txtpass_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtpass.KeyPress
If e.KeyChar = Chr(13) Then btnlogin.Focus()
End If End Sub
Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Class
Public Class formutama
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Application.Exit()
End Sub
Private Sub DataBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataBarangToolStripMenuItem.Click
Barang.Show() End Sub
Private Sub dtpetugas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtpetugas.Click
FormPetugas.Show() End Sub
Private Sub LaporanBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanBarangToolStripMenuItem.Click
Form1.Show() End Sub
End Class
Dim proses As New Clskoneksi Dim petugas As DataTable Sub Data_record()
petugas = proses.executequery("select * from tabel_petugas order by kd_petugas") End Sub
Private Sub bersih() txtid.Text = "" txtnama.Text = "" txtpassword.Text = "" txtid.Focus()
Call Data_record() End Sub
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
petugas = proses.executequery("select * from tabel_petugas where kd_petugas='" & txtid.Text & "'")
If petugas.Rows.Count = 0 Then
MsgBox("apakah anda yakin mau MENYIMPAN data PETUGAS")
sql = "insert into tabel_petugas values('" & txtid.Text & "','" & txtnama.Text & "','" & txtpassword.Text & "')"
proses.executenonquery(sql)
MessageBox.Show(" data telah disimpan...!!", "Penyimpanan Sukses", MessageBoxButtons.OK, MessageBoxIcon.Information)
Call Data_record() Call bersih() Else
MessageBox.Show("Data sudah ada ..silahkan entry data yang lain..!!") Call bersih()
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
If MsgBox("apakah anda yakin mau menghapus data petugas?", MsgBoxStyle.YesNo, "konfirmasi") = MsgBoxResult.Yes Then
sql = "delete from tabel_petugas where kd_petugas= '" & txtid.Text & "'" proses.executenonquery(sql)
MessageBox.Show("Data telah dihapus..!!", "Pengapusan sukses", MessageBoxButtons.OK, MessageBoxIcon.Information)
Call Data_record() Call bersih() Else
MessageBox.Show("silahkan DELETE data yang lain..!!", "pesan", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If Call bersih()
End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close() End Sub
Private Sub txtid_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtid.KeyPress
If e.KeyChar = Chr(13) Then
If petugas.Rows.Count = 0 Then txtnama.Focus()
Else
MessageBox.Show("data sudah ada") With petugas.Rows(0)
txtnama.Text = .Item("nama_petugas") txtpassword.Text = .Item("password") End With
End If End If
End Sub
Sub kode_otomatis()
petugas = proses.executequery("select * from tabel_petugas order by kd_petugas desc") If petugas.Rows.Count = 0 Then
txtid.Text = "001" Else
With petugas.Rows(0)
txtid.Text = .Item("kd_petugas") End With
txtid.Text = Val(Microsoft.VisualBasic.Right(txtid.Text, 2)) + 1 If Len(txtid.Text) = 1 Then
txtid.Text = "00" & txtid.Text & ""
ElseIf Len(txtid.Text) = 2 Then txtid.Text = "0" & txtid.Text & "" End If
Private Sub FormPetugas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call Data_record() Call kode_otomatis() End Sub
End Class
Public Class Barang Dim sql As String
Dim proses As New Clskoneksi Dim barang As DataTable Sub Data_record()
barang = proses.executequery("select * from tabel_barang order by kode_barang") dgvbarang.DataSource = barang
End Sub
Private Sub bersih() txtkd_barang.Text = "" txtnama_barang.Text = "" cmbjenis.Text = ""
txtharga.Text = "" txtkd_barang.Focus() Call Data_record() Call kode_otomatis() End Sub
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
barang = proses.executequery("select* from tabel_barang where kode_barang='" & txtkd_barang.Text & "'")
MsgBox("apakah anda yakin mau menyimpan pembuatan data barang?")
sql = "insert into tabel_barang values('" & txtkd_barang.Text & "','" & txtnama_barang.Text & "','" & cmbjenis.Text & "','" & txtharga.Text & "')"
proses.executenonquery(sql)
MessageBox.Show("data telah disimpan..!!", "penyimpanan sukses", MessageBoxButtons.OK, MessageBoxIcon.Information)
dgvbarang.Refresh() Call Data_record() Else
MessageBox.Show("data sudah ada...silahkan entry data yang lain!!!") Call bersih()
End If Call bersih() End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
If MsgBox("apakah anda yakin mau menghapus pembuatan data barang?", MsgBoxStyle.YesNo, "konfirmasi") = MsgBoxResult.Yes Then
sql = "delete from tabel_barang where kode_barang= '" & txtkd_barang.Text & "'" proses.executenonquery(sql)
MessageBox.Show("data telah dihapus..!!", "penghapusan sukses", MessageBoxButtons.OK, MessageBoxIcon.Information)
dgvbarang.Refresh() End If
Call bersih() End Sub
If MsgBox("apakah anda yakin mau mengupdate data barang?", MsgBoxStyle.YesNo, "konfirmasi") = MsgBoxResult.Yes Then
sql = "update tabel_barang set kode_barang= '" & txtkd_barang.Text & "', nama_barang='" & txtnama_barang.Text & "',jenis= '" & cmbjenis.Text & "', harga='" & txtharga.Text & "' where kode_barang='" & txtkd_barang.Text & "'"
proses.executenonquery(sql)
MessageBox.Show("data telah diedit..!!", "pengeditan sukses", MessageBoxButtons.OK, MessageBoxIcon.Information)
dgvbarang.Refresh() Else
MessageBox.Show("Silahkan UPDATE data yang lain..!!", "pesan", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If Call bersih() End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub
Sub kode_otomatis()
barang = proses.executequery("select * from tabel_barang order by kode_barang desc") If barang.Rows.Count = 0 Then
txtkd_barang.Text = "001" Else
With barang.Rows(0)
txtkd_barang.Text = .Item("kode_barang") End With
If Len(txtkd_barang.Text) = 1 Then
txtkd_barang.Text = "00" & txtkd_barang.Text & ""
ElseIf Len(txtkd_barang.Text) = 2 Then
txtkd_barang.Text = "0" & txtkd_barang.Text & "" End If
End If End Sub
Private Sub Barang_Load(ByVal sender As System.Object, ByVal e As System.EventA rgs) Handles MyBase.Load
Call kode_otomatis() Call Data_record() End Sub
Private Sub dgvbarang_DoubleClick1(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvbarang.DoubleClick
Try
txtkd_barang.Text = dgvbarang.SelectedCells(0).Value txtnama_barang.Text = dgvbarang.SelectedCells(1).Value cmbjenis.Text = dgvbarang.SelectedCells(2).Value
txtharga.Text = dgvbarang.SelectedCells(3).Value Catch ex As Exception
End Try End Sub End Class
Imports System.Data.SqlClient Imports System.Data
Imports System.Data.Sql Public Class Clskoneksi Public Shared sql As String
Dim koneksi As SqlClient.SqlConnection Dim command As SqlClient.SqlCommand Dim dataadapter As SqlClient.SqlDataAdapter Dim ds As DataSet
Dim dt As DataTable
Public Function openconn() As Boolean
koneksi = New SqlClient.SqlConnection("data source=SQLOLEDB.1;integrated security=SSPI;persist security info = false;user id=;password=;initial catalog=penjualan;data source = menda-pc\sqlexpress")
koneksi.Open()
If koneksi.State <> ConnectionState.Open Then Else
Return True End If
End Function
Public Sub closecoon()
If Not IsNothing(koneksi) Then koneksi.Close()
koneksi = Nothing
End If End Sub
Public Class Formkasir Dim sql As String
Dim kasir As DataTable Sub data_record()
kasir = proses.executequery("select * from tabel_detaijual order by No_faktur") End Sub
Private Sub bersih() TxtFakt.Text = "" Txttot.Text = "" Txtbayar.Text = "" Txtkembali.Text = "" TxtFakt.Focus() Call data_record()
End Sub
Private Sub Formkasir_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call data_record() Call Gridbarang()
End Sub
Private Sub BtnBeli_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBeli.Click
kasir = proses.executequery("select * from tabel_detaijual where No_faktur='" & TxtFakt.Text & "'")
If kasir.Rows.Count = 0 Then
sql = "Insert into tabel_detaijual values ('" & TxtFakt.Text & "')"
MessageBox.Show("data sukses..!!", "pembelian sukses", MessageBoxButtons.OK, MessageBoxIcon.Information)
For baris As Integer = 0 To Dgvjual.Rows.Count - 2 'simpan ke tabel penjualan
sql = "Insert into tabel_penjualan values ('" & TxtFakt.Text & "','" &
Dgvjual.Rows(baris).Cells(0).Value & "','" & Dgvjual.Rows(baris).Cells(1).Value & "','" & Dgvjual.Rows(baris).Cells(2).Value & "','" & Dgvjual.Rows(baris).Cells(3).Value & "','" & Dgvjual.Rows(baris).Cells(4).Value & "')"
proses.executenonquery(sql)
Next baris
Dgvjual.Columns.Clear() Dgvjual.Columns.Clear() Call Gridbarang()
Txttot.Text = 0 Call data_record() Call bersih() End Sub
Sub TotalHarga()
Dim HitungHarga As Integer = 0
For I As Integer = 0 To Dgvjual.Rows.Count - 1
HitungHarga = HitungHarga + Val(Dgvjual.Rows(I).Cells(4).Value) Txttot.Text = HitungHarga
Next End Sub
Sub Gridbarang()
Dgvjual.Columns.Add("Kode_barang", "Kode Barang") Dgvjual.Columns.Add("Nama_barang", "Nama Barang") Dgvjual.Columns.Add("Harga", "Harga Barang")
End Sub
Sub AturKolombarang()
Dgvjual.Columns(0).Width = 75 Dgvjual.Columns(1).Width = 100 Dgvjual.Columns(2).Width = 75 Dgvjual.Columns(3).Width = 75 Dgvjual.Columns(4).Width = 75 Dgvjual.Columns(1).ReadOnly = True Dgvjual.Columns(2).ReadOnly = True End Sub
Private Sub Dgvjual_CellEndEdit(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles Dgvjual.CellEndEdit kasir = proses.executequery("select * from tabel_barang where kode_barang ='" & Dgvjual.Rows(e.RowIndex).Cells(0).Value & "'")
If e.ColumnIndex = 1 Then With kasir.Rows(0)
Dgvjual.Rows(e.RowIndex).Cells(1).Value = .Item("Nama_barang") Dgvjual.Rows(e.RowIndex).Cells(2).Value = .Item("Harga")
End With End If
Dgvjual.Rows(e.RowIndex).Cells(4).Value = Dgvjual.Rows(e.RowIndex).Cells(2).Value * Dgvjual.Rows(e.RowIndex).Cells(3).Value
If e.ColumnIndex = 3 Then With kasir.Rows(0)
Dgvjual.Rows(e.RowIndex).Cells(4).Value =
End With End If
Dgvjual.CurrentCell = Dgvjual.Rows(1).Cells(0)
kasir = proses.executequery("select * from tabel_barang where kode_barang ='" & Dgvjual.Rows(e.RowIndex).Cells(0).Value & "'")
If kasir.Rows.Count = 0 Then
MessageBox.Show("Data Tidak Ada..!!", "informasi", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
With kasir.Rows(0)
Dgvjual.Rows(e.RowIndex).Cells(1).Value = .Item("Nama_barang") Dgvjual.Rows(e.RowIndex).Cells(2).Value = .Item("Harga")
End With End If
Dgvjual.Rows(e.RowIndex).Cells(4).Value = Dgvjual.Rows(e.RowIndex).Cells(2).Value * Dgvjual.Rows(e.RowIndex).Cells(3).Value
If e.ColumnIndex = 3 Then
Else
Dgvjual.Rows(e.RowIndex).Cells(4).Value = Dgvjual.Rows(e.RowIndex).Cells(2).Value * Dgvjual.Rows(e.RowIndex).Cells(3).Value
Call TotalHarga() End If
Dgvjual.CurrentCell = Dgvjual.Rows(1).Cells(0)
Private Sub Txtkembali_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtkembali.TextChanged
Txtkembali.Text = (Val(Txttot.Text) - Val(Txtbayar.Text)) End Sub
End Class
Public Function executequery(ByVal query As String) As DataTable If Not openconn() Then
MsgBox("koneksi gagal...!!", MsgBoxStyle.Critical, "access failed") Return Nothing
Exit Function End If
command = New SqlClient.SqlCommand(query, koneksi) dataadapter = New SqlClient.SqlDataAdapter
dataadapter.selectcommand = command ds = New Data.DataSet()
dataadapter.Fill(ds) dt = ds.Tables(0) Return dt
dt = Nothing ds = Nothing
dataadapter = Nothing command = Nothing closecoon()
End Function
Public Sub executenonquery(ByVal query As String) If Not openconn() Then
End If
command = New SqlClient.SqlCommand command.Connection = koneksi
command.CommandType = CommandType.Text command.CommandText = query
command.ExecuteNonQuery() command = Nothing
closecoon() End Sub End Class
<?xml version="1.0" encoding="utf-8" ?> <configuration>
<configSections> </configSections> <connectionStrings>
<add name="WindowsControlLibrary1.My.MySettings.penjualanConnectionString"
connectionString="Data Source=.\sqlexpress;Initial Catalog=penjualan;Integrated Security=True;Pooling=False"
providerName="System.Data.SqlClient" />
<add name="WindowsControlLibrary1.My.MySettings.datajualConnectionString" connectionString="Data Source=|DataDirectory|\datajual.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" /> </connectionStrings>
<system.diagnostics> <sources>
<!-- This section defines the logging configuration for My.Application.Log --> <source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!--<add name="EventLog"/>--> </listeners>
</source> </sources> <switches>
<add name="DefaultSwitch" value="Information" /> </switches>
<sharedListeners> <add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
SURAT KETERANGAN
Hasil Uji Program Tugas Akhir
Yang bertanda tangan di bawah ini, menerangkan bahwa Tugas Akhir Mahasiswa Diploma III Teknik Informatika :
Nama : Menda Gustika Kembaren NIM : 102406104
Prog. Studi : D-III Teknik Informatika
Judul TA : Perancangan Sistem Informasi Penjualan Pakaian di Duono Distro
Telah melaksanakan test program Tugas Akhir Mahasiswa tersebut di atas pada tanggal 20
Oktober 2013
Dengan hasil : Sukses / Gagal
Demikian diterangkan untuk digunakan melengkapi Syarat Pendaftaran Ujian Meja Hijau Tugas
Akhir Mahasiswa yang bersangkutan di Departemen Matematika FMIPA USU Medan.
Medan, Oktober 2013
Dosen Pembimbing Program Studi D-III Teknik Informatika
KARTU BIMBINGAN TUGAS AKHIR MAHASISWA
Nama : Menda Gustika Kembaren
Nomor Induk Mahasiswa : 102406104
Judul Tugas Akhir : Perancangan Sistem Informasi Penjualan Pakaian di Duono Distro
Dosen Pembimbing : Drs.Rosman Siregar,M.Si Tanggal Mulai Bimbingan : 3 April 2013
Tanggal Selesai Bimbingan : 20 Oktober 2013
No Tanggal Bimbingan
Pembahasan Asistensi Mengenai BAB
Paraf Dosen
Pembimbing Keterangan
1 3 April 2013 Proposal
2 Bab 1,2
3 Bab 3,4
4 Bab 5,6
5 Uji Program
6 Penyempurnaan
TA
* Kartu ini harap dikembalikan ke Departemen Matematika bila bimbingan mahasiswa telah selesai.
Diketahui, Disetujui,
Departemen Matematika FMIPA USU Pembimbing Utama/
Ketua, Penanggung Jawab