DESIGN FORM MENU UTAMA
DESIGN DATABASE
FIELD NAME
|
TYPE
|
SIZE
|
KODE_PENGIRIM
|
CHAR
|
20
|
NAMA_PENGIRIM
|
CHAR
|
20
|
ALAMAT_PENGIRIM
|
CHAR
|
20
|
TANGGAL_KIRIM
|
CHAR
|
20
|
LISTING PROGRAM MENU UTAMA
Public Class MENU_UTAMA
Private Sub DataPengirimToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
DataPengirimToolStripMenuItem.Click
pengirim.MdiParent = Me
pengirim.Show()
End Sub
Private Sub DataPenerimaToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
DataPenerimaToolStripMenuItem.Click
penerima.MdiParent = Me
penerima.Show()
End Sub
Private Sub DataKodePosToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
DataKodePosToolStripMenuItem.Click
kode_pos.MdiParent = Me
kode_pos.Show()
End Sub
Private Sub DataHargaPaketToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
DataHargaPaketToolStripMenuItem.Click
harga_paket.MdiParent = Me
harga_paket.Show()
End Sub
Private Sub LaporanRelasiTabelToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
LaporanRelasiTabelToolStripMenuItem.Click
laporan_relasi_tabel.MdiParent = Me
laporan_relasi_tabel.Show()
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 LaporanHargaPaketToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
LaporanHargaPaketToolStripMenuItem.Click
laporan_harga_paket.MdiParent = Me
laporan_harga_paket.Show()
End Sub
Private Sub LaporanKodePosToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
LaporanKodePosToolStripMenuItem.Click
laporan_kode_pos.MdiParent = Me
laporan_kode_pos.Show()
End Sub
Private Sub LaporanPengirimToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
LaporanPengirimToolStripMenuItem.Click
laporan_pengirim.MdiParent = Me
laporan_pengirim.Show()
End Sub
Private Sub LaporanPenerimaToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
LaporanPenerimaToolStripMenuItem.Click
laporan_penerima.MdiParent = Me
laporan_penerima.Show()
End Sub
End Class
DESIGN FORM PENGIRIM
LISTING PROGRAM PENGIRIM
Imports
MySql.Data.MySqlClient
Public Class pengirim
Public db As New
MySql.Data.MySqlClient.MySqlConnection
Public sql As String
Public cmd As MySqlCommand
Public rs As MySqlDataReader
Sub
opendb()
sql = "server=localhost;uid=root;pwd;database=
dwijuliani "
Try
db.ConnectionString = sql
db.Open()
Catch
ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Sub
bersih()
kode.Text = ""
nama_pengirm.Text = ""
alamat_pengirim.Text = ""
tanggal_kirim.Text = ""
rubahtombol(True,
False, False, False, True)
kode.Enabled = True
End Sub
Sub
rubahtombol(ByRef btn1 As
Boolean, ByVal
btn2 As Boolean,
ByVal btn3 As Boolean, ByVal btn4 As Boolean, ByVal btn5 As Boolean)
BR.Enabled = btn1
SMPN.Enabled = btn2
HPS.Enabled = btn3
BTL.Enabled = btn4
KLR.Enabled = btn5
End Sub
Sub
buattabel()
lv.Columns.Add("kode_pengirim",
80, HorizontalAlignment.Center)
lv.Columns.Add("nama_pengirim",
180, HorizontalAlignment.Left)
lv.Columns.Add("alamat_pengirim",
80, HorizontalAlignment.Left)
lv.Columns.Add("tanggal_kirim",
100, HorizontalAlignment.Left)
lv.GridLines = True
lv.FullRowSelect = True
lv.View = View.Details
End Sub
Sub isitabel()
lv.Items.Clear()
sql = "select*from
pengirim"
cmd = New
MySqlCommand(sql, db)
rs = cmd.ExecuteReader
Try
While
rs.Read
Dim
lst As New
ListViewItem
lst.Text = rs("kode_pengirim")
lst.SubItems.Add(rs("nama_pengirim"))
lst.SubItems.Add(rs("alamat_pengirim"))
lst.SubItems.Add(rs("tanggal_kirim"))
lv.Items.Add(lst)
End
While
Catch
ex As Exception
MsgBox(ex.Message)
End Try
rs.Close()
End Sub
Sub
prosesdb(ByVal log As
Integer)
Dim
pesan As String
= ""
Select Case log
Case
0
sql = "insert
into pengirim(kode_pengirim,nama_pengirim,alamat_pengirim,tanggal_kirim)"
& _
"values('"
& kode.Text & _
"','"
& nama_pengirm.Text & _
"','"
& alamat_pengirim.Text & _
"','"
& tanggal_kirim.Text & "')"
pesan = "data telah tersimpan"
Case
1
sql = "update
pengirim set nama_pengirim='" & nama_pengirm.Text & "', " & _
"alamat_pengirim='"
& alamat_pengirim.Text & "',"
& _
"tanggal_kirim='"
& tanggal_kirim.Text & "' "
& _
"where
kode_pengirim='" & kode.Text & "'"
pesan = "data telah terupdate"
Case
2
sql = "delete
from pengirim where kode_pengirim='" & kode.Text & "'"
pesan = "data telah dihapus"
End Select
Try
cmd = New
MySqlCommand(sql, db)
cmd.ExecuteNonQuery()
MsgBox(pesan,
MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "konfirmasi")
Call
bersih()
Call
isitabel()
Catch
ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Sub
showdb()
rs.Read()
kode.Text = rs("kode_pengirim")
nama_pengirm.Text = rs("nama_pengirim")
alamat_pengirim.Text = rs("alamat_pengirim")
tanggal_kirim.Text = rs("tanggal_kirim")
rubahtombol(False,
True, True, True, True)
SMPN.Text = "EDIT"
kode.Enabled = False
End Sub
Private Sub pengirim_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Call
opendb()
Call
bersih()
Call
buattabel()
Call
isitabel()
End Sub
Private Sub BR_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BR.Click
Call
bersih()
kode.Focus()
End Sub
Private Sub BTL_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTL.Click
Call
bersih()
kode.Focus()
End Sub
Private Sub KLR_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles KLR.Click
End
End Sub
Private Sub HPS_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles HPS.Click
Dim x As String
x = MsgBox("anda
yakin akan dihapus", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "hapus")
If x =
vbYes Then
Call
prosesdb(2)
End If
End Sub
Private Sub SMPN_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles SMPN.Click
If
SMPN.Text = "SIMPAN" Then prosesdb(0) Else
prosesdb(1)
End Sub
Private Sub kode_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
kode.KeyPress
Dim
tombol As Integer
= Asc(e.KeyChar)
If
tombol = 13 Then
Dim
x As String
If
kode.Text = "" Then
MsgBox("isi
kode terlebih dahulu")
Else
sql = "select
* from pengirim where kode_pengirim='" & kode.Text & "'"
cmd = New
MySqlCommand(sql, db)
rs = cmd.ExecuteReader
Try
Call
showdb()
Catch
ex As Exception
x = kode.Text
bersih()
kode.Text = x
rubahtombol(False, True, False, True, False)
SMPN.Text = "SIMPAN"
End
Try
nama_pengirm.Focus()
rs.Close()
End
If
End If
End Sub
End Class
DESIGN CETAK PENGIRIM
Tribute to John Lewis, Jr. with Tribute to John
BalasHapusTribute to John Lewis, Jr. blue titanium cerakote with Tribute to John Lewis, Jr. with Tribute to John Lewis, Jr. with Tribute titanium cross necklace to John titanium pot Lewis, titanium water bottle Jr. with titanium pots and pans Tribute to John Lewis, Jr. with Tribute