Oke
kali ini saya mendapat tugas UTS yaitu memebuat sebuah program dengan menggunakan VB.Net,
di kesempetana kali saya membuat sebuh aplikasi sederhana yaiut sitem Booking Lapang Futsal .
Langsung aja :) :)
Brikut tampilan awal
Jika format itu di masukan data akan berjalan sebagaimana fungsinya
berikut contohnya !!!
sudah berjalan kan ya !!!
Nah ini dia yang di tunggu untuk masalah scriptcnya
heheh
ublic Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
proses()
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For a As Integer = 1 To 3
ComboBoxPL.Items.Add("futsal " & a)
Next
Dim jm As Integer = 9
Do While jm < 23
ComboBoxPJ.Items.Add(jm & ":00")
jm = jm + 1
Loop
Dim js As Integer = 9
Do While js < 23
ComboBoxJS.Items.Add(js & ":00")
js = js + 1
Loop
TextBoxHARGAJAM.Enabled = False
TextBoxTOTALJAM.Enabled = False
TextBoxTOTALBAYAR.Enabled = False
End Sub
Private Sub proses()
Dim hitung As kelaspl = New kelaspl
TextBoxTOTALJAM.Text = hitung.pengurangan(Val(ComboBoxJS.Text), Val(ComboBoxPJ.Text))
If TextBoxTOTALJAM.Text <= 0 Then
MsgBox("Jam Mulai tidak boleh lebih atau sama dengan Jam Selesai", MsgBoxStyle.Information, "Peringatan!")
ComboBoxPJ.SelectedIndex = 0
TextBoxHARGAJAM.Text = 0
TextBoxTOTALJAM.Text = 0
TextBoxTOTALBAYAR.Text = 0
Else
Select Case ComboBoxPL.Text
Case Is = "futsal 1"
TextBoxHARGAJAM.Text = "150000"
TextBoxHARGAJAM.Text = FormatNumber(TextBoxHARGAJAM.Text)
Case Is = "futsal 2"
TextBoxHARGAJAM.Text = "120000"
TextBoxHARGAJAM.Text = FormatNumber(TextBoxHARGAJAM.Text)
Case Is = "futsal 3"
TextBoxHARGAJAM.Text = "100000"
TextBoxHARGAJAM.Text = FormatNumber(TextBoxHARGAJAM.Text)
End Select
TextBoxTOTALBAYAR.Text = FormatNumber(hitung.totalbayar(TextBoxHARGAJAM.Text, TextBoxTOTALJAM.Text))
End If
End Sub
Private Sub batal()
ComboBoxPL.SelectedIndex = 0
TextBoxHARGAJAM.Text = 0
ComboBoxPJ.SelectedIndex = 0
ComboBoxJS.SelectedIndex = 0
TextBoxTOTALJAM.Text = 0
TextBoxTOTALBAYAR.Text = 0
End Sub
Private Sub keluar()
Dim message As String
message = MsgBox("Apakah anda yakin akan keluar dari aplikasi ini?", MsgBoxStyle.YesNo, "Konfirmasi!")
If message = vbYes Then
Me.Close()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
batal()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
keluar()
End Sub
End Class
========================================================================
nah yang di bawah ini script untuk class
class di sini berfungsi sebagai penghubung fungsi yang terdapat di formnya supaya dapat terelasi dan menghasilkan apa yang akan dihasil kan.
langsung aja
heheh
Public Class kelaspl
Public Function pengurangan(ByVal nilai1 As Double, ByVal nilai2 As Double)
Dim hasil As Double
hasil = nilai1 - nilai2
Return hasil
End Function
Public Function totalbayar(ByVal nilai1 As Double, ByVal nilai2 As Double)
Dim hasil As Double
hasil = nilai1 * nilai2
Return hasil
End Function
Public Function nominaldiskon(ByVal nilai1 As Double, ByVal nilai2 As Double, ByVal nilai3 As Double)
Dim hasil As Double
hasil = nilai1 * nilai2 * nilai3 / 100
Return hasil
End Function
Public Function nominaldiskon2(ByVal nilai1 As Double, ByVal nilai2 As Double)
Dim hasil As Double
hasil = nilai1 * nilai2
Return hasil
End Function
Public Function hargadiskon(ByVal nilai1 As Double, ByVal nilai2 As Double)
Dim hasil As Double
hasil = nilai1 - nilai2
Return hasil
End Function
End Class
demikian dan terimakash
:) :) :)
Monday, December 1, 2014
0 Response to "Aplikasi Booking Lapangan Futsal"
Post a Comment