(Form Pesanan, Paket Dan Ruangan)
Design Form Pesanan Dan Hasil Setelah
Dijalankan
Listing Program
Imports
System.Data.OleDb
Public Class Form3
Public CMD As OleDbCommand
Public ADP As OleDbDataAdapter
Public DR As OleDbDataReader
Public DS As New DataSet
Dim SQL As String
Sub
TampilRecordpesanan()
ADP = New
OleDbDataAdapter("SELECT * FROM Pesanan",
DB)
DS = New
DataSet
ADP.Fill(DS, "Pesanan")
DataGridView1.DataSource = DS.Tables("Pesanan")
End Sub
Sub
buttonbaru()
Btnbaru.Enabled = True
Btnsimpan.Enabled = False
Btnedit.Enabled = False
Btnhapus.Enabled = False
Btnbatal.Enabled = False
Btnkeluar.Enabled = True
End Sub
Sub
buttonedit()
Btnbaru.Enabled = False
Btnsimpan.Enabled = False
Btnedit.Enabled = True
Btnhapus.Enabled = True
Btnbatal.Enabled = True
Btnkeluar.Enabled = False
End Sub
Sub
buttonsimpan()
Btnbaru.Enabled = False
Btnsimpan.Enabled = True
Btnedit.Enabled = False
Btnhapus.Enabled = False
Btnbatal.Enabled = True
Btnkeluar.Enabled = False
End Sub
Sub
HapusText()
Kd_Pesan.Text = ""
Nm_Pesan.Text = ""
Harga.Text = ""
Call
buttonbaru()
End Sub
Private Sub Btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnhapus.Click
SQL = "DELETE
*FROM Pesanan Where Kd_Pesan='" & Kd_Pesan.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordpesanan()
End Sub
Private Sub Btnbaru_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnbaru.Click
Call
HapusText()
Kd_Pesan.Focus()
End Sub
Private Sub Btnkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnkeluar.Click
Me.Close()
End Sub
Private Sub Form3_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Call
Opendb()
Call
HapusText()
Call
TampilRecordpesanan()
End Sub
Private Sub Kd_Pesanan_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Kd_Pesan.KeyPress
Dim
tombol As Integer
= Asc(e.KeyChar)
Dim
xkode As String
If tombol = 13 Then
SQL = "SELECT
*FROM Pesanan where Kd_Pesan='" & Kd_Pesan.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
DR = CMD.ExecuteReader
DR.Read()
If
DR.HasRows = True Then
Nm_Pesan.Text = DR("Nm_Pesan")
Harga.Text = DR("Harga")
Call
buttonedit()
MsgBox("Data
ditemukan...! ")
Else
xkode = Kd_Pesan.Text
Call
HapusText()
Kd_Pesan.Text = xkode
Call
buttonsimpan()
End
If
Nm_Pesan.Focus()
End If
End Sub
Private Sub Btnbatal_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnbatal.Click
Call
HapusText()
Kd_Pesan.Focus()
End Sub
Private Sub Btnedit_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnedit.Click
SQL = "UPDATE
Pesanan SET Nm_Pesan='" & Nm_Pesan.Text & "'," & _
" Harga='" & Harga.Text & "' " & _
" Where Kd_Pesan='" & Kd_Pesan.Text
& "'"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordpesanan()
End Sub
Private Sub Btnsimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnsimpan.Click
SQL = "INSERT
INTO Pesanan(Kd_Pesan, Nm_Pesan, Harga) " & _
"
values('" & Kd_Pesan.Text & "','"
& _
Nm_Pesan.Text & "','"
& _
Harga.Text
& "')"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordpesanan()
End Sub
End Class
Hasil Laporan
Design Form
Paket Dan Hasil Setelah Dijalankan
Listing Program
Imports
System.Data.OleDb
Public Class Form4
Public CMD As OleDbCommand
Public ADP As OleDbDataAdapter
Public DR As OleDbDataReader
Public DS As New DataSet
Dim SQL As String
Sub
TampilRecordPaket()
ADP = New
OleDbDataAdapter("SELECT * FROM Paket",
DB)
DS = New
DataSet
ADP.Fill(DS, "Paket")
DataGridView1.DataSource = DS.Tables("Paket")
End Sub
Sub
buttonbaru()
Btnbaru.Enabled = True
Btnsimpan.Enabled = False
Btnedit.Enabled = False
Btnhapus.Enabled = False
Btnbatal.Enabled = False
Btnkeluar.Enabled = True
End Sub
Sub
buttonedit()
Btnbaru.Enabled = False
Btnsimpan.Enabled = False
Btnedit.Enabled = True
Btnhapus.Enabled = True
Btnbatal.Enabled = True
Btnkeluar.Enabled = False
End Sub
Sub
buttonsimpan()
Btnbaru.Enabled = False
Btnsimpan.Enabled = True
Btnedit.Enabled = False
Btnhapus.Enabled = False
Btnbatal.Enabled = True
Btnkeluar.Enabled = False
End Sub
Sub
HapusText()
Kd_Paket.Text = ""
Nm_Paket.Text = ""
Jenis.Text = ""
Harga.Text = ""
Jlh_Orang.Text = ""
Lm_Waktu.Text = ""
Call
buttonbaru()
End Sub
Private Sub Btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnhapus.Click
SQL = "DELETE
*FROM Paket Where Kd_Paket='" & Kd_Paket.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call TampilRecordPaket()
End Sub
Private Sub Btnbaru_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnbaru.Click
Call
HapusText()
Kd_Paket.Focus()
End Sub
Private Sub Btnkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnkeluar.Click
Me.Close()
End Sub
Private Sub Form4_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Call
Opendb()
Call
HapusText()
Call
TampilRecordPaket()
End Sub
Private Sub Kd_Paket_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Kd_Paket.KeyPress
Dim
tombol As Integer
= Asc(e.KeyChar)
Dim
xkode As String
If
tombol = 13 Then
SQL = "SELECT
*FROM Paket where Kd_Paket='" & Kd_Paket.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
DR = CMD.ExecuteReader
DR.Read()
If
DR.HasRows = True Then
Nm_Paket.Text = DR("Nm_Paket")
Jenis.Text = DR("Jenis")
Harga.Text = DR("Harga")
Jlh_Orang.Text = DR("Jlh_Orang")
Lm_Waktu.Text = DR("Lm_Waktu")
Call
buttonedit()
MsgBox("Data
ditemukan...! ")
Else
xkode = Kd_Paket.Text
Call
HapusText()
Kd_Paket.Text = xkode
Call
buttonsimpan()
End
If
Nm_Paket.Focus()
End If
End Sub
Private Sub Btnbatal_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnbatal.Click
Call
HapusText()
Kd_Paket.Focus()
End Sub
Private Sub Btnedit_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnedit.Click
SQL = "UPDATE
Paket SET Nm_Paket='" & Nm_Paket.Text & "'," & _
" Jenis='" & Jenis.Text & "'," & _
" Harga='" & Harga.Text & "'," & _
" Jlh_Orang='" & Jlh_Orang.Text
& "'," & _
" Lm_Waktu='" & Lm_Waktu.Text & "' " & _
" Where Kd_Paket='" & Kd_Paket.Text
& "'"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordPaket()
End Sub
Private Sub Btnsimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnsimpan.Click
SQL = "INSERT
INTO Paket(Kd_Paket, Nm_Paket, Jenis, Harga, Jlh_Orang, Lm_Waktu) "
& _
"
values('" & Kd_Paket.Text & "','"
& _
Nm_Paket.Text & "','"
& _
Jenis.Text
& "','" & _
Harga.Text
& "','" & _
Jlh_Orang.Text & "','"
& _
Lm_Waktu.Text & "')"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordPaket()
End Sub
End Class
Hasil Laporan
Design Form
Ruangan Dan Hasil Setelah Dijalankan
Listing Program
Imports
System.Data.OleDb
Public Class Form5
Public CMD As OleDbCommand
Public ADP As OleDbDataAdapter
Public DR As OleDbDataReader
Public DS As New DataSet
Dim SQL As String
Sub
TampilRecordruangan()
ADP = New
OleDbDataAdapter("SELECT * FROM ruangan",
DB)
DS = New
DataSet
ADP.Fill(DS, "ruangan")
DataGridView1.DataSource = DS.Tables("ruangan")
End Sub
Sub
buttonbaru()
Btnbaru.Enabled = True
Btnsimpan.Enabled = False
Btnedit.Enabled = False
Btnhapus.Enabled = False
Btnbatal.Enabled = False
Btnkeluar.Enabled = True
End Sub
Sub
buttonedit()
Btnbaru.Enabled = False
Btnsimpan.Enabled = False
Btnedit.Enabled = True
Btnhapus.Enabled = True
Btnbatal.Enabled = True
Btnkeluar.Enabled = False
End Sub
Sub
buttonsimpan()
Btnbaru.Enabled = False
Btnsimpan.Enabled = True
Btnedit.Enabled = False
Btnhapus.Enabled = False
Btnbatal.Enabled = True
Btnkeluar.Enabled = False
End Sub
Sub
HapusText()
Kd_Ruangan.Text = ""
Nm_Ruangan.Text = ""
Jenis.Text = ""
Call
buttonbaru()
End Sub
Private Sub Btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnhapus.Click
SQL = "DELETE
*FROM ruangan Where Kd_Ruangan='" & Kd_Ruangan.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordruangan()
End Sub
Private Sub Btnbaru_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnbaru.Click
Call
HapusText()
Kd_Ruangan.Focus()
End Sub
Private Sub Btnkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnkeluar.Click
Me.Close()
End Sub
Private Sub Form5_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Call
Opendb()
Call
HapusText()
Call
TampilRecordruangan()
End Sub
Private Sub Kd_Ruangan_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Kd_Ruangan.KeyPress
Dim
tombol As Integer
= Asc(e.KeyChar)
Dim
xkode As String
If
tombol = 13 Then
SQL = "SELECT
*FROM ruangan where Kd_Ruangan='" & Kd_Ruangan.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
DR = CMD.ExecuteReader
DR.Read()
If
DR.HasRows = True Then
Nm_Ruangan.Text = DR("Nm_Ruangan")
Jenis.Text = DR("Jenis")
Call
buttonedit()
MsgBox("Data
ditemukan...! ")
Else
xkode = Kd_Ruangan.Text
Call
HapusText()
Kd_Ruangan.Text = xkode
Call
buttonsimpan()
End
If
Nm_Ruangan.Focus()
End If
End Sub
Private Sub Btnbatal_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnbatal.Click
Call
HapusText()
Kd_Ruangan.Focus()
End Sub
Private Sub Btnedit_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnedit.Click
SQL = "UPDATE
ruangan SET Nm_Ruangan='" & Nm_Ruangan.Text & "'," & _
" Jenis='" & Jenis.Text & "' " & _
" Where Kd_Ruangan='" &
Kd_Ruangan.Text & "'"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordruangan()
End Sub
Private Sub Btnsimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnsimpan.Click
SQL = "INSERT
INTO ruangan(Kd_Ruangan, Nm_Ruangan, Jenis) " & _
"
values('" & Kd_Ruangan.Text & "','"
& _
Nm_Ruangan.Text & "','"
& _
Jenis.Text
& "')"
CMD = New
OleDbCommand(SQL, DB)
CMD.ExecuteNonQuery()
Call
Btnbaru_Click(sender, e)
Call
TampilRecordruangan()
End Sub
End Class
Hasil Laporan
Demikilahlah postingan saya Nama : Yusni Dewi NPM : 1102088
Kelas : MI - P - 1101
Selamat Belajar VB Net
Kelas : MI - P - 1101
Selamat Belajar VB Net