Lampiran A-1
Laporan Pembelian
Lampiran A-2
Surat Retur
LAMPIRAN B
MASUKAN SISTEM BERJALAN
Lampiran B-1
Data Barang
Lampiran B-2
Data Supplier
Lampiran B-3
Nota Pembelian
Lampiran B-4
Surat Jalan
LAMPIRAN C
RANCANGAN KELUARAN
TOKO RESTU FURNITURE
JLN AHMAD YANI NO.326 PANGKALPINANG
TANDA TERIMA BARAANG No TTB : X-5-X
Telah diterima barang-barang dari : Kode Supplier : X-5- X Nama Supplier : X-25- X
Alamat : X-100- X
Telpon : X-12- X
Berdasarkan pesanan dari nomor: X-5- X,tanggal : dd-mm-yyyy dengan refrensi nota : X-5- X dan refrensi surat jalan: X-5- X berdasarkan rincian barang sebagai
berikut :
No KodeBarang NamaBarang Type HargaSatuan Stok
99 x-5-x x-20-x x-15-x 99999 9999
99 x-5-x x-20-x x-15-x 99999 9999
Pangkalpinang, dd-mm-yyyy
Supplier Hormat Kami
( ) ( ) Lampiran C-1
Tanda Terima Barang
TOKO RESTU FURNITURE
JLN AHMAD YANI NO.326 PANGKALPINANG
PESANAN Nomor : X-5-X
Perihal : Pesanan Barang Kepada Yth,
Kode Supplier : X-5-X Nama supplier : X-25-X Alamat : X-100-X
Telpon : X-12-X Dengan Hormat,
Melalui surat ini kami ingin memesan barang dengan rincian barang-barang seperti berikut :
No KodeBarang NamaBarang Type Jumlah
99 x-5-x x-20-x x-15-x 99999
99 x-5-x x-20-x x-15-x 99999
Demikian surat ini kami sampaikan,kami ucapkan terimakasih Pangkalpinang, dd-mm-yyyy
Bag.pembelian
( ) Lampiran C-2
Pesanan
TOKO RESTU FURNITURE
JLN AHMAD YANI NO.326 PANGKALPINANG
RETUR Nomor : X-5-X
Perihal : Retur Barang Kepada Yth,
Kode Supplier : X-5-X Nama supplier : X-25-X Alamat : X-100-X
Telpon : X-12-X Dengan Hormat,
Melalui surat ini kami menyampaikan bahwa ingin mengembalikan barang yang tidak sesuai denga pseanan kami dengan nomor pesana : X-5-X,tanggal: X-5-X
dan nomor TTB: X-5-X, dengan rincian barang sebagai berikut : No KodeBarang NamaBarang Type Jumlah
99 x-5-x x-20-x x-15-x 99999
99 x-5-x x-20-x x-15-x 99999
Demikian surat ini kami sampaikan,kami ucapkan terimakasih.
Supplier Pangkalpinang, dd-mm-yyyy
Bag.pembelian
( ) ( )
Laporan C-3
Retur
TOKO RESTU FURNITURE
JLN AHMAD YANI NO.326 PANGKALPINANG
LAPORAN PEMBELIAN Periode : dd/mm/yyyy sd dd/mm/yyyy
No NoPsn TglPsn NmSup NmBrg Jmlh Harga Total
99 x-5-x dd-mm- yyyy
x-5-x x-20-x x-5-x 99999 999999
99 x-5-x dd-mm- yyyy
x-5-x x-20-x x-15-x 99999 999999
Pangkalpinang : dd-mm-yyyy Pimpinan Bagian Pembelian,
( ) ( ) Lampiran C-4
Lampiran Pembelian
LAMPIRAN D
RANCANGAN MASUKAN
TOKO RESTU FURNITURE
JLN AHMAD YANI NO.326 PANGKALPINANG
DATA BARANG
No KodeBarang NamaBarang Type HargaSatuan Stok
99 x-5-x x-20-x x-15-x 99999 9999
99 x-5-x x-20-x x-15-x 99999 9999
Pangkalpinang, dd-mm-yyyy Bag.Pembelian
( )
Lampiran D-1
Data Pesanan
TOKO RESTU FURNITURE
JLN AHMAD YANI NO.326 PANGKALPINANG
DATA SUPPLIER
Kode Supplier : X-5- X Nama Supplier : X -30- X
Alamat : X -100- X
Telpon : X -12- X
Pangkalpinang, dd-mm-yyyy Supplier
( )
Lampiran D-2
Data Supplier
LAMPIRAN E
SURAT KETERANGAN RISET
Lampiran E-1
Surat Keterangan Riset
Lampiran E-2
Kartu Bimbingan
LISTING PROGRAM TUGAS AKHIR KONEKSI
Imports System.Data.OleDb Imports System.Data
Module KONEKSI
Public Con As String = "Provider=Microsoft.Ace.Oledb.12.0;" &
_
"Data Source=" & Application.StartupPath &
"\Pembelian.accdb;"
Public cn As OleDbConnection End Module
CLASS BARANG
Imports System.Data.OleDb Imports System.Data
Public Class CBARANG
Private XKdBrg As String Private XNmBrg As String Private XType As String Private XHarsat As Double Private xStok As Integer Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim Baris As Boolean
Dim x As Integer Public nil As Integer
Public Property KdBrg() As String Get
Return XKdBrg End Get
Set(ByVal value As String) XKdBrg = value
End Set End Property
Public Property NmBrg() As String Get
Return XNmBrg End Get
Set(ByVal value As String) XNmBrg = value
End Set End Property
Public Property Type() As String Get
Return XType End Get
Set(ByVal value As String) XType = value
End Set End Property
Public Property Harsat() As Double Get
Return XHarsat
End Get
Set(ByVal value As Double) XHarsat = value
End Set End Property
Public Property Stok() As Integer Get
Return xStok End Get
Set(ByVal value As Integer) xStok = value
End Set End Property
Public Function simpan(ByVal Kode As String) As Integer cmd = New OleDbCommand("Select * From BARANG where KdBrg
='" & Kode & "'", cn)
baca = cmd.ExecuteReader() Baris = False
If baca.HasRows = True Then
MsgBox("Kode Barang : " & Kode & " Sudah Pernah Disimpan !")
Else
cmd = New OleDbCommand("Insert into BARANG(KdBrg,NmBrg,Type,Harsat,Stok)" & _
"values('" & Kode & "','" & XNmBrg & "','" & XType &
"','" & XHarsat & "','" & xStok & "')", cn)
MessageBox.Show("Data Dengan Kode Barang : " & kode &
" Sudah Tersimpan ")
Return cmd.ExecuteNonQuery End If
End Function
Public Function Ubah(ByVal Kode As String) As Integer
cmd = New OleDbCommand("select * from Barang where KdBrg
='" & Kode & "'", cn)
baca = cmd.ExecuteReader() Baris = False
If baca.HasRows = True Then
cmd = New OleDbCommand("update Barang set NmBrg='" &
XNmBrg & "',Type='" & _
XType & "',Harsat='" & XHarsat & "',Stok='" & xStok &
"' where KdBrg='" & Kode & "'", cn)
MessageBox.Show(" Data Dengan Kode Barang : " & Kode &
" Sudah Diubah ")
Return cmd.ExecuteNonQuery End If
End Function
Public Function Hapus() As Integer
cmd = New OleDbCommand("select * from Barang where KdBrg
='" & XKdBrg & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = False Then
MsgBox("Kode Barang : [" & XKdBrg & "] Tidak Ada ", MsgBoxStyle.Information, "Pesan !")
Else
MsgBox("Kode Barang : [" & XKdBrg & "] Sudah Dihapus
", MsgBoxStyle.Information, "Pesan !")
cmd = New OleDbCommand("delete from Barang where KdBrg='" & XKdBrg & "'", cn)
Return cmd.ExecuteNonQuery End If
End Function
Public Function Batal() As Integer KdBrg = ""
NmBrg = ""
Type = ""
Harsat = 0 Stok = 0
End Function
Public Sub ShowData() '---Untuk Menampilkan isi data di Listview
x = 1
cmd = New OleDbCommand("SELECT * FROM BARANG order by KdBrg asc", cn)
baca = cmd.ExecuteReader
FBarang.ListView1.Items.Clear() While baca.Read
FBarang.ListView1.Items.Add((x).ToString) FBarang.ListView1.Items(x -
1).SubItems.Add(baca.Item("KdBrg").ToString) FBarang.ListView1.Items(x - 1).SubItems.Add(baca.Item("NmBrg").ToString) FBarang.ListView1.Items(x - 1).SubItems.Add(baca.Item("Type").ToString) FBarang.ListView1.Items(x -
1).SubItems.Add(baca.Item("Harsat").ToString) FBarang.ListView1.Items(x -
1).SubItems.Add(baca.Item("Stok").ToString)
x = x + 1 End While 'cmd.Dispose() 'baca.Close() End Sub
Public Sub tampil() '---Untuk Menampilkan data pada TextBox
nil = 0
cmd = New OleDbCommand("SELECT * FROM BARANG where KdBrg='" & XKdBrg & "'", cn)
baca = cmd.ExecuteReader Baris = False
If baca.HasRows = True Then nil = 0
Baris = True baca.Read()
XKdBrg = baca.Item(0) XNmBrg = baca.Item(1) XType = baca.Item(2) XHarsat = baca.Item(3)
xStok = baca.Item(4)
End If
If baca.IsClosed = False Then baca.Close() 'Return Baris
End Sub 'Tambahan
Public Sub TampilTranBrg()
cmd = New OleDbCommand("SELECT * FROM Barang where KdBrg='" & XKdBrg & "'", cn)
baca = cmd.ExecuteReader Baris = False
If baca.HasRows = True Then nil = 0
Baris = True baca.Read()
XKdBrg = baca.Item(0) XNmBrg = baca.Item(1) XType = baca.Item(2) XHarsat = baca.Item(3) xStok = baca.Item(4)
Else
MsgBox("Kode Barang : (" & XKdBrg & ") Tidak Ada Dalam DataBase ", MsgBoxStyle.Information, "Pesan!")
Batal() End If End Sub End Class
CLASS KIRIM
Imports System.Data.OleDb Imports System.Data
Public Class CKirim
Private xJmlhRetur As String Private xAlasanRetur As String
Dim cmd As OleDbCommand Dim baca As OleDbDataReader
Public Property JmlhRetur() As String Get
Return xJmlhRetur End Get
Set(ByVal value As String) xJmlhRetur = value End Set
End Property
Public Property AlasanRetur() As String Get
Return xAlasanRetur End Get
Set(ByVal value As String) xAlasanRetur = value End Set
End Property
Public Function simpan(ByVal i As Integer, ByVal xNoRetur As String, ByVal xKdBrg As String) As Integer
cmd = New OleDbCommand("insert into KIRIM(NoRetur,KdBrg,JmlhRetur,AlasanRetur)" & _
"values('" & xNoRetur & "','" &
xKdBrg & "','" & xJmlhRetur & "','" & xAlasanRetur & "')", cn) cmd.ExecuteNonQuery()
End Function End Class
CLASS TTB
Imports System.Data.OleDb Imports System.Data
Public Class CLTTB
Private xNoTTB As String Private xTglTTB As String Private xNoRefNota As String Private xNoRefSj As String Private xNoPsn As String Private xKdSup As String
Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim baris As Boolean
Dim x As Integer
Dim dila As String = ""
Public Property NoTTB() As String Get
Return xNoTTB End Get
Set(ByVal value As String) xNoTTB = value
End Set End Property
Public Property TglTTB() As String Get
Return xTglTTB End Get
Set(ByVal value As String) xTglTTB = value
End Set End Property
Public Property NoRefNota() As String Get
Return xNoRefNota End Get
Set(ByVal value As String) xNoRefNota = value End Set
End Property
Public Property NoRefSj() As String Get
Return xNoRefSj End Get
Set(ByVal value As String)
xNoRefSj = value End Set
End Property
Public Property NoPsn() As String Get
Return xNoPsn End Get
Set(ByVal value As String) xNoPsn = value
End Set End Property
Public Property KdSup() As String Get
Return xKdSup End Get
Set(ByVal value As String) xKdSup = value
End Set End Property
Public Function simpan(ByVal xNoTTB As String) As Integer cmd = New OleDbCommand("INSERT into
TTB(NoTTB,TglTTB,NoRefNota,NoRefSj,NoPsn,KdSup)" & _
"values('" & xNoTTB & "','" &
xTglTTB & "','" & xNoRefNota & "','" & xNoRefSj & "','" & xNoPsn &
"','" & xKdSup & "')", cn)
Return cmd.ExecuteNonQuery End Function
Public Function tampil(ByVal xNoTTB As String) As Integer x = 1
cmd = New OleDbCommand("select * from QTTB where NoTTB='"
& xNoTTB & "' order by KdBrg", cn) baca = cmd.ExecuteReader FTTB.ListView1.Items.Clear()
While baca.Read
xTglTTB = baca.Item(1) xNoPsn = baca.Item(2) xKdSup = baca.Item(3)
FTTB.ListView1.Items.Add((x).ToString) FTTB.ListView1.Items(x -
1).SubItems.Add(baca.Item("KdBrg").ToString) FTTB.ListView1.Items(x -
1).SubItems.Add(baca.Item("NmBrg").ToString) FTTB.ListView1.Items(x -
1).SubItems.Add(baca.Item("Harsat").ToString) FTTB.ListView1.Items(x -
1).SubItems.Add(baca.Item("Total").ToString) x = x + 1
FTTB.T14.Text = Val(FTTB.T14.Text) + baca.Item(8S) End While
cmd.Dispose() baca.Close() End Function
Public Sub TAMPILTTB()
cmd = New OleDbCommand("Select * from TTB where NoTTB = '"
& xNoTTB & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = True Then baca.Read()
xNoTTB = baca.Item(0) Else
MsgBox("No TTB Tidak Ada Dalam Database", MsgBoxStyle.Information, "Pesan")
End If End Sub End Class
CLASS PESAN
Imports System.Data.OleDb Imports System.Data
Public Class CPesan
Private xJmlhBrg As String Private xAls As String Dim cmd As OleDbCommand Dim baca As OleDbDataReader
Public Property JmlhBrg() As String Get
Return xJmlhBrg End Get
Set(ByVal value As String) xJmlhBrg = value
End Set End Property
Public Function simpan(ByVal i As Integer, ByVal xNoPsn As String, ByVal xKdBrg As String) As Integer
cmd = New OleDbCommand("insert into PESAN(NoPsn,KdBrg,JmlhBrg)" & _
"Values('" & xNoPsn & "','" &
xKdBrg & "','" & xJmlhBrg & "')", cn) cmd.ExecuteNonQuery()
End Function End Class
CLASS PESANAN
Imports System.Data.OleDb Imports System.Data
Public Class CPesanan
Private xNoPsn As String Private xTglPsn As String Private xKdSup As String
Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim baris As Boolean
Public nil As Integer Dim x As Integer
Dim dila As String = "'"
Public Property NoPsn() Get
Return xNoPsn End Get
Set(ByVal value) xNoPsn = value End Set
End Property
Public Property TglPsn() As String Get
Return xTglPsn End Get
Set(ByVal value As String) xTglPsn = value
End Set End Property
Public Property KdSup() As String Get
Return xKdSup End Get
Set(ByVal value As String) xKdSup = value
End Set End Property
Public Function simpan(ByVal NoPsn As String) As Integer cmd = New OleDbCommand("insert into PESANAN
(NoPsn,TglPsn,KdSup) " & _
"values('" & xNoPsn & "','" &
xTglPsn & "','" & xKdSup & "')", cn) Return cmd.ExecuteNonQuery
End Function
Public Function muncul(ByVal xNoPsn As String) As Integer x = 1
cmd = New OleDbCommand("select * from QPesanan where NoPsn
='" & xNoPsn & "' order by KdBrg", cn) baca = cmd.ExecuteReader
FPESANAN.ListView1.Items.Clear()
While baca.Read
xTglPsn = baca.Item(1) xKdSup = baca.Item(2)
FPESANAN.ListView1.Items.Add((x).ToString) FPESANAN.ListView1.Items(x -
1).SubItems.Add(baca.Item("KdBrg").ToString) FPESANAN.ListView1.Items(x - 1).SubItems.Add(baca.Item("NmBrg").ToString) FPESANAN.ListView1.Items(x - 1).SubItems.Add(baca.Item("Harsat").ToString) FPESANAN.ListView1.Items(x - 1).SubItems.Add(baca.Item("Total").ToString) x = x + 1
FPESANAN.T11.Text = Val(FPESANAN.T11.Text) + baca.Item(5)
End While
cmd.Dispose() baca.Close() End Function
Public Sub tampilpesanan()
cmd = New OleDbCommand("Select * from PESANAN Where NoPsn
= '" & xNoPsn & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = True Then baca.Read()
xNoPsn = baca.Item(0) xTglPsn = baca.Item(1) xKdSup = baca.Item(2) Else
MsgBox("Kode Pesanan ;[" & xNoPsn & "] Tidak Ada Dalam Database", MsgBoxStyle.Information, "Pesan")
End If End Sub End Class
CLASS PUNYA
Imports System.Data.OleDb Imports System.Data
Public Class CPunya
Private xJmlhBrg As String Dim cmd As OleDbCommand Dim baca As OleDbDataReader
Public Property JmlhBrg() As String Get
Return xJmlhBrg
End Get
Set(ByVal value As String) xJmlhBrg = value
End Set End Property
Public Function simpan(ByVal i As Integer, ByVal xNoTTB As String, ByVal xKdBrg As String) As Integer
cmd = New OleDbCommand("insert into BELI(NoTTB,KdBrg,JmlhBrg)" & _
"values('" & xNoTTB & "','" &
xKdBrg & "', '" & xJmlhBrg & "')", cn) cmd.ExecuteNonQuery()
End Function End Class
CLASS RETUR
Imports System.Data.OleDb Imports System.Data
Public Class CRetur
Private xNoRetur As String Private xTglRetur As String Private xNoTTB As String
Dim cmd As OleDbCommand Dim baca As OleDbDataReader
Dim bari As Boolean Dim x As Integer
Public Property NoRetur() As String Get
Return xNoRetur End Get
Set(ByVal value As String) xNoRetur = value
End Set End Property
Public Property TglRetur() As String Get
Return xTglRetur End Get
Set(ByVal value As String) xTglRetur = value End Set
End Property
Public Property NoTTB() As String Get
Return xNoTTB End Get
Set(ByVal value As String) xNoTTB = value
End Set End Property
Public Function simpan(ByVal NoRetur As String) As Integer cmd = New OleDbCommand("insert into
RETUR(NoRetur,TglRetur,NoTTB)" & _
"values('" & xNoRetur & "','" &
xTglRetur & "','" & xNoTTB & "')", cn) Return cmd.ExecuteNonQuery End Function
Public Function muncul(ByVal xNoPsn As String) As Integer x = 1
cmd = New OleDbCommand("select * from QRetur where NoRetur
='" & xNoRetur & "' order by KdBrg", cn) baca = cmd.ExecuteReader
FRETUR.ListView1.Items.Clear()
While baca.Read
xTglRetur = baca.Item(1) xNoTTB = baca.Item(2)
FRETUR.ListView1.Items.Add((x).ToString) FRETUR.ListView1.Items(x -
1).SubItems.Add(baca.Item("KdBrg").ToString) FRETUR.ListView1.Items(x -
1).SubItems.Add(baca.Item("NmBrg").ToString) x = x + 1
End While cmd.Dispose() baca.Close() End Function End Class
CLASS SUPLIER
Imports System.Data.OleDb Imports System.Data
Public Class CSupplier
Private xKdSup As String Private xNmSup As String Private xAlamat As String Private xTelpon As String
Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim x As Integer
Dim baris As Boolean Public nill As Integer
Public Property KdSup() As String Get
Return xKdSup End Get
Set(ByVal value As String) xKdSup = value
End Set End Property
Public Property NmSup() As String Get
Return xNmSup End Get
Set(ByVal value As String) xNmSup = value
End Set End Property
Public Property Alamat() As String Get
Return xAlamat End Get
Set(ByVal value As String) xAlamat = value
End Set End Property
Public Property Telpon() As String Get
Return xTelpon End Get
Set(ByVal value As String) xTelpon = value
End Set End Property
Public Function simpan(ByVal Kode As String) As Integer
cmd = New OleDbCommand("Select * From SUPPLIER where KdSup
='" & Kode & "'", cn)
baca = cmd.ExecuteReader() baris = False
If baca.HasRows = True Then
MsgBox("Kode Supplier : " & Kode & " Sudah Pernah Disimpan !")
Else
cmd = New OleDbCommand("Insert into SUPPLIER(KdSup,NmSup,Alamat,Telpon)" & _
"values('" & Kode & "','" & xNmSup & "','" & xAlamat &
"','" & xTelpon & "')", cn)
MessageBox.Show("Data Dengan Kode Supplier : " & Kode
& " Sudah Tersimpan ")
Return cmd.ExecuteNonQuery End If
End Function
Public Function Ubah(ByVal Kode As String) As Integer
cmd = New OleDbCommand("select * from SUPPLIER where KdSup
='" & Kode & "'", cn)
baca = cmd.ExecuteReader() baris = False
If baca.HasRows = True Then
cmd = New OleDbCommand("update SUPPLIER set NmSup='" &
xNmSup & "',Alamat='" & _
xAlamat & "',Telpon='" & xTelpon & "' where KdSup='" &
Kode & "'", cn)
MessageBox.Show(" Data Dengan Kode Supplier : " & Kode
& " Sudah Diubah ")
Return cmd.ExecuteNonQuery End If
End Function
Public Function Hapus() As Integer
cmd = New OleDbCommand("select * from SUPPLIER where KdSup
='" & xKdSup & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = False Then
MsgBox("Kode Barang : [" & xKdSup & "] Tidak Ada ", MsgBoxStyle.Information, "Pesan !")
Else
MsgBox("Kode Barang : [" & xKdSup & "] Sudah Dihapus
", MsgBoxStyle.Information, "Pesan !")
cmd = New OleDbCommand("delete from SUPPLIER where KdSup='" & xKdSup & "'", cn)
Return cmd.ExecuteNonQuery End If
End Function
Public Function Batal() As Integer KdSup = ""
NmSup = ""
Alamat = ""
Telpon = ""
End Function
Public Sub tampil() '---Untuk Menampilkan data pada TextBox
'nill = 0
cmd = New OleDbCommand("SELECT * FROM SUPPLIER where KdSup='" & xKdSup & "'", cn)
baca = cmd.ExecuteReader 'baris = False
If baca.HasRows = True Then 'nill = 0
'baris = True
baca.Read()
xKdSup = baca.Item(0) xNmSup = baca.Item(1) xAlamat = baca.Item(2) xTelpon = baca.Item(3)
End If
'If baca.IsClosed = False Then baca.Close() 'Return Baris
End Sub 'Tambahan
Public Sub TampilTranSUPPLIER()
cmd = New OleDbCommand("SELECT * FROM SUPPLIER where KdSup='" & xKdSup & "'", cn)
baca = cmd.ExecuteReader 'baris = False
If baca.HasRows = True Then 'nill = 0
'baris = True baca.Read()
xKdSup = baca.Item(0) xNmSup = baca.Item(1) xAlamat = baca.Item(2) xTelpon = baca.Item(3)
Else
MsgBox("Kode Supplier : (" & xKdSup & ") Tidak Ada Dalam DataBase ", MsgBoxStyle.Information, "Pesan!")
Batal() End If End Sub
Public Sub ShowData() '---untuk menampilkan isi data di listview
X = 1
cmd = New OleDbCommand("select * from SUPPLIER order by KdSup asc", cn)
baca = cmd.ExecuteReader
FSupplier.ListView1.Items.Clear() While baca.Read
FSupplier.ListView1.Items.Add((x).ToString) FSupplier.ListView1.Items(x -
1).SubItems.Add(baca.Item("KdSup").ToString) FSupplier.ListView1.Items(x - 1).SubItems.Add(baca.Item("NmSup").ToString) FSupplier.ListView1.Items(x - 1).SubItems.Add(baca.Item("Alamat").ToString) FSupplier.ListView1.Items(x - 1).SubItems.Add(baca.Item("Telpon").ToString) x = x + 1
End While End Sub
End Class
FORM BARANG
Imports System.Data.OleDb Imports System.Data
Public Class FBarang
Dim Obj As New CBARANG
Private Sub FBarang_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
T1.Focus() End Sub
Private Sub FBarang_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
T1.Text = Obj.KdBrg Obj.ShowData() End Sub
Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B1.Click
If T1.Text = "" Then
MsgBox(" Kode Barang Tidak Boleh Kosong ", 16, "Pesan
!")
T1.Focus()
ElseIf T2.Text = "" Then
MsgBox(" Nama Barang Tidak Boleh Kosong ", MsgBoxStyle.Critical, "Pesan !")
T2.Focus()
ElseIf T3.Text = "" Then
MsgBox("Isi Type Barang Yang Ada Pada textbox ", MsgBoxStyle.Critical, "Pesan !")
T3.Focus()
ElseIf T4.Text = "" Then
MsgBox(" Isi Harsat Barang yang ada pada textbox ", MsgBoxStyle.Critical, "Pesan !")
T4.Focus() Else
Obj.KdBrg = T1.Text Obj.NmBrg = T2.Text Obj.Type = T3.Text Obj.Harsat = T4.Text Obj.Stok = T5.Text
Obj.simpan(T1.Text) Obj.ShowData() Obj.Batal()
T1.Text = Obj.KdBrg T2.Text = Obj.NmBrg T3.Text = Obj.Type T4.Text = Obj.Harsat T5.Text = Obj.Stok T1.Focus()
End If End Sub
Private Sub B2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B2.Click
Obj.KdBrg = T1.Text Obj.NmBrg = T2.Text Obj.Type = T3.Text Obj.Harsat = T4.Text Obj.Stok = T5.Text Obj.Ubah(T1.Text) Obj.ShowData() Obj.Batal()
T1.Text = Obj.KdBrg T2.Text = Obj.NmBrg T3.Text = Obj.Type T4.Text = Obj.Harsat T5.Text = Obj.Stok T1.Focus()
End Sub
Private Sub B3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B3.Click
Obj.Batal()
T1.Text = Obj.KdBrg T2.Text = Obj.NmBrg T3.Text = Obj.Type T4.Text = Obj.Harsat T5.Text = Obj.Stok T2.Focus()
End Sub
Private Sub B4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B4.Click
Dim Pesan As String
Pesan = MsgBox(" Apakah Kode Barang : [ " & T1.Text & " ] Akan Dihapus !?", MsgBoxStyle.OkCancel, "Pesan !")
If Pesan = MsgBoxResult.Ok Then Obj.KdBrg = T1.Text
Obj.Hapus() Obj.ShowData() Else
MsgBox(" Kode Barang < " & T1.Text & " > Batal Dihapus", MsgBoxStyle.OkOnly, "Pesan !")
End If Obj.Batal()
T1.Text = Obj.KdBrg T2.Text = Obj.NmBrg T3.Text = Obj.Type T4.Text = Obj.Harsat T5.Text = Obj.Stok T2.Focus()
End Sub
Private Sub B5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B5.Click
Me.Close() End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ListView1.SelectedIndexChanged Obj.KdBrg = T1.Text
T1.Text = ListView1.FocusedItem.SubItems(0).Text T2.Text = ListView1.FocusedItem.SubItems(1).Text T3.Text = ListView1.FocusedItem.SubItems(2).Text T4.Text = ListView1.FocusedItem.SubItems(3).Text T5.Text = ListView1.FocusedItem.SubItems(4).Text T1.Focus()
End Sub
Private Sub T1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T1.KeyPress If Asc(e.KeyChar) = 13 Then
Obj.KdBrg = T1.Text Obj.TampilTranBrg() T1.Text = Obj.KdBrg T2.Text = Obj.NmBrg T3.Text = Obj.Type T4.Text = Obj.Harsat T5.Text = Obj.Stok T1.Focus()
End If End Sub
Private Sub T1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T1.TextChanged
End Sub End Class
FORM SUPPLIER
Imports System.Data.OleDb Imports System.Data
Public Class FSupplier
Dim obj As New CSupplier
Private Sub FSupplier_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
T1.Focus() End Sub
Private Sub FSupplier_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
T1.Text = obj.KdSup obj.ShowData() End Sub
Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B1.Click
If T1.Text = "" Then
MsgBox(" isi kode SUPPLIER yang ada pada texbox", 16,
"pesan")
T1.Focus()
ElseIf T2.Text = "" Then
MsgBox(" Isi Nama SUPPLIER yang ada pada textbox ", MsgBoxStyle.Critical, "Pesan !")
T2.Focus()
ElseIf T3.Text = "" Then
MsgBox(" Isi alamat yang ada pada textbox ", MsgBoxStyle.Critical, "Pesan !")
T3.Focus()
ElseIf T4.Text = "" Then
MsgBox(" Isi telpon yang ada pada textbox ", MsgBoxStyle.Critical, "Pesan !")
T4.Focus() Else
obj.KdSup = T1.Text obj.NmSup = T2.Text obj.Alamat = T3.Text obj.Telpon = T4.Text obj.simpan(T1.Text) obj.ShowData() obj.Batal()
T1.Text = obj.KdSup T2.Text = obj.NmSup T3.Text = obj.Alamat T4.Text = obj.Telpon T1.Focus()
End If End Sub
Private Sub B2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B2.Click
obj.KdSup = T1.Text obj.NmSup = T2.Text obj.Alamat = T3.Text obj.Telpon = T4.Text obj.Ubah(T1.Text) obj.ShowData() obj.Batal()
T1.Text = obj.KdSup T2.Text = obj.NmSup T3.Text = obj.Alamat T4.Text = obj.Telpon T1.Focus()
End Sub
Private Sub B3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B3.Click
Dim Pesan As String
Pesan = MsgBox(" Apakah Kode SUPPLIER: [ " & T1.Text & " ] Akan Dihapus !?", MsgBoxStyle.OkCancel, "Pesan !")
If Pesan = MsgBoxResult.Ok Then obj.KdSup = T1.Text
obj.Hapus() obj.ShowData() Else
MsgBox(" Kode SUPPLIER < " & T1.Text & " > Batal Dihapus", MsgBoxStyle.OkOnly, "Pesan !")
End If obj.Batal()
T1.Text = obj.KdSup T2.Text = obj.NmSup T3.Text = obj.Alamat T4.Text = obj.Telpon T1.Focus()
End Sub
Private Sub B4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B4.Click
obj.Batal()
T1.Text = obj.KdSup T2.Text = obj.NmSup T3.Text = obj.Alamat T4.Text = obj.Telpon T1.Focus()
End Sub
Private Sub B5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B5.Click
Me.Close() End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
obj.KdSup = T1.Text
T1.Text = ListView1.FocusedItem.SubItems(0).Text T2.Text = ListView1.FocusedItem.SubItems(1).Text T3.Text = ListView1.FocusedItem.SubItems(2).Text T4.Text = ListView1.FocusedItem.SubItems(3).Text T1.Focus()
End Sub
Private Sub T1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T1.KeyPress If Asc(e.KeyChar) = 13 Then
obj.KdSup = T1.Text obj.TampilTranSUPPLIER() T1.Text = obj.KdSup T2.Text = obj.NmSup T3.Text = obj.Alamat T4.Text = obj.Telpon T1.Focus()
End If End Sub
Private Sub T1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T1.TextChanged
End Sub
Private Sub ListView1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ListView1.SelectedIndexChanged
End Sub End Class
FORM PESANAN
Imports System.Data.OleDb Imports System.Data
Public Class FPESANAN
Private tt As Double = 0.0
Dim bb As New CBARANG Dim pp As New CPesanan Dim ps As New CPesan Dim sup As New CSupplier
Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim stok As Integer
Dim va As String = ""
Dim nil As String = ""
Dim x As New Integer Public Sub ade()
Dim va As String = ""
Dim nil As String = ""
cmd = New OleDbCommand("select * from PESANAN where NoPsn order by NoPsn desc", cn)
baca = cmd.ExecuteReader If baca.Read Then
va = Mid(baca.Item("NoPsn"), 4, 4) Else
T1.Text = "P0001"
Exit Sub
End If
nil = Val(va) + 1
T1.Text = "P" & Mid("000", 1, 4 - nil.Length) & nil B4.Enabled = False
End Sub
Private Sub FPESANAN_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
x = 1
T2.Text = Format(Date.Today) Call ade()
End Sub
Public Sub kunci() T1.Enabled = False T2.Enabled = False T3.Enabled = False T4.Enabled = False T5.Enabled = False T8.Enabled = False
End Sub
Public Sub bukakunci() T1.Enabled = True T2.Enabled = True T3.Enabled = True T4.Enabled = True T5.Enabled = True T8.Enabled = True End Sub
Public Sub apos() T3.Text = ""
T4.Text = ""
T5.Text = ""
T8.Text = ""
End Sub
Public Sub aposbarang() TextBox7.Text = ""
TextBox8.Text = ""
T9.Text = ""
T11.Text = ""
TextBox7.Focus() End Sub
Public Sub hapusgale() TextBox7.Text = ""
TextBox8.Text = ""
T9.Text = ""
T10.Text = ""
Call apos()
ListView1.Items.Clear() T3.Focus()
Call ade() End Sub
Public Sub tambahlist()
Dim lis As New ListViewItem lis.Text = x
lis.SubItems.Add(TextBox7.Text) lis.SubItems.Add(TextBox8.Text) lis.SubItems.Add(T9.Text)
lis.SubItems.Add(T10.Text) lis.SubItems.Add(T11.Text) lis.SubItems.Add(stok)
ListView1.Items.AddRange(New ListViewItem() {lis}) T11.Text = Val(T11.Text) + Val(lis.SubItems(5).Text) x = x + 1
End Sub
Private Sub T10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T11.KeyPress If Asc(e.KeyChar) = 13 Then
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).SubItems(1).Text = TextBox7.Text Then
MessageBox.Show("Kode Barang : [" &
TextBox7.Text & "] Sudah Masuk daftar pesan", "information", MessageBoxButtons.OK, MessageBoxIcon.Information)
apos() End If
Next End If
tambahlist() apos()
End Sub
Private Sub T3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T3.KeyPress If Asc(e.KeyChar) = 13 Then
sup.KdSup = T3.Text sup.TampilTranSUPPLIER() T4.Text = sup.NmSup T5.Text = sup.Alamat T8.Text = sup.Telpon TextBox7.Focus() End If
End Sub
Private Sub T3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T3.TextChanged
End Sub
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles
TextBox7.KeyPress
If Asc(e.KeyChar) = 13 Then bb.KdBrg = TextBox7.Text bb.TampilTranBrg()
TextBox8.Text = bb.NmBrg T9.Text = bb.Harsat T10.Focus()
stok = bb.Stok End If
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.TextChanged
End Sub
Private Sub T10_KeyPress1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T10.KeyPress Select Case e.KeyChar
Case Chr(47) To Chr(57) T10.Focus()
Case Chr(8)
e.KeyChar = Chr(8) Case Chr(13)
If TextBox7.Text = "" Or T9.Text = "" Then MsgBox("Masukkan Data dengan benar", MsgBoxStyle.Exclamation, "informasi")
Else
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).SubItems(1).Text = TextBox7.Text Then
MessageBox.Show("kode barang : [" &
TextBox7.Text & "] sudah masuk dalam daftar pesan !",
"information", MessageBoxButtons.OK, MessageBoxIcon.Information) aposbarang()
BCETAK.Enabled = True End If
Next
If stok < T10.Text Then
MessageBox.Show("Stok barang hanya " &
stok & "...")
TextBox7.Focus() Exit Sub
Else
T11.Text = Val(T9.Text) * Val(T10.Text) End If
BCETAK.Enabled = True tambahlist()
aposbarang() End If
Case Else
e.KeyChar = Chr(0) End Select
End Sub
Private Sub T10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T10.TextChanged
T11.Text = Val(T9.Text) * Val(T10.Text) : B4.Enabled = True
End Sub
Private Sub B4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B4.Click
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).SubItems(1).Text = TextBox7.Text Then
MessageBox.Show("kode barang : [" & TextBox7.Text
& "] Sudah masuk Daftar Pesan", "information", MessageBoxButtons.OK, MessageBoxIcon.Information) aposbarang()
Exit Sub End If
Next
BCETAK.Enabled = True tambahlist()
aposbarang() End Sub
Public Sub cetak()
MsgBox("No Pesanan [" & T1.Text & "] Akan Dicetak", ) FCP.CrystalReportViewer1.SelectionFormula = "
{QPesanan.NoPsn}='" & T1.Text & "'"
FCP.CrystalReportViewer1.RefreshReport() FCP.ShowDialog()
End Sub
Private Sub BCETAK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BCETAK.Click
pp.NoPsn = T1.Text pp.TglPsn = T2.Text pp.KdSup = T3.Text
cmd = New OleDbCommand("select * from PESANAN where NoPsn
= '" & T1.Text & "'", cn)
baca = cmd.ExecuteReader
If baca.HasRows = True Then
MessageBox.Show("Nomor Pesanan :[" & T1.Text & "] Siap Dicetak", "information", MessageBoxButtons.OK,
MessageBoxIcon.Information) Call cetak() Call ade()
ElseIf T3.Text = "" Then
MsgBox("Data Supplier Tidak Boleh Kosong", 16,
"Ingat")
T3.Focus() Else
pp.simpan(T1.Text)
For i = 0 To ListView1.Items.Count - 1
ps.JmlhBrg = ListView1.Items(i).SubItems(4).Text ps.simpan(i, T1.Text,
ListView1.Items(i).SubItems(1).Text)
bb.NmBrg = ListView1.Items(i).SubItems(2).Text bb.Harsat = ListView1.Items(i).SubItems(3).Text bb.Stok = ListView1.Items(i).SubItems(6).Text - ListView1.Items(i).SubItems(4).Text
bb.Ubah(ListView1.Items(i).SubItems(1).Text) Next
MessageBox.Show("Nomor Pesanan : [" & T1.Text & "]
Sudah Tersimpan", "information", MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
Call cetak() Call ade() End If
Call ade()
T1.Text = pp.NoPsn hapusgale()
End Sub
Private Sub B2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B2.Click
hapusgale() Call ade() bukakunci() End Sub
Private Sub B3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B3.Click
Me.Close() End Sub
Private Sub T1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T1.KeyPress
If Asc(e.KeyChar) = 13 Then
cmd = New OleDbCommand("select * from PESANAN where NoPsn = '" & T1.Text & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = False Then
MessageBox.Show("No Pesanan : [" & T1.Text & "]
Tidak ada dalam database", "information", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
kunci()
pp.muncul(T1.Text) T2.Text = pp.TglPsn T3.Text = pp.KdSup T4.Text = sup.NmSup T5.Text = sup.Alamat T8.Text = sup.Telpon
End If End If End Sub
Private Sub T1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T1.TextChanged
End Sub
Private Sub T3_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles T3.Leave
If T4.Text = "" Then Else
data() End If End Sub Sub data()
sup.KdSup = T3.Text sup.TampilTranSUPPLIER() T3.Text = sup.KdSup T4.Text = sup.NmSup T5.Text = sup.Alamat T8.Text = sup.Telpon End Sub
Private Sub T4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T4.TextChanged
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ListView1.SelectedIndexChanged End Sub
Private Sub T11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T11.TextChanged
End Sub End Class
FORM RETUR
Imports System.Data.OleDb Imports System.Data
Public Class FRETUR
Dim br As New CBARANG Dim rt As New CRetur Dim sup As New CSupplier Dim krm As New CKirim Dim tb As New CLTTB
Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim baris As Boolean
Dim nilai As String = ""
Dim va As String = ""
Dim x As New Integer
Public Sub ade()
Dim va As String = ""
Dim nil As String = ""
cmd = New OleDbCommand("select * from RETUR where NoRetur order by NoRetur desc", cn)
baca = cmd.ExecuteReader If baca.Read Then
va = Mid(baca.Item("NoRetur"), 4, 4) Else
T1.Text = "R0001"
Exit Sub
End If
nil = Val(va) + 1
T1.Text = "R" & Mid("000", 1, 4 - nil.Length) & nil BTNTAMBAH.Enabled = False
End Sub
Public Sub kunci() T1.Enabled = False T2.Enabled = False T3.Enabled = False T4.Enabled = False T5.Enabled = False T6.Enabled = False T7.Enabled = False End Sub
Public Sub bukakunci() T1.Enabled = True T2.Enabled = True T3.Enabled = True T4.Enabled = True
T5.Enabled = True T6.Enabled = True T7.Enabled = True End Sub
Public Sub apos() T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
End Sub
Public Sub aposbarang() T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T8.Focus() End Sub
Public Sub hapusgale() T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
Call apos()
ListView1.Items.Clear() T3.Focus()
Call ade() End Sub
Private Sub T4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T4.KeyPress If Asc(e.KeyChar) = 13 Then
sup.KdSup = T4.Text sup.TampilTranSUPPLIER() T5.Text = sup.NmSup T6.Text = sup.Alamat T7.Text = sup.Telpon T8.Focus()
Else
sup.Batal() End If
End Sub
Private Sub T8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T8.KeyPress If Asc(e.KeyChar) = 13 Then
br.KdBrg = T8.Text br.TampilTranBrg() T9.Text = br.NmBrg T10.Focus()
End If
End Sub
Private Sub B4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNTAMBAH.Click
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).SubItems(1).Text = T8.Text Then
MessageBox.Show("kode barang : [" & T8.Text & "]
Sudah masuk Daftar Pesan", "information", MessageBoxButtons.OK, MessageBoxIcon.Information)
aposbarang() Exit Sub End If
Next
tambahlist()
BTNCETAK.Enabled = True aposbarang()
End Sub
Public Sub cetak()
MsgBox("No Retur [" & T1.Text & "] Siap Dicetak", ) FCR.CrystalReportViewer1.SelectionFormula = "
{QRetur.NoRetur}='" & T1.Text & "'"
FCR.CrystalReportViewer1.RefreshReport() FCR.ShowDialog()
End Sub
Private Sub BTNCETAK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNCETAK.Click
rt.NoRetur = T1.Text rt.TglRetur = T2.Text rt.NoTTB = T3.Text
cmd = New OleDbCommand("select * from RETUR where NoRetur
= '" & T1.Text & "'", cn)
baca = cmd.ExecuteReader
If baca.HasRows = True Then
MessageBox.Show("Nomor Retur :[" & T1.Text & "] Siap Dicetak", "information", MessageBoxButtons.OK,
MessageBoxIcon.Information) Call cetak()
ElseIf T3.Text = "" Then
MsgBox("Nomor TTB Tidak Boleh Kosong", 16, "Ingat") T3.Focus()
Else
rt.simpan(T1.Text)
For i = 0 To ListView1.Items.Count - 1 krm.JmlhRetur =
ListView1.Items(i).SubItems(3).Text krm.AlasanRetur = ListView1.Items(i).SubItems(4).Text krm.simpan(i, T1.Text, ListView1.Items(i).SubItems(1).Text) Next
MessageBox.Show("Nomor Retur : [" & T1.Text & "]
Siapkan Printer", "information", MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
Call cetak() Call ade() End If
Call ade()
T1.Text = rt.NoRetur hapusgale()
End Sub
Public Sub tambahlist()
Dim lis As New ListViewItem lis.Text = x
lis.SubItems.Add(T8.Text) lis.SubItems.Add(T9.Text) lis.SubItems.Add(T10.Text) lis.SubItems.Add(T11.Text)
ListView1.Items.AddRange(New ListViewItem() {lis}) T10.Text = Val(T10.Text) + Val(lis.SubItems(3).Text) T11.Text = Val(T11.Text) + Val(lis.SubItems(4).Text)
x = x + 1 End Sub
Private Sub B2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNBTL.Click
hapusgale() Call ade() bukakunci() End Sub
Private Sub B3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNKLR.Click
Me.Close() End Sub
Private Sub T1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T1.KeyPress If Asc(e.KeyChar) = 13 Then
cmd = New OleDbCommand("select * from RETUR where NoRetur = '" & T1.Text & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = False Then
MessageBox.Show("No Retur : [" & T1.Text & "]
Tidak ada dalam database", "information", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
kunci()
rt.muncul(T1.Text) T2.Text = rt.TglRetur T3.Text = rt.NoTTB T4.Text = sup.NmSup T5.Text = sup.Alamat T8.Text = sup.Telpon
End If End If End Sub
Private Sub T1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T1.TextChanged
End Sub
Private Sub T3_Leave(ByVal sender As Object, ByVal e As System.EventArgs)
If T4.Text = "" Then Else
data() End If End Sub Sub data()
sup.KdSup = T3.Text sup.TampilTranSUPPLIER() T4.Text = sup.KdSup T5.Text = sup.NmSup T6.Text = sup.Alamat T7.Text = sup.Telpon End Sub
Private Sub FRETUR_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
x = 1
T2.Text = Format(Date.Today) Call ade()
End Sub
Private Sub T11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T11.TextChanged
BTNTAMBAH.Enabled = True End Sub
Private Sub T10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T10.KeyPress If Asc(e.KeyChar) = 13 Then
If T10.Text = "" Then
MsgBox("Isi Dulu Jumlah Retur") T10.Focus()
Else
T11.Focus() End If
End If End Sub
Private Sub T10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T10.TextChanged
End Sub
Public Sub tampil_TTB() tb.NoTTB = T3.Text tb.TAMPILTTB() T3.Text = tb.NoTTB End Sub
Private Sub T3_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles T3.GotFocus
cmd = New OleDbCommand("Select * from TTB order by NoTTB asc", cn)
baca = cmd.ExecuteReader Me.T3.Items.Clear() While baca.Read
T3.Items.Add(baca.GetString(0)) End While
End Sub
Private Sub T3_Leave1(ByVal sender As Object, ByVal e As System.EventArgs) Handles T3.Leave
If T3.Text = "" Then Exit Sub
Else
tampil_TTB() End If
End Sub
Private Sub T3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T3.SelectedIndexChanged
tampil_TTB() End Sub
Private Sub T4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T4.TextChanged
End Sub End Class
FORM TTB
Imports System.Data.OleDb Imports System.Data
Public Class FTTB
Dim e As New CPesanan Dim a As New CBARANG Dim b As New CPunya Dim c As New CLTTB Dim d As New CSupplier Dim cmd As OleDbCommand Dim baca As OleDbDataReader Dim baris As Boolean
Dim nilai As String = ""
Dim nulis As String = ""
Dim x As New Integer Public Sub DILA()
Dim nilai As String = ""
Dim nulis As String = ""
cmd = New OleDbCommand("select * from TTB where NoTTB order by NoTTB desc", cn)
baca = cmd.ExecuteReader
If baca.Read Then
nilai = Mid(baca.Item("NoTTB"), 4, 4) Else
T1.Text = "T001"
Exit Sub End If
nulis = Val(nilai) + 1
T1.Text = "T" & Mid("00", 1, 4 - nulis.Length) & nulis B4.Enabled = False
End Sub
Private Sub T14_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T14.KeyPress If Asc(e.KeyChar) = 13 Then
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).SubItems(1).Text = T10.Text Then
MessageBox.Show("Kode Barang : [" & T10.Text &
"] Sudah Masuk Daftar Pesan", "information", MessageBoxButtons.OKCancel)
hapusbarang() Exit Sub End If
Next End If tambah() hapusbarang() End Sub
Public Sub tambah()
Dim list As New ListViewItem list.Text = x
list.SubItems.Add(T10.Text) list.SubItems.Add(T11.Text) list.SubItems.Add(T12.Text) list.SubItems.Add(T13.Text) list.SubItems.Add(T14.Text)
ListView1.Items.AddRange(New ListViewItem() {list}) T14.Text = Val(T14.Text) + Val(list.SubItems(4).Text) x = x + 1
End Sub
Private Sub FTTB_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
x = 1
T2.Text = Format(Date.Today) Call DILA()
End Sub
Public Sub CETAK()
MsgBox("No TTB :[" & T1.Text & "] Akan Dicetak") FCTTB.CrystalReportViewer1.SelectionFormula = "
{QTTB.NoTTB}='" & T1.Text & "'"
FCTTB.CrystalReportViewer1.RefreshReport() FCTTB.ShowDialog()
End Sub
Private Sub T6_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T6.KeyPress If Asc(e.KeyChar) = 13 Then
d.KdSup = T6.Text d.TampilTranSUPPLIER() T7.Text = d.NmSup T8.Text = d.Alamat T9.Text = d.Telpon T10.Focus()
Else
d.Batal() End If
End Sub
Private Sub T10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T10.KeyPress If Asc(e.KeyChar) = 13 Then
a.KdBrg = T10.Text a.TampilTranBrg() T11.Text = a.NmBrg T12.Text = a.Harsat T13.Focus()
End If End Sub
Private Sub T13_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T13.KeyPress If Asc(e.KeyChar) = 13 Then
If T13.Text = "" Then
MsgBox("Isi dulu jumlah yang ingin dibeli") T13.Focus()
Else
cmd = New OleDbCommand("select * from BARANG where KdBrg = '" & T10.Text & "'", cn)
baca = cmd.ExecuteReader
T14.Text = T12.Text * T13.Text T14.Focus()
End If End If End Sub
Public Sub hapusbarang() T10.Text = ""
T11.Text = ""
T12.Text = ""
T13.Text = ""
T14.Text = ""
T10.Focus() End Sub
Public Sub hapusgale() T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
Call hapusbarang() ListView1.Items.Clear() T3.Focus()
Call DILA() End Sub
Private Sub T13_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T13.TextChanged
T14.Text = Val(T12.Text) * Val(T13.Text) : B4.Enabled = True
End Sub
Sub bukakunci()
T1.Enabled = True
T2.Enabled = True T3.Enabled = True T4.Enabled = True T5.Enabled = True T6.Enabled = True T7.Enabled = True T8.Enabled = True T9.Enabled = True End Sub
Sub kunci()
T1.Enabled = False T2.Enabled = False T3.Enabled = False T4.Enabled = False T5.Enabled = False T6.Enabled = False T7.Enabled = False T8.Enabled = False T9.Enabled = False End Sub
Private Sub T1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles T1.KeyPress If Asc(e.KeyChar) = 13 Then
cmd = New OleDbCommand("select * from TTB where NoTTB
= '" & T1.Text & "'", cn)
baca = cmd.ExecuteReader If baca.HasRows = False Then
MessageBox.Show("No TTB : [" & T1.Text & "] Tidak ada dalam database", "information", MessageBoxButtons.OK,
MessageBoxIcon.Information) Else
kunci()
c.tampil(T1.Text) T2.Text = c.TglTTB T4.Text = c.NoRefNota T3.Text = c.NoRefSj T5.Text = c.NoPsn T6.Text = d.KdSup T7.Text = d.NmSup T8.Text = d.Alamat T9.Text = d.Telpon End If
End If End Sub
Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B1.Click
c.NoTTB = T1.Text c.TglTTB = T2.Text c.NoRefNota = T3.Text c.NoRefSj = T4.Text c.NoPsn = T5.Text c.KdSup = T6.Text
cmd = New OleDbCommand("Select * from TTB where NoTTB = '"
& T1.Text & "'", cn)
baca = cmd.ExecuteReader
If baca.HasRows = True Then
MessageBox.Show("No TTB : [" & T1.Text & "] LANGSUNG CETAK", "information", MessageBoxButtons.OK,
MessageBoxIcon.Information) Call CETAK()
ElseIf T6.Text = "" Then
MsgBox("Tidak boleh ada data supplier yang kosong", 16, "Pesan")
T3.Focus() Else
c.simpan(T1.Text)
For i = 0 To ListView1.Items.Count - 1
b.JmlhBrg = ListView1.Items(i).SubItems(4).Text b.simpan(i, T1.Text,
ListView1.Items(i).SubItems(1).Text) Next
MessageBox.Show("data dengan No TTB : [" & T1.Text &
"]SIAP DICETAK", "infomation", MessageBoxButtons.OK, MessageBoxIcon.Information)
Call CETAK() End If
Call DILA()
T1.Text = c.NoTTB hapusgale()
End Sub
Private Sub B2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B2.Click
Call hapusgale() Call DILA() bukakunci() End Sub
Private Sub B4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B4.Click
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).SubItems(1).Text = T10.Text Then MessageBox.Show("Kode Barang [" & T10.Text & "]
Sudah Masuk Dafar TTB", "information", MessageBoxButtons.OK, MessageBoxIcon.Information)
hapusbarang() Exit Sub End If
Next
B1.Enabled = True tambah()
hapusbarang() End Sub
Private Sub B3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B3.Click
Me.Close() End Sub
Public Sub Tampildata() e.NoPsn = T5.Text e.tampilpesanan() T5.Text = e.NoPsn
End Sub
Private Sub T5_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles T5.GotFocus
cmd = New OleDbCommand("select * from PESANAN order by NoPsn asc", cn)
baca = cmd.ExecuteReader Me.T5.Items.Clear() While baca.Read
T5.Items.Add(baca.GetString(0)) End While
End Sub
Private Sub T5_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles T5.Leave
If T5.Text = "" Then Exit Sub
Else
Tampildata() End If
End Sub
Private Sub T5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T5.SelectedIndexChanged
Tampildata() End Sub
End Class
FORM CETAK LAPORAN PEMBELIAN
Public Class FTGLLAP
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
laporan.ShowDialog() End Sub
Private Sub FTGLLAP_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub End Class
FORM MENU UTAMA
Imports System.Data.OleDb Imports System.Data
Public Class FMenuUtama
Private Sub FMenuUtama_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
cn = New OleDbConnection(Con)
cn.Open()
MessageBox.Show("SUKSES. . .SELAMAT DATANG")
Catch ex As Exception
MessageBox.Show("KONEKSI DATABASE GAGAL") MsgBox(ex.Message)
Me.Dispose()
End Try End Sub
Private Sub BARANG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BARANG.Click
FBarang.ShowDialog() End Sub
Private Sub ENTRIDATASUPPLIERToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ENTRIDATASUPPLIERToolStripMenuItem.Click
FSupplier.ShowDialog() End Sub
Private Sub
CETAKTANDATERIMABARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
CETAKTANDATERIMABARANGToolStripMenuItem.Click FPESANAN.ShowDialog()
End Sub
Private Sub CETAKPESANANToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
CETAKPESANANToolStripMenuItem.Click FTTB.ShowDialog()
End Sub
Private Sub KELUARToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
KELUARToolStripMenuItem.Click Me.Close()
End Sub
Private Sub CETAKRETURToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
CETAKRETURToolStripMenuItem.Click FRETUR.ShowDialog()
End Sub
Private Sub CETAKLAPORANPEMBELIANToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CETAKLAPORANPEMBELIANToolStripMenuItem.Click
FTGLLAP.ShowDialog() End Sub
End Class