Di program ini saya membuat tentang Penyewaan Film. Dimana penyewa di wajibkan untuk memiliki akun terdatar, barulah ia dapat menyewa sebuah film.
Langsung saja ,karena web ini memakai database maka akan saya jelaskan database yang saya gunakan.
ada 3 Table yang saya gunakan
Setelah ini saya mengkoneksikan Databasenya
Lalu ini tampilan 4 form saya dengan source code nya
Public Class Web_Sewa
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub ButtonList_Click(sender As Object, e As EventArgs) Handles ButtonList.Click
Response.Redirect("WebListFilm_161011400035_Irfan_Andessa.aspx")
End Sub
Protected Sub ButtonDaftar_Click(sender As Object, e As EventArgs) Handles ButtonDaftar.Click
Response.Redirect("WebDaftar_161011400035_Irfan_Andessa.aspx")
End Sub
Protected Sub ButtonSewaFilm_Click(sender As Object, e As EventArgs) Handles ButtonSewaFilm.Click
Response.Redirect("WebPenyewaan_161011400035_Irfan_Andessa.aspx")
End Sub
End Class
Imports System.Data
Imports System.Data.OleDb
Public Class Web_Penyewaan
Inherits System.Web.UI.Page
Private constring As String = ConfigurationManager.ConnectionStrings("DBIrfan_MoviesConnectionString").ConnectionString
Private oConn As New OleDbConnection(constring)
Private oTbl As New DataTable
Private xReader As OleDbDataReader
Dim ocmd As New OleDbCommand
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TxtKode.Items.Add("Pilih")
TxtKode.Items.Add("SEWA01")
TxtKode.Items.Add("SEWA02")
TxtKode.Items.Add("SEWA03")
TxtKode.Items.Add("SEWA04")
TxtKode.Items.Add("SEWA05")
TxtKode.Items.Add("SEWA06")
TxtKode.Items.Add("SEWA07")
TxtKode.Items.Add("SEWA08")
TxtKode.Items.Add("SEWA09")
TxtKode.Items.Add("SEWA10")
TxtKode.Items.Add("SEWA11")
TxtKode.Items.Add("SEWA12")
TxtKode.Items.Add("SEWA13")
TxtKode.Items.Add("SEWA14")
TxtKode.Items.Add("SEWA15")
DropKode.Items.Add("Pilih")
DropKode.Items.Add("F001")
DropKode.Items.Add("F002")
DropKode.Items.Add("F003")
DropKode.Items.Add("F004")
DropKode.Items.Add("F005")
End Sub
Protected Sub CalendarSewa_SelectionChanged(sender As Object, e As EventArgs) Handles CalendarSewa.SelectionChanged
TxtCalenderSewa.Text = CalendarSewa.SelectedDate
End Sub
Protected Sub CalendarKembali_SelectionChanged(sender As Object, e As EventArgs) Handles CalendarKembali.SelectionChanged
TextCalenderKembali.Text = CalendarKembali.SelectedDate
End Sub
Protected Sub ButtonSimpan_Click(sender As Object, e As EventArgs) Handles ButtonSimpan.Click
Dim sql As String = "INSERT INTO Tb_Sewa VALUES ('" & TxtKode.Text & "','" & TextNoID.Text & "','" & DropKode.Text & "','" & TxtCalenderSewa.Text & "','" & TextCalenderKembali.Text & "')"
oConn.Open()
oCmd.Connection = oConn
oCmd.CommandText = sql
oCmd.ExecuteNonQuery()
End Sub
Protected Sub ButtonKembali_Click(sender As Object, e As EventArgs) Handles ButtonKembali.Click
MsgBox("Apakah anda yakin?", MsgBoxStyle.Question + MsgBoxStyle.OkCancel, "Warning")
Dim x = MsgBoxStyle.OkCancel
If x = MsgBoxResult.Ok Then
Response.Redirect("WebSewa_161011400035_Irfan_Andessa.aspx")
End If
End Sub
End Class
FlowChart
Tidak ada komentar:
Posting Komentar