Anda di halaman 1dari 60

BIODATA PENULIS

KURNIAWAN. Lahir di Desa Katumbangan Lemo pada

tanggal 23 Maret 1996 dari pasangan suami istri Hakim dan St.

Arafah yang merupakan anak Ke tiga dari empat bersaudara.

Penulis memulai pendidikannya di sekolah dasar SDN 007

Sabang Subik pada tahun 2003 dan tamat pada tahun 2008.

Kemudian pada tahun yang sama, penulis melanjutkan pendidikannya pada sekolah

lanjutan tingkat menengah pertama di SMPN 2 Tinambung 2008 dan tamat pada

tahun 2011. Selanjutnya masuk disekolah SMA Negeri 1 Tinambung pada tahun

2011, dan tamat pada tahun 2014. kemudian pada tahun 2014, penulis melanjutkan

pendidikan diperguruan tinggi Akademi Manajemen Informatika Dan Komputer

(AMIK) Tomakaka majene, program pendidikan Diploma tiga (D-III). Saat masih

dalam perkuliahan pada Pada Tahun 2014. Dan menyandang Gelar Sarjana diploma

tiga (D-III) pada tahun 2018. Pada tahun 2018, penulis Melanjutkan Pendidikan ke

Strata satu (S1) di Universitas Tomakaka Mamuju Jurusan Sistem Informasi pada

Fakultas Ilmu Komputer. Kemudian pada tahun 2019 penulis menyelesaikan studinya

pada jurusan Sistem Informasi dan menyandang Gelar Sarjana Komputer (S.Kom).
BIODATA PENULIS

FATMAWATI. Lahir di Budong-Budong pada tanggal 08

Juli 1996 dari pasangan suami istri H. Nahrawi dan HJ.

Ratna Dewi yang merupakan anak kedua dari dua

bersaudara. Penulis memulai pendidikannya di sekolah

dasar SDN Batu Parigi Tobadak 4 pada tahun 2005 dan

tamat pada tahun 2010. Kemudian pada tahun yang sama,

penulis melanjutkan pendidikannya pada sekolah lanjutan tingkat menengah pertama

di SMPN 1 Tobadak 4 dan tamat pada tahun 2012. Selanjutnya masuk disekolah

SMK Keperawatan Mamuju pada tahun 2012, kemudian pindah di SMAN 1 Topoyo

pada tahun 2013 dan kemudian selesai pada tahun 2014. Setelah lulus Sekolah,

penulis melanjutkan pendidikan diperguruan tinggi Akademi Manajemen Informatika

Dan Komputer (AMIK) Tomakaka majene, program pendidikan Diploma tiga (D-

III). Saat masih dalam perkuliahan pada Tanggal 01 – 31 Juli 2014 penulis melakukan

kegiatan praktek Kerja Lapang (PKL) Pada Kantor BKDD Polewali Mandar,

selanjutnya pada Tanggal 01 – 31 Agustus 2015 kembali melakukan kegiatan Tugas

Proyek (TP) Pada Kantor Kejaksaan Negeri Majene dan penulis menyelesaikan

studinya pada jurusan Manajemen Informatika Dan Komputer. Dan menyandang

Gelar Sarjana diploma tiga (D-III) pada tahun 2018. Pada tahun 2018, penulis

Melanjutkan Pendidikan ke Strata satu (S1) di Universitas Tomakaka Mamuju


Jurusan Sistem Informasi pada Fakultas Ilmu Komputer. Kemudian pada tahun 2019

penulis menyelesaikan studinya pada jurusan Sistem Informasi dan menyandang

Gelar Sarjana Komputer (S.Kom).

FOTO KEGIATAN PENELITIAN

1. Observasi
2. Wawancara

3. Dokumentasi
FOTO UJI PROGRAM
LISTING LOGIN
Public Class LoginForm1
Dim username As String = "ADMIN"
Dim password As String = "123"
' TODO: Insert code to perform custom authentication using the provided
username and password
' (See http://go.microsoft.com/fwlink/?LinkId=35339).
' The custom principal can then be attached to the current thread's principal
as follows:
' My.User.CurrentPrincipal = CustomPrincipal
' where CustomPrincipal is the IPrincipal implementation used to perform
authentication.
' Subsequently, My.User will return identity information encapsulated in the
CustomPrincipal object
' such as the username, display name, etc.

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


System.EventArgs) Handles OK.Click
If UsernameTextBox.Text = username Then
If PasswordTextBox.Text = password Then
UTAMA.Show()
Me.Hide()
Else
MsgBox("password salah")
PasswordTextBox.Text = ""
PasswordTextBox.Focus()
End If
Else
MsgBox("Username salah")
UsernameTextBox.Text = ""
PasswordTextBox.Text = ""
UsernameTextBox.Focus()
End If
End Sub

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


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

LISTING MENU UTAMA


Public Class UTAMA
Dim Tulisan(0) As String
Dim i, j As Integer

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles


Timer1.Tick
Label8.Text = Format(Now, "dddd, dd MMMM yyyy")
Label7.Text = Format(Now, "HH:MM")
Label8.Parent = PictureBox1
Label8.BackColor = Color.Transparent
Label7.Parent = PictureBox1
Label7.BackColor = Color.Transparent
Label1.Parent = PictureBox1
Label1.BackColor = Color.Transparent
Label5.Parent = PictureBox1
Label5.BackColor = Color.Transparent
Label6.Parent = PictureBox1
Label6.BackColor = Color.Transparent
End Sub
Private Sub UTAMA_Load(sender As Object, e As EventArgs) Handles
Me.Load
'Me.Text = "APLIKASI PERIZINAN KECAMATAN TINAMBUNG"
Timer1.Enabled = True
Timer2.Enabled = True
'Timer3.Enabled = True
'Tulisan(0) = "APLIKASI PERIZINAN KECAMATAN TINAMBUNG"
'Label3.Text = Tulisan(j)
End Sub

Private Sub KELUARToolStripMenuItem_Click(sender As Object, e As


EventArgs) Handles KELUARToolStripMenuItem.Click
Dim jawaban As MsgBoxResult
jawaban = MsgBox("Program dimatikan ", MsgBoxStyle.YesNo,
"Program dimatikan ?")
If jawaban = MsgBoxResult.Yes Then
Application.Exit()
Else
MsgBox("Batal matikan program")
End If
End Sub

Private Sub
IZINUSAHAMIKRODANKECILIUMKToolStripMenuItem_Click(sender As
Object, e As EventArgs) Handles
IZINUSAHAMIKRODANKECILIUMKToolStripMenuItem.Click
TMPIUMK.Show()
TMPIUMK.Focus()
End Sub

Private Sub
IZINUSAHAPERDAGANGANSIUPToolStripMenuItem_Click(sender As
Object, e As EventArgs) Handles
IZINUSAHAPERDAGANGANSIUPToolStripMenuItem.Click
TMPSIUP.Show()
TMPSIUP.Focus()
End Sub

Private Sub
IZINTANDADAFTARPERUSAHAANTDPToolStripMenuItem_Click(sender As
Object, e As EventArgs) Handles
IZINTANDADAFTARPERUSAHAANTDPToolStripMenuItem.Click
TMPTDP.Show()
TMPTDP.Focus()
End Sub

Private Sub IZINGANGGUANHOToolStripMenuItem_Click(sender As


Object, e As EventArgs) Handles
IZINGANGGUANHOToolStripMenuItem.Click
TMPIG.Show()
TMPIG.Focus()
End Sub

Private Sub CETAKToolStripMenuItem_Click(sender As Object, e As


EventArgs) Handles CETAKToolStripMenuItem.Click
CETAKIUMK.Show()
CETAKIUMK.Focus()
End Sub

Private Sub VISIDANMISIToolStripMenuItem_Click(sender As Object, e As


EventArgs) Handles VISIDANMISIToolStripMenuItem.Click
VISIMISI.Show()
VISIMISI.Focus()
End Sub

Private Sub MOTTOToolStripMenuItem_Click(sender As Object, e As


EventArgs) Handles MOTTOToolStripMenuItem.Click
MOTTO.Show()
MOTTO.Focus()
End Sub

Private Sub DASARHUKUMToolStripMenuItem_Click(sender As Object, e


As EventArgs) Handles DASARHUKUMToolStripMenuItem.Click
DasarHukum2.Show()
DasarHukum2.Focus()
End Sub

Private Sub
SURATIZINUSAHAPERDAGANGANToolStripMenuItem_Click(sender As
Object, e As EventArgs) Handles
SURATIZINUSAHAPERDAGANGANToolStripMenuItem.Click
SyaratSIUP.Show()
SyaratSIUP.Focus()
End Sub

Private Sub
SURATIZINTANDADAFTARPERUSAHAANTDPToolStripMenuItem_Click(sen
der As Object, e As EventArgs) Handles
SURATIZINTANDADAFTARPERUSAHAANTDPToolStripMenuItem.Click
SyaratTDP.Show()
SyaratTDP.Focus()
End Sub

Private Sub SURATIZINGANGGUANHOToolStripMenuItem_Click(sender


As Object, e As EventArgs) Handles
SURATIZINGANGGUANHOToolStripMenuItem.Click
SyaratHO.Show()
SyaratHO.Focus()
End Sub

Private Sub
IZINUSAHAMIKRODANKECILIUMKToolStripMenuItem1_Click(sender As
Object, e As EventArgs) Handles
IZINUSAHAMIKRODANKECILIUMKToolStripMenuItem1.Click
SyaratIUMK.Show()
SyaratIUMK.Focus()
End Sub

Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles


PictureBox1.Click
End Sub

End Class

LISTING DATA IZIN USAHA MIKRO DAN KECIL


Imports System.Data.OleDb

Public Class Form1


Public NO_PENDAFTAR As String = ""
Public MODE As Integer = 1

Sub kosong()
T2.Clear()
T3.Clear()
T4.Clear()
T5.Clear()
T6.Clear()
T7.Clear()
T10.Clear()
T11.Clear()
If MODE = 2 Then
T1.ReadOnly = True
T1.Text = NO_PENDAFTAR
End If
End Sub

Sub isi_data()
Call kosong()
If rd.HasRows Then
TTgl.Text = rd.Item("TANGGAL")
T1.Text = rd.Item("NO_PENDAFTAR")
T2.Text = rd.Item("NO_KTP")
T3.Text = rd.Item("NAMA")
T4.Text = rd.Item("ALAMAT")
T5.Text = rd.Item("NO_TELP")
T6.Text = rd.Item("NAMA_PERUSAHAAN")
TCOMBO.Text = rd.Item("BENTUK_PERUSAHAAN")
T7.Text = rd.Item("NPWP")
T8.Text = rd.Item("KEGIATAN_USAHA")
T9.Text = rd.Item("SARANA_USAHA")
T10.Text = rd.Item("ALAMAT_USAHA")
T11.Text = rd.Item("JUMLAH_MODAL_USAHA")

BSIMPAN.Visible = False
BEDIT.Visible = True
End If
End Sub

Sub cari_data()
Try
cmd = New OleDb.OleDbCommand("SELECT * FROM IDPEMOHON
WHERE NO_PENDAFTAR = '" & NO_PENDAFTAR & "'", conn)
rd = cmd.ExecuteReader
rd.Read()
Catch
MsgBox("Tidak dapat menghubungkan ke database",
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub input_data()
Dim sql As String

Call cari_data()
If MODE = 1 And rd.HasRows Or MODE = 2 Then
sql = " UPDATE IDPEMOHON set " & _
" TANGGAL='" & TTgl.Text & "'," & _
" NO_KTP='" & T2.Text & "'," & _
" NAMA='" & T3.Text & "'," & _
" ALAMAT='" & T4.Text & "'," & _
" NO_TELP='" & T5.Text & "'," & _
" NAMA_PERUSAHAAN='" & T6.Text & "'," & _
" BENTUK_PERUSAHAAN='" & TCOMBO.Text & "'," & _
" NPWP='" & T7.Text & "'," & _
" KEGIATAN_USAHA='" & T8.Text & "'," & _
" SARANA_USAHA='" & T9.Text & "'," & _
" ALAMAT_USAHA='" & T10.Text & "'," & _
" JUMLAH_MODAL_USAHA='" & T11.Text & "' WHERE
NO_PENDAFTAR ='" & T1.Text & "'"

Else
sql = "INSERT INTO IDPMOHON (TANGGAL,
NO_PENDAFTAR,NO_KTP,NAMA,ALAMAT,NO_TELEPON,NAMA_PERUSA
HAAN.BENTUK_PERUSAHAAN,NPWP,KEGIATAN_USAHA,SARANA_USA
HA,ALAMAT_USAHA.JUMLAH_MODAL_USAHA) VALUES ('" _
& TTgl.Text & "','" _
& T1.Text & "','" _
& T2.Text & "','" _
& T3.Text & "','" _
& T4.Text & "','" _
& T5.Text & "','" _
& T6.Text & "','" _
& TCOMBO.Text & "','" _
& T7.Text & "','" _
& T8.Text & "','" _
& T9.Text & "','" _
& T10.Text & "','" _
& T11.Text & "')"
End If

Try
cmd = New OleDb.OleDbCommand(sql, conn)
cmd.ExecuteNonQuery()
Dim pesan = MsgBox("Data tersimpan, apakah Anda ingin keluar dari
form ini?", MsgBoxStyle.YesNo, "Informasi")
If Not pesan = MsgBoxResult.Yes Then
NO_PENDAFTAR = ""
MODE = 1
Call kosong()
T1.Text = ""
T1.Focus()
Else
Me.Close()
End If
Catch
MsgBox("Tidak dapat menyimpan data" & ErrorToString(),
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub Kosongkan()
TTgl.Text = ""
T1.Text = ""
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
TCOMBO.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T1.Focus()
End Sub

Sub DataBaru()
TTgl.Text = ""
T1.Text = ""
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
TCOMBO.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T1.Focus()
End Sub

Sub Tampilkan()
da = New OleDbDataAdapter("Select * from IDPEMOHON ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "IDPEMOHON")
DGV.DataSource = (ds.Tables("IDPEMOHON"))
DGV.ReadOnly = True
End Sub

Private Sub Baca()


da = New OleDbDataAdapter("Select * from IDPEMOHON ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "IDPEMOHON")
DGV.DataSource = (ds.Tables("IDPEMOHON"))
DGV.ReadOnly = True
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles


Me.Load
Call kosong()
Call Kosongkan()
Call cari_data()
Call isi_data()
Call Koneksidata()
Call Tampilkan()

If BSIMPAN.Visible = True Then


BEDIT.Visible = False
Else
BSIMPAN.Visible = False
BEDIT.Visible = True
End If
'Call Awal()
DGV.Columns(0).Width = 80
DGV.Columns(1).Width = 200
DGV.Columns(2).Width = 80
DGV.Columns(3).Width = 80
DGV.AlternatingRowsDefaultCellStyle.BackColor = Color.Silver
End Sub

Private Sub BSIMPAN_Click(sender As Object, e As EventArgs) Handles


BSIMPAN.Click
Dim tgl1 As Date = TTgl.Text

tgl1 = tgl1.ToShortDateString

If TTgl.Text = "" Or T1.Text = "" Or T2.Text = "" Or T3.Text = "" Or T4.Text


= "" Or T5.Text = "" Or T6.Text = "" Or TCOMBO.Text = "" Or T7.Text = "" Or
T8.Text = "" Or T9.Text = "" Or T10.Text = "" Or T11.Text = "" Then
MsgBox("Data Belum Lengkap..!", vbCritical, "Salah")
Exit Sub
Else
Call Koneksidata()
Dim simpan As String = "INSERT INTO IDPEMOHON Values ('" & tgl1
& "','" & T1.Text & "','" & T2.Text & "','" & T3.Text & "','" & T4.Text & "','" &
T5.Text & "','" & T6.Text & "','" & TCOMBO.Text & "','" & T7.Text & "','" &
T8.Text & "','" & T9.Text & "','" & T10.Text & "','" & T11.Text & "')"
cmd = New OleDbCommand(simpan, conn)
cmd.ExecuteNonQuery()
MsgBox("Data anda tersimpan...!!!", MsgBoxStyle.Information,
"INFORMASI")
Call Kosongkan()
Call Tampilkan()
End If
End Sub

Private Sub BBATAL_Click(sender As Object, e As EventArgs) Handles


BBATAL.Click
Call Kosongkan()
BSIMPAN.Visible = True
BEDIT.Visible = False
End Sub

Private Sub BEDIT_Click(sender As Object, e As EventArgs) Handles


BEDIT.Click
Dim update As String
Dim tgl1 As Date = TTgl.Text

tgl1 = tgl1.ToShortDateString

update = " UPDATE IDPEMOHON set " & _


" TANGGAL='" & TTgl.Text & "'," & _
" NO_KTP='" & T2.Text & "'," & _
" NAMA='" & T3.Text & "'," & _
" ALAMAT='" & T4.Text & "'," & _
" NO_TELP='" & T5.Text & "'," & _
" NAMA_PERUSAHAAN='" & T6.Text & "'," & _
" BENTUK_PERUSAHAAN='" & TCOMBO.Text & "'," & _
" NPWP='" & T7.Text & "'," & _
" KEGIATAN_USAHA='" & T8.Text & "'," & _
" SARANA_USAHA='" & T9.Text & "'," & _
" ALAMAT_USAHA='" & T10.Text & "'," & _
" JUMLAH_MODAL_USAHA='" & T11.Text & "' WHERE
NO_PENDAFTAR ='" & T1.Text & "'"
cmd = New OleDbCommand(update, conn)
cmd.ExecuteNonQuery()
MsgBox("Data berhasil di update...!!!", MsgBoxStyle.Information,
"INFORMASI")
T1.Enabled = True
Call Baca()
Call Kosongkan()

BSIMPAN.Visible = True
BEDIT.Visible = False
End Sub

Private Sub BTAMPIL_Click(sender As Object, e As EventArgs) Handles


BTAMPIL.Click
TMPIUMK.Show()
Me.Close()
End Sub

Private Sub BKELUAR_Click(sender As Object, e As EventArgs)


Me.Close()
End Sub

Private Sub T1_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T1.KeyPress
If Not ((e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar =
vbBack)) Then e.Handled = True

If Asc(e.KeyChar) = 13 Then
T2.Focus()
cmd = New OleDbCommand("Select * from IDPEMOHON where
NO_PENDAFTAR ='" & T1.Text & "'", conn)
rd = cmd.ExecuteReader
If rd.Read = True Then
MsgBox("Data sudah ada ...!!!", MsgBoxStyle.Information, "Pesan")
Me.T1.Clear()
Me.T1.Focus()
End If
End If
End Sub
Private Sub T2_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles T2.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T3_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T3.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T4_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T4.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T5_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T5.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T6_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T6.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub TCOMBO_KeyPress(sender As Object, e As


KeyPressEventArgs) Handles TCOMBO.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T7_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T7.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub DGV_CellMouseClick(sender As Object, e As


DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick
On Error Resume Next
TTgl.Text = DGV.Rows(e.RowIndex).Cells(0).Value
T1.Text = DGV.Rows(e.RowIndex).Cells(1).Value
T2.Text = DGV.Rows(e.RowIndex).Cells(2).Value
T3.Text = DGV.Rows(e.RowIndex).Cells(3).Value
T4.Text = DGV.Rows(e.RowIndex).Cells(4).Value
T5.Text = DGV.Rows(e.RowIndex).Cells(5).Value
T6.Text = DGV.Rows(e.RowIndex).Cells(6).Value
TCOMBO.Text = DGV.Rows(e.RowIndex).Cells(7).Value
T7.Text = DGV.Rows(e.RowIndex).Cells(8).Value
T8.Text = DGV.Rows(e.RowIndex).Cells(9).Value
T9.Text = DGV.Rows(e.RowIndex).Cells(10).Value
T10.Text = DGV.Rows(e.RowIndex).Cells(11).Value
T11.Text = DGV.Rows(e.RowIndex).Cells(12).Value
End Sub

Private Sub T8_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T8.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T9_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T9.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T10_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T10.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T11_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T11.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T1_KeyUp(sender As Object, e As KeyEventArgs) Handles


T1.KeyUp
NO_PENDAFTAR = T1.Text
Call cari_data()
Call isi_data()
End Sub
End Class

LISTING DATA SURAT IZIN USAHA PERDAGANGAN (SIUP Kecil)


Imports System.Data.OleDb

Public Class Form2


Public NO_PENDAFTAR As String = ""
Public MODE As Integer = 1

Sub kosong()
T4.Clear()
T6.Clear()
T7.Clear()
T8.Clear()
T9.Clear()
T10.Clear()
T12.Clear()
T13.Clear()
T15.Clear()
T16.Clear()
T17.Clear()
T18.Clear()
If MODE = 2 Then
T1.ReadOnly = True
T1.Text = NO_PENDAFTAR
End If
End Sub

Sub isi_data()
Call kosong()
If rd.HasRows Then
T1.Text = rd.Item("NOMOR")
T2.Text = rd.Item("TANGGAL_KELUAR")
T3.Text = rd.Item("TANGGAL_BERLAKU")
T4.Text = rd.Item("NAMA_PERUSAHAAN")
T5.Text = rd.Item("MEREK")
T6.Text = rd.Item("ALAMAT_PERUSAHAAN")
T7.Text = rd.Item("NAMA_PEMILIK")
T8.Text = rd.Item("ALAMAT_PEMILIK")
T9.Text = rd.Item("NPWP")
T10.Text = rd.Item("MODAL_INVESTASI")
T11.Text = rd.Item("KEGIATAN_USAHA")
T12.Text = rd.Item("KELEMBAGAAN")
T13.Text = rd.Item("BIDANG_USAHA")
T14.Text = rd.Item("JENIS_BARANG")
T15.Text = rd.Item("BIAYA")
T16.Text = rd.Item("BARU")
T17.Text = rd.Item("PERPANJANGAN")
T18.Text = rd.Item("PENGGANTIAN")
BSIMPAN.Visible = False
BEDIT.Visible = True
End If
End Sub

Sub cari_data()
Try
cmd = New OleDb.OleDbCommand("SELECT * FROM SIUP WHERE
NOMOR = '" & NO_PENDAFTAR & "'", conn)
rd = cmd.ExecuteReader
rd.Read()
Catch
MsgBox("Tidak dapat menghubungkan ke database",
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub input_data()
Dim sql As String

Call cari_data()
If MODE = 1 And rd.HasRows Or MODE = 2 Then
sql = " UPDATE SIUP set " & _
" TANGGAL_KELUAR='" & T2.Text & "'," & _
" TANGGAL_BERLAKU='" & T3.Text & "'," & _
" NAMA_PERUSAHAAN='" & T4.Text & "'," & _
" MEREK='" & T5.Text & "'," & _
" ALAMAT_PERUSAHAAN='" & T6.Text & "'," & _
" NAMA_PEMILIK='" & T7.Text & "'," & _
" ALAMAT_PEMILIK='" & T8.Text & "'," & _
" NPWP='" & T9.Text & "'," & _
" MODAL_INVESTASI='" & T10.Text & "'," & _
" KEGIATAN_USAHA='" & T11.Text & "'," & _
" KELEMBAGAAN='" & T12.Text & "'," & _
" BIDANG_USAHA='" & T13.Text & "'," & _
" JENIS_BARANG='" & T14.Text & "'," & _
" BIAYA='" & T15.Text & "'," & _
"BARU='" & T16.Text & "'," & _
" PERPANJANGAN='" & T17.Text & "'," & _
" PENGGANTIAN='" & T18.Text & "' WHERE NOMOR='" & T1.Text &
"'"
Else
sql = "INSERT INTO IDPMOHON
(NOMOR,TANGGAL_KELUAR,TANGGAL_BERLAKU,NAMA_PERUSAHAA
N,MEREK,ALAMAT_PERUSAHAAN,NAMA_PEMILIK,ALAMAT_PEMILIK,NP
WP,MODAL_INVESTASI,KEGIATAN_USAHA,KELEMBAGAAN,BIDANG_US
AHA,JENIS_BARANG,BIAYA,BARU,PERPANJANGAN,PENGGANTIAN)
VALUES ('" _
& T1.Text & "','" _
& T2.Text & "','" _
& T3.Text & "','" _
& T4.Text & "','" _
& T5.Text & "','" _
& T6.Text & "','" _
& T7.Text & "','" _
& T8.Text & "','" _
& T9.Text & "','" _
& T10.Text & "','" _
& T11.Text & "','" _
& T12.Text & "','" _
& T13.Text & "','" _
& T14.Text & "','" _
& T15.Text & "','" _
& T16.Text & "','" _
& T17.Text & "','" _
& T18.Text & "')"
End If

Try
cmd = New OleDb.OleDbCommand(sql, conn)
cmd.ExecuteNonQuery()
Dim pesan = MsgBox("Data tersimpan, apakah Anda ingin keluar dari
form ini?", MsgBoxStyle.YesNo, "Informasi")
If Not pesan = MsgBoxResult.Yes Then
NO_PENDAFTAR = ""
MODE = 1
Call kosong()
T1.Text = ""
T1.Focus()
Else
Me.Close()
End If
Catch
MsgBox("Tidak dapat menyimpan data" & ErrorToString(),
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub Kosongkan()
T1.Text = ""
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T12.Text = ""
T13.Text = ""
T14.Text = ""
T15.Text = ""
T16.Text = ""
T17.Text = ""
T18.Text = ""
T1.Focus()
End Sub

Sub DataBaru()
T1.Text = ""
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T12.Text = ""
T13.Text = ""
T14.Text = ""
T15.Text = ""
T16.Text = ""
T17.Text = ""
T18.Text = ""
T2.Focus()
End Sub

Sub Tampilkan()
da = New OleDbDataAdapter("Select * from SIUP ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "SIUP")
DGV.DataSource = (ds.Tables("SIUP"))
DGV.ReadOnly = True
End Sub

Private Sub Baca()


da = New OleDbDataAdapter("Select * from SIUP", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "SIUP")
DGV.DataSource = (ds.Tables("SIUP"))
DGV.ReadOnly = True
End Sub

Private Sub BSIMPAN_Click(sender As Object, e As EventArgs)


Dim tgl1 As Date = T2.Text
Dim tgl2 As Date = T3.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T10.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
T15.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

If T1.Text = "" Or T2.Text = "" Or T3.Text = "" Or T4.Text = "" Or T5.Text =


"" Or T6.Text = "" Or T7.Text = "" Or T8.Text = "" Or T9.Text = "" Or T10.Text =
"" Or T11.Text = "" Or T12.Text = "" Or T13.Text = "" Or T14.Text = "" Or
T15.Text = "" Or T16.Text = "" Or T17.Text = "" Or T18.Text = "" Then
MsgBox("Data belum lengkap, pastikan semua form terisi..!")
Exit Sub
Else
Call Koneksidata()
Dim simpan As String = "INSERT INTO SIUP Values ('" & T1.Text &
"','" & tgl1 & "','" & tgl2 & "','" & T4.Text & "','" & T5.Text & "','" & T6.Text & "','" &
T7.Text & "','" & T8.Text & "','" & T9.Text & "','" & T10.Text & "','" & T11.Text &
"','" & T12.Text & "','" & T13.Text & "','" & T14.Text & "','" & T15.Text & "','" &
T16.Text & "','" & T17.Text & "','" & T18.Text & "')"
cmd = New OleDbCommand(simpan, conn)
cmd.ExecuteNonQuery()
MsgBox("Data anda tersimpan...!!!", MsgBoxStyle.Information,
"INFORMASI")
Call Kosongkan()
Call Tampilkan()
End If
End Sub

Private Sub BEDIT_Click(sender As Object, e As EventArgs)


Dim update As String
Dim tgl1 As Date = T2.Text
Dim tgl2 As Date = T3.Text
tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T15.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
T10.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
update = " UPDATE SIUP set " & _
" TANGGAL_KELUAR='" & tgl1 & "'," & _
" TANGGAL_BERLAKU='" & tgl2 & "'," & _
" NAMA_PERUSAHAAN='" & T4.Text & "'," & _
" MEREK='" & T5.Text & "'," & _
" ALAMAT_PERUSAHAAN='" & T6.Text & "'," & _
" NAMA_PEMILIK='" & T7.Text & "'," & _
" ALAMAT_PEMILIK='" & T8.Text & "'," & _
" NPWP='" & T9.Text & "'," & _
" MODAL_INVESTASI='" & T10.Text & "'," & _
" KEGIATAN_USAHA='" & T11.Text & "'," & _
" KELEMBAGAAN='" & T12.Text & "'," & _
" BIDANG_USAHA='" & T13.Text & "'," & _
" JENIS_BARANG='" & T14.Text & "'," & _
" BIAYA='" & T15.Text & "'," & _
" BARU='" & T16.Text & "'," & _
" PERPANJANGAN='" & T17.Text & "'," & _
" PENGGANTIAN ='" & T18.Text & "' WHERE NOMOR ='" & T1.Text &
"'"
cmd = New OleDbCommand(update, conn)
cmd.ExecuteNonQuery()
MsgBox("Data berhasil di update...!!!", MsgBoxStyle.Information,
"INFORMASI")
T1.Enabled = True
Call Baca()
Call Kosongkan()
End Sub

Private Sub Form2_Load(sender As Object, e As EventArgs) Handles


Me.Load
Call kosong()
Call Kosongkan()
Call cari_data()
Call isi_data()
Call Koneksidata()
Call Tampilkan()

If BSIMPAN.Visible = True Then


BEDIT.Visible = False
Else
BSIMPAN.Visible = False
BEDIT.Visible = True
End If

DGV.Columns(0).Width = 80
DGV.Columns(1).Width = 200
DGV.Columns(2).Width = 80
DGV.Columns(3).Width = 80
DGV.AlternatingRowsDefaultCellStyle.BackColor = Color.Silver

End Sub

Private Sub T1_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T1.KeyPress
If Not ((e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar =
vbBack)) Then e.Handled = True

End Sub

Private Sub T4_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T4.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T5_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T5.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T6_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T6.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-,0-9]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T7_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T7.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T8_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T8.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-,0-9]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T12_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T12.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub
Private Sub T13_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles T13.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T16_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T16.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T17_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T17.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T18_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T18.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub DGV_CellMouseClick(sender As Object, e As


DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick
On Error Resume Next
T1.Text = DGV.Rows(e.RowIndex).Cells(0).Value
T2.Text = DGV.Rows(e.RowIndex).Cells(1).Value
T3.Text = DGV.Rows(e.RowIndex).Cells(2).Value
T4.Text = DGV.Rows(e.RowIndex).Cells(3).Value
T5.Text = DGV.Rows(e.RowIndex).Cells(4).Value
T6.Text = DGV.Rows(e.RowIndex).Cells(5).Value
T7.Text = DGV.Rows(e.RowIndex).Cells(6).Value
T8.Text = DGV.Rows(e.RowIndex).Cells(7).Value
T9.Text = DGV.Rows(e.RowIndex).Cells(8).Value
T10.Text = DGV.Rows(e.RowIndex).Cells(9).Value
T11.Text = DGV.Rows(e.RowIndex).Cells(10).Value
T12.Text = DGV.Rows(e.RowIndex).Cells(11).Value
T13.Text = DGV.Rows(e.RowIndex).Cells(12).Value
T14.Text = DGV.Rows(e.RowIndex).Cells(13).Value
T15.Text = DGV.Rows(e.RowIndex).Cells(14).Value
T16.Text = DGV.Rows(e.RowIndex).Cells(15).Value
T17.Text = DGV.Rows(e.RowIndex).Cells(16).Value
T18.Text = DGV.Rows(e.RowIndex).Cells(17).Value
End Sub

Private Sub T11_KeyPress1(sender As Object, e As KeyPressEventArgs)


Handles T11.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T14_KeyPress1(sender As Object, e As KeyPressEventArgs)


Handles T14.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T9_KeyPress1(sender As Object, e As KeyPressEventArgs)


Handles T9.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T10_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T10.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9,-]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub BTAMPIL_Click_1(sender As Object, e As EventArgs) Handles


BTAMPIL.Click
TMPSIUP.Show()
Me.Close()
End Sub

Private Sub BBATAL_Click1(sender As Object, e As EventArgs) Handles


BBATAL.Click
Call Kosongkan()
BSIMPAN.Visible = True
BEDIT.Visible = False
End Sub

Private Sub T1_KeyUp(sender As Object, e As KeyEventArgs) Handles


T1.KeyUp
If Asc(e.KeyCode) = 13 Then
T4.Focus()
cmd = New OleDbCommand("Select * from SIUP where NOMOR ='"
& T1.Text & "'", conn)
rd = cmd.ExecuteReader
If rd.Read = True Then
MsgBox("Data sudah ada ...!!!", MsgBoxStyle.Information, "Pesan")
Me.T1.Clear()
Me.T1.Focus()
End If
End If
NO_PENDAFTAR = T1.Text
Call cari_data()
Call isi_data()
End Sub

Private Sub BSIMPAN_Click_1(sender As Object, e As EventArgs)


Handles BSIMPAN.Click

Dim tgl1 As Date = T2.Text


Dim tgl2 As Date = T3.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T10.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
T15.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

If T1.Text = "" Or T2.Text = "" Or T3.Text = "" Or T4.Text = "" Or T5.Text =


"" Or T6.Text = "" Or T7.Text = "" Or T8.Text = "" Or T9.Text = "" Or T10.Text =
"" Or T11.Text = "" Or T12.Text = "" Or T13.Text = "" Or T14.Text = "" Or
T15.Text = "" Or T16.Text = "" Or T17.Text = "" Or T18.Text = "" Then
MsgBox("Data belum lengkap, pastikan semua form terisi..!")
Exit Sub
Else
Call Koneksidata()
Dim simpan As String = "INSERT INTO SIUP Values ('" & T1.Text &
"','" & tgl1 & "','" & tgl2 & "','" & T4.Text & "','" & T5.Text & "','" & T6.Text & "','" &
T7.Text & "','" & T8.Text & "','" & T9.Text & "','" & T10.Text & "','" & T11.Text &
"','" & T12.Text & "','" & T13.Text & "','" & T14.Text & "','" & T15.Text & "','" &
T16.Text & "','" & T17.Text & "','" & T18.Text & "')"
cmd = New OleDbCommand(simpan, conn)
cmd.ExecuteNonQuery()
MsgBox("Data anda tersimpan...!!!", MsgBoxStyle.Information,
"INFORMASI")
Call Kosongkan()
Call Tampilkan()
End If

TMPSIUP.Show()
Me.Close()
End Sub

Private Sub BEDIT_Click1(sender As Object, e As EventArgs) Handles


BEDIT.Click
Dim update As String
Dim tgl1 As Date = T2.Text
Dim tgl2 As Date = T3.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T15.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
T10.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
update = " UPDATE SIUP set " & _
" TANGGAL_KELUAR='" & tgl1 & "'," & _
" TANGGAL_BERLAKU='" & tgl2 & "'," & _
" NAMA_PERUSAHAAN='" & T4.Text & "'," & _
" MEREK='" & T5.Text & "'," & _
" ALAMAT_PERUSAHAAN='" & T6.Text & "'," & _
" NAMA_PEMILIK='" & T7.Text & "'," & _
" ALAMAT_PEMILIK='" & T8.Text & "'," & _
" NPWP='" & T9.Text & "'," & _
" MODAL_INVESTASI='" & T10.Text & "'," & _
" KEGIATAN_USAHA='" & T11.Text & "'," & _
" KELEMBAGAAN='" & T12.Text & "'," & _
" BIDANG_USAHA='" & T13.Text & "'," & _
" JENIS_BARANG='" & T14.Text & "'," & _
" BIAYA='" & T15.Text & "'," & _
" BARU='" & T16.Text & "'," & _
" PERPANJANGAN='" & T17.Text & "'," & _
" PENGGANTIAN ='" & T18.Text & "' WHERE NOMOR ='" & T1.Text &
"'"
cmd = New OleDbCommand(update, conn)
cmd.ExecuteNonQuery()
MsgBox("Data berhasil di update...!!!", MsgBoxStyle.Information,
"INFORMASI")
T1.Enabled = True
Call Baca()
Call Kosongkan()
End Sub

Private Sub T1_TextChanged(sender As Object, e As EventArgs) Handles


T1.TextChanged
End Sub
End Class

LISTING DATA TANDA DAFTAR PERUSAHAAN (TDP)


Imports System.Data.OleDb

Public Class Form3


Public NO_PENDAFTAR As String = ""
Public MODE As Integer = 1

Sub kosong()
T3.Text = ""
T2.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T12.Text = ""
T13.Text = ""
If MODE = 2 Then
T1.ReadOnly = True
T1.Text = NO_PENDAFTAR
End If
End Sub

Sub isi_data()
Call kosong()
If rd.HasRows Then
T1.Text = rd.Item("NOMOR")
T3.Text = rd.Item("TANGGAL_KELUAR")
T2.Text = rd.Item("TANGGAL_BERLAKU")
T4.Text = rd.Item("NAMA_PERUSAHAAN")
T5.Text = rd.Item("STATUS")
T6.Text = rd.Item("ALAMAT_PERUSAHAAN")
T7.Text = rd.Item("NO_TELP")
T8.Text = rd.Item("NAMA_PEMILIK")
T9.Text = rd.Item("ALAMAT_PEMILIK")
T10.Text = rd.Item("KEGIATAN_USAHA")
T11.Text = rd.Item("KBLI")
T12.Text = rd.Item("KETERANGAN")
T13.Text = rd.Item("BIAYA")
BSIMPAN.Visible = False
BEDIT.Visible = True
End If
End Sub

Sub panggil_siup()
conn.Close()
Call Koneksidata()
T3.Text = ""
T2.Text = ""
T4.Text = ""
T6.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T12.Text = ""
Try
cmd = New OleDb.OleDbCommand("SELECT * FROM SIUP WHERE
NOMOR = '" & NO_PENDAFTAR & "'", conn)
rd = cmd.ExecuteReader
rd.Read()
If rd.HasRows Then
T3.Text = rd.Item("TANGGAL_KELUAR")
T2.Text = rd.Item("TANGGAL_BERLAKU")
T4.Text = rd.Item("NAMA_PERUSAHAAN")
T6.Text = rd.Item("ALAMAT_PERUSAHAAN")
T8.Text = rd.Item("NAMA_PEMILIK")
T9.Text = rd.Item("ALAMAT_PEMILIK")
T10.Text = rd.Item("KEGIATAN_USAHA")
T11.Text = rd.Item("BIDANG_USAHA")
If rd.Item("BARU") <> "-" Then
T12.Text = "BARU"
ElseIf rd.Item("PERPANJANGAN") <> "-" Then
T12.Text = "PERPANJANGAN"
Else
T12.Text = "PENGGANTIAN"
End If
End If
Catch
MsgBox("Tidak dapat menghubungkan ke database",
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub cari_data()
Try
cmd = New OleDb.OleDbCommand("SELECT * FROM TDP WHERE
NOMOR = '" & NO_PENDAFTAR & "'", conn)
rd = cmd.ExecuteReader
rd.Read()
Catch
MsgBox("Tidak dapat menghubungkan ke database",
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub input_data()
Dim sql As String

Call cari_data()
If MODE = 1 And rd.HasRows Or MODE = 2 Then
sql = " UPDATE TDP set " & _
" TANGGAL_KELUAR='" & T3.Text & "'," & _
" TANGGAL_BERLAKU='" & T2.Text & "'," & _
" NAMA_PERUSAHAAN='" & T4.Text & "'," & _
" STATUS='" & T5.Text & "'," & _
" ALAMAT_PERUSAHAAN='" & T6.Text & "'," & _
" NO_TELP='" & T7.Text & "'," & _
" NAMA_PEMILIK='" & T8.Text & "'," & _
" ALAMAT_PEMILIK='" & T9.Text & "'," & _
" KEGIATAN_USAHA='" & T10.Text & "'," & _
" KBLI='" & T11.Text & "'," & _
" KETERANGAN='" & T12.Text & "'," & _
" BIAYA='" & T13.Text & "' WHERE NOMOR='" & T1.Text & "'"

Else
sql = "INSERT INTO
TDP(NOMOR,TANGGAL_KELUAR,TANGGAL_BERLAKU,NAMA_PERUSA
HAAN,STATUS,ALAMAT_PERUSAHAAN,NO_TELP,NAMA_PEMILIK,ALAM
AT_PEMILIK,KEGIATAN_USAHA,KBLI,KETERANGAN,BIAYA) VALUES ('" _
& T1.Text & "','" _
& T3.Text & "','" _
& T2.Text & "','" _
& T4.Text & "','" _
& T5.Text & "','" _
& T6.Text & "','" _
& T7.Text & "','" _
& T8.Text & "','" _
& T9.Text & "','" _
& T10.Text & "','" _
& T11.Text & "','" _
& T12.Text & "','" _
& T13.Text & "')"
End If

Try
cmd = New OleDb.OleDbCommand(sql, conn)
cmd.ExecuteNonQuery()
Dim pesan = MsgBox("Data tersimpan, apakah Anda ingin keluar dari
form ini?", MsgBoxStyle.YesNo, "Informasi")
If Not pesan = MsgBoxResult.Yes Then
NO_PENDAFTAR = ""
MODE = 1
Call kosong()
T1.Text = ""
T1.Focus()
Else
Me.Close()
End If
Catch
MsgBox("Tidak dapat menyimpan data" & ErrorToString(),
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub Kosongkan()
T1.Text = ""
T3.Text = ""
T2.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T12.Text = ""
T13.Text = ""
T1.Focus()
End Sub

Sub DataBaru()
T1.Text = ""
T3.Text = ""
T2.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
T12.Text = ""
T13.Text = ""
T1.Focus()
End Sub
Sub Tampilkan()
da = New OleDbDataAdapter("Select * from TDP", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "TDP")
DGV.DataSource = (ds.Tables("TDP"))
DGV.ReadOnly = True
End Sub

Private Sub Baca()


da = New OleDbDataAdapter("Select * from TDP", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "TDP")
DGV.DataSource = (ds.Tables("TDP"))
DGV.ReadOnly = True
End Sub

Private Sub Form3_Load(sender As Object, e As EventArgs) Handles


Me.Load
Call kosong()
Call Kosongkan()
Call cari_data()
Call isi_data()
Call Koneksidata()
Call Tampilkan()

If BSIMPAN.Visible = True Then


BEDIT.Visible = False
Else
BSIMPAN.Visible = False
BEDIT.Visible = True
End If

DGV.Columns(0).Width = 80
DGV.Columns(1).Width = 200
DGV.Columns(2).Width = 80
DGV.Columns(3).Width = 80
DGV.AlternatingRowsDefaultCellStyle.BackColor = Color.Silver
End Sub
Private Sub T1_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles T1.KeyPress
If Not ((e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar =
vbBack)) Then e.Handled = True
End Sub

Private Sub T4_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T4.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T5_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T5.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub BBATAL_Click(sender As Object, e As EventArgs)


Call Kosongkan()
End Sub

Private Sub T6_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T6.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T7_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T7.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9]" OrElse KeyAscii = Keys.Back OrElse KeyAscii
= Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T8_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T8.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T9_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T9.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T12_KeyPress(sender As Object, e As KeyPressEventArgs)


Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T10_KeyPress1(sender As Object, e As KeyPressEventArgs)


Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub
Private Sub BSIMPAN_Click(sender As Object, e As EventArgs) Handles
BSIMPAN.Click
Dim tgl1 As Date = T3.Text
Dim tgl2 As Date = T2.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T13.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

If T1.Text = "" Or T3.Text = "" Or T2.Text = "" Or T4.Text = "" Or T5.Text =


"" Or T6.Text = "" Or T7.Text = "" Or T8.Text = "" Or T9.Text = "" Or T10.Text =
"" Or T1.Text = "" Or T12.Text = "" Or T13.Text = "" Then
MsgBox("Data belum lengkap, pastikan semua form terisi..!")
Exit Sub

Else
Call Koneksidata()
Dim simpan As String = "INSERT INTO TDP Values ('" & T1.Text & "','"
& T3.Text & "','" & T2.Text & "','" & T4.Text & "','" & T5.Text & "','" & T6.Text &
"','" & T7.Text & "','" & T8.Text & "','" & T9.Text & "','" & T10.Text & "','" &
T11.Text & "','" & T12.Text & "','" & T13.Text & "')"
cmd = New OleDbCommand(simpan, conn)
cmd.ExecuteNonQuery()
MsgBox("Data anda tersimpan...!!!", MsgBoxStyle.Information,
"INFORMASI")
Call Kosongkan()
Call Tampilkan()
End If
End Sub

Private Sub BBATAL_Click1(sender As Object, e As EventArgs) Handles


BBATAL.Click
Call Kosongkan()
BSIMPAN.Visible = True
BEDIT.Visible = False
End Sub
Private Sub BEDIT_Click1(sender As Object, e As EventArgs) Handles
BEDIT.Click
Dim update As String
Dim tgl1 As Date = T3.Text
Dim tgl2 As Date = T2.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T13.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

update = " UPDATE TDP set " & _


" TANGGAL_KELUAR='" & T3.Text & "'," & _
" TANGGAL_BERLAKU='" & T2.Text & "'," & _
" NAMA_PERUSAHAAN='" & T4.Text & "'," & _
" STATUS='" & T5.Text & "'," & _
" ALAMAT_PERUSAHAAN='" & T6.Text & "'," & _
" NO_TELP='" & T7.Text & "'," & _
" NAMA_PEMILIK='" & T8.Text & "'," & _
" ALAMAT_PEMILIK='" & T9.Text & "'," & _
" KEGIATAN_USAHA ='" & T10.Text & "'," & _
" KBLI='" & T11.Text & "'," & _
" KETERANGAN='" & T12.Text & "'," & _
" BIAYA ='" & T13.Text & "' WHERE NOMOR ='" & T1.Text & "'"
cmd = New OleDbCommand(update, conn)
cmd.ExecuteNonQuery()
MsgBox("Data sudah berhasil di update...!!!", MsgBoxStyle.Information,
"INFORMASI")
T1.Enabled = True
Call Baca()
Call Kosongkan()
End Sub

Private Sub T1_KeyUp(sender As Object, e As KeyEventArgs) Handles


T1.KeyUp
If Asc(e.KeyCode) = 13 Then
T4.Focus()
cmd = New OleDbCommand("Select * from TDP where NOMOR ='" &
T1.Text & "'", conn)
rd = cmd.ExecuteReader
If rd.Read = True Then
MsgBox("Data sudah ada ...!!!", MsgBoxStyle.Information, "Pesan")
Me.T1.Clear()
Me.T1.Focus()
End If
End If
NO_PENDAFTAR = T1.Text
Call cari_data()
Call isi_data()
Call panggil_siup()
End Sub

Private Sub BTAMPIL_Click(sender As Object, e As EventArgs) Handles


BTAMPIL.Click
TMPTDP.Show()
Me.Close()
End Sub
End Class

LISTING DATA IZIN GANGGUAN (HO)


Imports System.Data.OleDb

Public Class Form4

Public NO_PENDAFTAR As String = ""


Public MODE As Integer = 1

Sub kosong()
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
If MODE = 2 Then
T1.ReadOnly = True
T1.Text = NO_PENDAFTAR
End If
End Sub

Sub isi_data()
Call kosong()
If rd.HasRows Then
T1.Text = rd.Item("NOMOR")
T2.Text = rd.Item("TANGGAL_KELUAR")
T3.Text = rd.Item("TANGGAL_BERLAKU")
T4.Text = rd.Item("NAMA")
T5.Text = rd.Item("PEKERJAAN")
T6.Text = rd.Item("ALAMAT")
T7.Text = rd.Item("JENIS_USAHA")
T8.Text = rd.Item("MEREK_USAHA")
T9.Text = rd.Item("LUAS_TEMPAT_USAHA")
T10.Text = rd.Item("BIAYA")
BSIMPAN.Visible = False
BEDIT.Visible = True
End If
End Sub

Sub panggil_siup()
conn.Close()
Call Koneksidata()
T2.Text = ""
T3.Text = ""
T4.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
Try
cmd = New OleDb.OleDbCommand("SELECT * FROM SIUP WHERE
NOMOR = '" & NO_PENDAFTAR & "'", conn)
rd = cmd.ExecuteReader
rd.Read()
If rd.HasRows Then
T2.Text = rd.Item("TANGGAL_KELUAR")
T3.Text = rd.Item("TANGGAL_BERLAKU")
T4.Text = rd.Item("NAMA_PEMILIK")
T6.Text = rd.Item("ALAMAT_PEMILIK")
T7.Text = rd.Item("JENIS_BARANG")
T8.Text = rd.Item("NAMA_PERUSAHAAN")
End If
Catch
MsgBox("Tidak dapat menghubungkan ke database",
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub cari_data()
Try
cmd = New OleDb.OleDbCommand("SELECT * FROM
IZINGANGGUAN WHERE NOMOR = '" & NO_PENDAFTAR & "'", conn)
rd = cmd.ExecuteReader
rd.Read()
Catch
MsgBox("Tidak dapat menghubungkan ke database",
MsgBoxStyle.Critical, "Kesalahan")
End Try
End Sub

Sub input_data()
Dim sql As String

Call cari_data()
If MODE = 1 And rd.HasRows Or MODE = 2 Then
sql = " UPDATE IZINGANGGUAN set " & _
" TANGGAL_KELUAR='" & T2.Text & "'," & _
" TANGGAL_BERLAKU='" & T3.Text & "'," & _
" NAMA='" & T4.Text & "'," & _
" PEKERJAAN='" & T5.Text & "'," & _
" ALAMAT='" & T6.Text & "'," & _
" JENIS_USAHA='" & T7.Text & "'," & _
" MEREK_USAHA='" & T8.Text & "'," & _
" LUAS_TEMPAT_USAHA='" & T9.Text & "'," & _
" BIAYA='" & T10.Text & "' WHERE NOMOR='" & T1.Text & "'"

Else
sql = "INSERT INTO
IZINGANGGUAN(NOMOR,TANGGAL_KELUAR,TANGGAL_BERLAKU,NAM
A,PEKERJAAN,ALAMAT,JENIS_USAHA,MEREK_USAHA,LUAS_TEMPAT_
USAHA,BIAYA) VALUES ('" _
& T1.Text & "','" _
& T2.Text & "','" _
& T3.Text & "','" _
& T4.Text & "','" _
& T5.Text & "','" _
& T6.Text & "','" _
& T7.Text & "','" _
& T8.Text & "','" _
& T9.Text & "','" _
& T10.Text & "')"
End If

Try
cmd = New OleDb.OleDbCommand(sql, conn)
cmd.ExecuteNonQuery()
Dim pesan = MsgBox("Data tersimpan, apakah Anda ingin keluar dari
form ini?", MsgBoxStyle.YesNo, "Informasi")
If Not pesan = MsgBoxResult.Yes Then
NO_PENDAFTAR = ""
MODE = 1
Call kosong()
T1.Text = ""
T1.Focus()
Else
Me.Close()
End If
Catch
MsgBox("Tidak dapat menyimpan data" & ErrorToString(),
MsgBoxStyle.Critical, "Kesalahan")
End Try

End Sub

Sub Kosongkan()
T1.Text = ""
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T1.Focus()
End Sub

Sub DataBaru()
T1.Text = ""
T2.Text = ""
T3.Text = ""
T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T8.Text = ""
T9.Text = ""
T10.Text = ""
T1.Focus()
End Sub

Sub Tampilkan()
da = New OleDbDataAdapter("Select * from IZINGANGGUAN ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "IZINGANGGUAN")
DGV.DataSource = (ds.Tables("IZINGANGGUAN"))
DGV.ReadOnly = True
End Sub

Private Sub Baca()


da = New OleDbDataAdapter("Select * from IZINGANGGUAN ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "IZINGANGGUAN")
DGV.DataSource = (ds.Tables("IZINGANGGUAN"))
DGV.ReadOnly = True
End Sub
Private Sub Form4_Load(sender As Object, e As EventArgs) Handles
Me.Load
Call kosong()
Call Kosongkan()
Call cari_data()
Call isi_data()
Call Koneksidata()
Call Tampilkan()

If BSIMPAN.Visible = True Then


BEDIT.Visible = False
Else
BSIMPAN.Visible = False
BEDIT.Visible = True
End If

DGV.Columns(0).Width = 80
DGV.Columns(1).Width = 200
DGV.Columns(2).Width = 80
DGV.Columns(3).Width = 80
DGV.AlternatingRowsDefaultCellStyle.BackColor = Color.Silver
End Sub

Private Sub T1_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T1.KeyPress
If Not ((e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar =
vbBack)) Then e.Handled = True
End Sub

Private Sub T4_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T4.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub
Private Sub T6_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles T6.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T8_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T8.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T9_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T9.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[0-9]" OrElse KeyAscii = Keys.Back OrElse KeyAscii
= Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub DGV_CellMouseClick(sender As Object, e As


DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick
On Error Resume Next
T1.Text = DGV.Rows(e.RowIndex).Cells(0).Value
T2.Text = DGV.Rows(e.RowIndex).Cells(1).Value
T3.Text = DGV.Rows(e.RowIndex).Cells(2).Value
T4.Text = DGV.Rows(e.RowIndex).Cells(3).Value
T5.Text = DGV.Rows(e.RowIndex).Cells(4).Value
T6.Text = DGV.Rows(e.RowIndex).Cells(5).Value
T7.Text = DGV.Rows(e.RowIndex).Cells(6).Value
T8.Text = DGV.Rows(e.RowIndex).Cells(7).Value
T9.Text = DGV.Rows(e.RowIndex).Cells(8).Value
T10.Text = DGV.Rows(e.RowIndex).Cells(9).Value
End Sub

Private Sub T7_KeyPress(sender As Object, e As KeyPressEventArgs)


Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub T5_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles T5.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If ((e.KeyChar Like "[A-Z,a-z]" OrElse KeyAscii = Keys.Back OrElse
KeyAscii = Keys.Space OrElse KeyAscii = Keys.Return OrElse KeyAscii =
Keys.Delete)) Then KeyAscii = 0
e.Handled = CBool(KeyAscii)
End Sub

Private Sub BBATAL_Click(sender As Object, e As EventArgs) Handles


BBATAL.Click
Call Kosongkan()
BSIMPAN.Visible = True
BEDIT.Visible = False
End Sub

Private Sub BSIMPAN_Click(sender As Object, e As EventArgs) Handles


BSIMPAN.Click
Dim tgl1 As Date = T2.Text
Dim tgl2 As Date = T3.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T10.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

If T1.Text = "" Or T2.Text = "" Or T3.Text = "" Or T4.Text = "" Or T5.Text =


"" Or T6.Text = "" Or T7.Text = "" Or T8.Text = "" Or T9.Text = "" Or T10.Text =
"" Then
MsgBox("Data belum lengkap, pastikan semua form terisi..!")
Exit Sub
Else
Dim simpan As String = "INSERT INTO IZINGANGGUAN Values ('" &
T1.Text & "','" & T2.Text & "','" & T3.Text & "','" & T4.Text & "','" & T5.Text & "','"
& T6.Text & "','" & T7.Text & "','" & T8.Text & "','" & T9.Text & "','" & T10.Text &
"')"
cmd = New OleDbCommand(simpan, conn)
cmd.ExecuteNonQuery()
MsgBox("Data anda tersimpan...!!!", MsgBoxStyle.Information,
"INFORMASI")
Call Kosongkan()
Call Tampilkan()
End If
End Sub

Private Sub BEDIT_Click(sender As Object, e As EventArgs) Handles


BEDIT.Click
Dim update As String
Dim tgl1 As Date = T2.Text
Dim tgl2 As Date = T3.Text

tgl1 = tgl1.ToShortDateString
tgl2 = tgl2.ToShortDateString

T10.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

update = " UPDATE IZINGANGGUAN set " & _


" TANGGAL_KELUAR='" & T2.Text & "'," & _
" TANGGAL_BERLAKU='" & T3.Text & "'," & _
" NAMA='" & T4.Text & "'," & _
" PEKERJAAN='" & T5.Text & "'," & _
" ALAMAT='" & T6.Text & "'," & _
" JENIS_USAHA='" & T7.Text & "'," & _
" MEREK_USAHA='" & T8.Text & "'," & _
" LUAS_TEMPAT_USAHA='" & T9.Text & "'," & _
" BIAYA ='" & T10.Text & "' WHERE NOMOR ='" & T1.Text & "'"
cmd = New OleDbCommand(update, conn)
cmd.ExecuteNonQuery()
MsgBox("Data berhasil di update...!!!", MsgBoxStyle.Information,
"INFORMASI")
T1.Enabled = True
Call Baca()
Call Kosongkan()
End Sub

Private Sub T1_KeyUp(sender As Object, e As KeyEventArgs) Handles


T1.KeyUp
If Asc(e.KeyCode) = 13 Then
T4.Focus()
cmd = New OleDbCommand("Select * from IZINGANGGUAN where
NOMOR ='" & T1.Text & "'", conn)
rd = cmd.ExecuteReader
If rd.Read = True Then
MsgBox("Data sudah ada ...!!!", MsgBoxStyle.Information, "Pesan")
Me.T1.Clear()
Me.T1.Focus()
End If
End If
NO_PENDAFTAR = T1.Text
Call cari_data()
Call isi_data()
Call panggil_siup()
End Sub

Private Sub BTAMPIL_Click_1(sender As Object, e As EventArgs) Handles


BTAMPIL.Click
TMPIG.Show()
Me.Close()
End Sub
End Class

LISTING CETAK DATA


Imports System.Data.OleDb

Public Class CETAKIUMK


Dim no_pendaftar As String = ""
Dim tanggal_keluar As String = ""
Dim jenis As String
Dim nomor As String = ""
Sub Tampilkan()
da = New OleDbDataAdapter("Select * from IDPEMOHON ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "IDPEMOHON")
DGV.DataSource = (ds.Tables("IDPEMOHON"))
DGV.ReadOnly = True
End Sub

Sub Tampilkan1()
da = New OleDbDataAdapter("Select * from SIUP ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "SIUP")
DGV1.DataSource = (ds.Tables("SIUP"))
DGV1.ReadOnly = True
End Sub

Sub Tampilkan2()
da = New OleDbDataAdapter("Select * from TDP ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "TDP")
DGV2.DataSource = (ds.Tables("TDP"))
DGV2.ReadOnly = True
End Sub

Sub Tampilkan3()
da = New OleDbDataAdapter("Select * from IZINGANGGUAN ", conn)
ds = New DataSet
ds.Clear()
da.Fill(ds, "IZINGANGGUAN")
DGV.DataSource = (ds.Tables("IZINGANGGUAN"))
DGV.ReadOnly = True
End Sub

Private Sub CETAKIUMK_Load(sender As Object, e As EventArgs)


Handles Me.Load
DGV.Visible = False
DGV1.Visible = False
DGV2.Visible = False
DGV3.Visible = False
Call Koneksidata()
Call Tampilkan()
GroupBox1.Visible = True
Button1.Visible = True
GroupBox2.Visible = False
Button2.Visible = False
GroupBox3.Visible = False
Button3.Visible = False
GroupBox4.Visible = False
Button4.Visible = False
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


Button1.Click
If RadioButton1.Checked = True Then
CETAK1.cetak = 1
CETAK1.nomor = ""
CETAK1.Show()
ElseIf RadioButton2.Checked = True Then
CETAK1.cetak = 2
CETAK1.nomor = ""
CETAK1.Show()
End If
End Sub

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As


EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "" Then
jenis = ""
ElseIf ComboBox1.Text = "IZIN USAHA MIKRO DAN KECIL (IUMK)"
Then
GroupBox1.Visible = True
Button1.Visible = True
GroupBox2.Visible = False
Button2.Visible = False
GroupBox3.Visible = False
Button3.Visible = False
GroupBox4.Visible = False
Button4.Visible = False
ElseIf ComboBox1.Text = "IZIN USAHA PERDAGANGAN (SIUP)" Then
GroupBox2.Visible = True
Button2.Visible = True
GroupBox1.Visible = False
Button1.Visible = False
GroupBox3.Visible = False
Button3.Visible = False
GroupBox4.Visible = False
Button4.Visible = False
ElseIf ComboBox1.Text = "IZIN TANDA DAFTAR PERUSAHAAN (TDP)"
Then
GroupBox3.Visible = True
Button3.Visible = True
GroupBox1.Visible = False
Button1.Visible = False
GroupBox2.Visible = False
Button2.Visible = False
GroupBox4.Visible = False
Button4.Visible = False
ElseIf ComboBox1.Text = "IZIN GANGGUAN (HO)" Then
GroupBox4.Visible = True
Button4.Visible = True
GroupBox1.Visible = False
Button1.Visible = False
GroupBox2.Visible = False
Button2.Visible = False
GroupBox3.Visible = False
Button3.Visible = False
End If
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click
If RadioButton4.Checked = True Then
CETAK2.cetak = 1
CETAK2.nomor = ""
CETAK2.Show()
ElseIf RadioButton3.Checked = True Then
CETAK2.cetak = 2
CETAK2.nomor = ""
CETAK2.Show()
End If
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles


Button3.Click
If RadioButton6.Checked = True Then
CETAK3.cetak = 1
CETAK3.nomor = ""
CETAK3.Show()
ElseIf RadioButton5.Checked = True Then
CETAK3.cetak = 2
CETAK3.nomor = ""
CETAK3.Show()
End If
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles


Button4.Click
If RadioButton8.Checked = True Then
CETAK4.cetak = 1
CETAK4.nomor = ""
CETAK4.Show()
ElseIf RadioButton7.Checked = True Then
CETAK4.cetak = 2
CETAK4.nomor = ""
CETAK4.Show()
End If
End Sub

Private Sub RadioButton8_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton8.CheckedChanged
If RadioButton8.Checked = True Then
TextBox4.Visible = True
Label1.Visible = True
Label2.Visible = False
DateTimePicker4.Visible = False
ElseIf RadioButton7.Checked = True Then
DateTimePicker4.Visible = True
Label2.Visible = True
Label1.Visible = False
TextBox4.Visible = False
End If
End Sub

Private Sub RadioButton6_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton6.CheckedChanged
If RadioButton6.Checked = True Then
TextBox3.Visible = True
Label1.Visible = True
Label2.Visible = False
DateTimePicker3.Visible = False
ElseIf RadioButton5.Checked = True Then
DateTimePicker3.Visible = True
Label2.Visible = True
Label1.Visible = False
TextBox3.Visible = False
End If
End Sub

Private Sub RadioButton4_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton4.CheckedChanged
If RadioButton4.Checked = True Then
TextBox1.Visible = True
Label4.Visible = True
Label3.Visible = False
DateTimePicker2.Visible = False
ElseIf RadioButton3.Checked = True Then
DateTimePicker2.Visible = True
Label4.Visible = True
Label3.Visible = False
TextBox1.Visible = False
End If
End Sub

Private Sub RadioButton1_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
TextBox2.Visible = True
Label1.Visible = True
Label2.Visible = False
DateTimePicker1.Visible = False
ElseIf RadioButton2.Checked = True Then
DateTimePicker1.Visible = True
Label2.Visible = True
Label1.Visible = False
TextBox2.Visible = False
End If
End Sub

Private Sub TextBox4_Click(sender As Object, e As EventArgs) Handles


TextBox4.Click
TextBox4.Text = ""
End Sub

Private Sub TextBox3_Click(sender As Object, e As EventArgs) Handles


TextBox3.Click
TextBox3.Text = ""
End Sub

Private Sub TextBox2_Click(sender As Object, e As EventArgs) Handles


TextBox2.Click
TextBox2.Text = ""
End Sub

Private Sub TextBox1_Click(sender As Object, e As EventArgs) Handles


TextBox1.Click
TextBox1.Text = ""
End Sub
End Class

Anda mungkin juga menyukai