Вы находитесь на странице: 1из 18

��������������������

����� ������ �� ��� � ������ � ��������� ����� ����� & �������

 �������� �������
������� � ������
������ ����
��.��� 2008, �������� ������, ������� ������ 8.5
8. 5
����� ������ ����� ������������ ��. 200.000,�
���������� ������ ��������� ����� ������ ������� ���������
���� ���������� ������� �������� �� ����� ���� �������� �� ����� ��� �
�� ���� 066 � 0525 � �47
� 47 (��� ��. ��� ��������)
�� ���� 156 � 000 � 250 � 2146 (������� ��. ��� ��������)
�� ��� � 013� � 0106 � 3038 � 504 (��� ��. ��� ��������)
������� ������� ����� �����/�������� (�� � ������������������.���)
������� ��� ����� � �����������71������.���

5.1 Rancangan Database


��������� �������� ����� �������� ������� ��� �������� ���� ������ ��������

1
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

5.2 Normalisasi File dan Relasi Tabel

2
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

3
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

4
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

5.3 Penyerahan Cucian

Imports System.Data.OleDb

Public Class Cucian

Private Sub Cucian_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Call Koneksi()
Call NomorOtomatis()
Call BuatKolomBaru()
LblTanggal.Text = Today
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
'Call BersihkanText()
DGV.Columns.Clear()
Call BuatKolomBaru()
DGV.Focus()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Close()
End Sub

5
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Barang.Show()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Konsumen.Show()
End Sub
End Class

5.11 Pengiriman Cucian


������ ��������� ����� ���������� ������ ��� ����� ������ ������� ����� ������� ����������� �������
�������� ������� ������ ���������� ���������� ���� ���� ���� ����� ����� ���� ������ ����� ����� ����
����� �������� ����������� ������� ���� ����� ���� ����������� ������� �������� ���� ���������

Private Sub Pengiriman_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Call Koneksi()
Call NomorOtomatis()
LblTanggal.Text = Today
Call FakturPesanan()
Call TampilKurir()
End Sub

6
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

Sub DetailPesanan()
da = New OleDbDataAdapter("select detailpsn.kodebrg as [Kode
Barang],barang.namabrg as [Nama Barang],detailpsn.Tarif,jumlahpsn as Jumlah
from barang,detailpsn, pesanan where barang.kodebrg=detailpsn.kodebrg and
pesanan.nomorpsn=detailpsn.nomorpsn and pesanan.nomorpsn='" & ComboBox1.Text
& "'", Conn)
ds = New DataSet
da.Fill(ds)
DGV.DataSource = ds.Tables(0)
DGV.ReadOnly = True
DGV.Columns(0).Width = 150
DGV.Columns(1).Width = 250
DGV.Columns(2).Width = 75
DGV.Columns(3).Width = 75
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Call Bersihkan()
DGV.Columns.Clear()
ComboBox1.Focus()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class

5.12 Laporan Data Master

������� ����������� ������� ����������� ������� �������� ��������������� �������� ����� ������ ��������
������� ������������� ������� ���� ������ �������� ���� ������������� ������� ���� ����� �����������

7
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

������� ��������� ���������� ������ ���� ������ ���� ����� ������� ���� ������ ������ ������������������� 
��� �������� ���� � ��������� �

Public Class LaporanMaster

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.ReportSource = "lap barang.rpt"
End Sub

8
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.ReportSource = "lap konsumen.rpt"
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.ReportSource = "lap KASIR.rpt"
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.ReportSource = "lap KURIR.rpt"
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
System.Windows.Forms.Help.ShowHelp(Me, "mengubah posisi database
dalam crystal report.doc")
End Sub
End Class

5.13 Laporan Penyerahan Cucian


������� ���������� ������ ������ ������� ���� ������ ����� ������ ������� �������� ��� ��������

Sub Tampiltanggal()
Call Koneksi()
cmd = New OleDbCommand("select distinct tanggalPsn from Pesanan",
Conn)
rd = cmd.ExecuteReader

9
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

Do While rd.Read
ComboBox1.Items.Add(rd.Item(0))
ComboBox2.Items.Add(Format(rd.Item(0), "yyyy, MM, dd"))
ComboBox3.Items.Add(Format(rd.Item(0), "yyyy, MM, dd"))
Loop

cmd = New OleDbCommand("select distinct month(tanggalPsn) as bulan


from Pesanan", Conn)
rd = cmd.ExecuteReader
Do While rd.Read
ComboBox4.Items.Add(rd.Item(0))
Loop

cmd = New OleDbCommand("select distinct year(tanggalPsn) as tahun


from Pesanan", Conn)
rd = cmd.ExecuteReader
Do While rd.Read
ComboBox5.Items.Add(rd.Item(0))
Loop
End Sub

Private Sub LaporanPesanan_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Call Tampiltanggal()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Try
If ComboBox1.Text = "" Then
MsgBox("Pilih tanggal terlebih dahulu")
ComboBox1.Focus()
Else
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.SelectionFormula =
"totext({Pesanan.tanggalPsn})='" & ComboBox1.Text & "'"
Laporan.CRV.ReportSource = "lap rincipsn harian.rpt"
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Try
If ComboBox2.Text = "" Or ComboBox3.Text = "" Then
MsgBox("Pilih tanggalPsn awal dan tanggalPsn akhir")

10
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

Exit Sub
Else
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.SelectionFormula = "{Pesanan.tanggalPsn} in date
(" & ComboBox2.Text & ") to date (" & ComboBox3.Text & ")"
Laporan.CRV.ReportSource = "lap rincipsn mingguan.rpt"
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
If ComboBox4.Text = "" Or ComboBox5.Text = "" Then
MsgBox("Pilih dulu bulan dan tahun")
Exit Sub
Else
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.SelectionFormula = "Month({Pesanan.tanggalPsn})=" &
Val(ComboBox4.Text) & " and Year({Pesanan.tanggalPsn})=" &
Val(ComboBox5.Text)
Laporan.CRV.ReportSource = "lap rincipsn bulanan.rpt"
End If
End Sub
End Class

������� ������� ����������� ����� ��������� ����� ���� ����� ������� ��������������� ��������� ��������
������� ������� �������� ������� ������� ������ �� ����� ����

11
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

5.14 Laporan Pengiriman Cucian


������� ���������� ������ ������ ������� ���� ������� ����� ������� ������� �������� ��� ��������

12
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

������ �

Imports System.Data.OleDb

Public Class LaporanPengiriman

Sub Tampiltanggal()
Call Koneksi()
cmd = New OleDbCommand("select distinct tanggalkrm from Pengiriman",
Conn)
rd = cmd.ExecuteReader
Do While rd.Read
ComboBox1.Items.Add(rd.Item(0))
ComboBox2.Items.Add(Format(rd.Item(0), "yyyy, MM, dd"))
ComboBox3.Items.Add(Format(rd.Item(0), "yyyy, MM, dd"))
Loop

cmd = New OleDbCommand("select distinct month(tanggalkrm) as bulan


from Pengiriman", Conn)
rd = cmd.ExecuteReader
Do While rd.Read
ComboBox4.Items.Add(rd.Item(0))
Loop

cmd = New OleDbCommand("select distinct year(tanggalkrm) as tahun


from Pengiriman", Conn)
rd = cmd.ExecuteReader
Do While rd.Read
ComboBox5.Items.Add(rd.Item(0))
Loop
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Try
If ComboBox1.Text = "" Then
MsgBox("Pilih tanggal terlebih dahulu")
ComboBox1.Focus()
Else
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.SelectionFormula =
"totext({Pengiriman.tanggalkrm})='" & ComboBox1.Text & "'"
Laporan.CRV.ReportSource = "lap rincikrm harian.rpt"
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

13
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Try
If ComboBox2.Text = "" Or ComboBox3.Text = "" Then
MsgBox("Pilih tanggalkrm awal dan tanggalkrm akhir")
Exit Sub
Else
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.SelectionFormula = "{Pengiriman.tanggalkrm} in
date (" & ComboBox2.Text & ") to date (" & ComboBox3.Text & ")"
Laporan.CRV.ReportSource = "lap rincikrm mingguan.rpt"
'CRV.Formulas(0) = "tglawal='" & ComboBox2.Text & "'"
'CRV.Formulas(0) = "ambildata='" & ComboBox2.Text & "'"
'CRV.SelectionFormula = "tglawal='" & ComboBox2.Text & "'"
'CRV.SelectionFormula = "tglakhir='" & ComboBox3.Text & "'"
'awal = ComboBox2.Text
'akhir = ComboBox3.Text
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
If ComboBox4.Text = "" Or ComboBox5.Text = "" Then
MsgBox("Pilih dulu bulan dan tahun")
Exit Sub
Else
Laporan.Show()
Laporan.CRV.ReportSource = Nothing
Laporan.CRV.RefreshReport()
Laporan.CRV.SelectionFormula = "Month({Pengiriman.tanggalkrm})="
& Val(ComboBox4.Text) & " and Year({Pengiriman.tanggalkrm})=" &
Val(ComboBox5.Text)
Laporan.CRV.ReportSource = "lap rincikrm bulanan.rpt"
End If
End Sub

Private Sub LaporanPengiriman_Load(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles MyBase.Load
Tampiltanggal()
End Sub
End Class

14
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

15
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

16
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

5.15 Jejak Transaksi


����� ������� ��������� ���� ������ ������� ����� �������� ������� ���� ���� ������� ������ ���� ������
������ ������ ������� ������ �� ����� ����

Sub DetailPesanan()
da = New OleDbDataAdapter("select detailpsn.kodebrg as [Kode
Barang],barang.namabrg as [Nama Barang],detailpsn.Tarif,jumlahpsn as Jumlah
from barang,detailpsn, pesanan where barang.kodebrg=detailpsn.kodebrg and
pesanan.nomorpsn=detailpsn.nomorpsn and pesanan.nomorpsn='" & ComboBox1.Text
& "'", Conn)
ds = New DataSet
da.Fill(ds)
DGV.DataSource = ds.Tables(0)

17
��������������������
����� ������ �� ��� � ������ � ��������� ����� ����� & �������

DGV.ReadOnly = True
DGV.Columns(0).Width = 150
DGV.Columns(1).Width = 250
DGV.Columns(2).Width = 75
DGV.Columns(3).Width = 75
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Call Bersihkan()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class

18

Вам также может понравиться