Penjelasan :
Aplikasi ini bertujuan untuk mempermudah kasir untuk menghitung total biaya yang harus dibayar oleh anggota keluarga pasien.
Fitur yang terdapat pada aplikasi ini adalah :
1. Ketentuan harga per kamar.
2. Tombol Proses, untuk menghitung total biaya yang harus dibayar oleh para anggota keluarga pasien.
3. Tombol Batal, untuk membatalkan proses pembayaran.
4. Tombol Keluar, untuk keluar dari aplikasi ini.
Screen Shoot :
Source Code :
Form1.vb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cbTK.Items.Add("Anggrek")
cbTK.Items.Add("Mawar")
cbTK.Items.Add("Melati")
For tagor As Integer = 1 To 3
cbR.Items.Add(tagor)
Next
tbHargaPerHari.Enabled = False
tbTotalHarga.Enabled = False
End Sub
Private Sub proses()
Dim hitung As kelasna = New kelasna
If cbTK.SelectedItem = "Anggrek" Then
Select Case cbR.Text
Case Is = "1"
tbHargaPerHari.Text = "90000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
Case Is = "2"
tbHargaPerHari.Text = "80000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
Case Is = "3"
tbHargaPerHari.Text = "70000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
End Select
ElseIf cbTK.SelectedItem = "Mawar" Then
Select Case cbR.Text
Case Is = "1"
tbHargaPerHari.Text = "60000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
Case Is = "2"
tbHargaPerHari.Text = "50000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
Case Is = "3"
tbHargaPerHari.Text = "40000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
End Select
ElseIf cbTK.SelectedItem = "Melati" Then
Select Case cbR.Text
Case Is = "1"
tbHargaPerHari.Text = "30000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
Case Is = "2"
tbHargaPerHari.Text = "20000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
Case Is = "3"
tbHargaPerHari.Text = "10000"
tbHargaPerHari.Text = FormatNumber(tbHargaPerHari.Text)
End Select
End If
tbTotalHarga.Text = hitung.perkalian(tbTotalHari.Text, tbHargaPerHari.Text)
tbTotalHarga.Text = FormatNumber(tbTotalHarga.Text)
End Sub
Private Sub batal()
cbTK.SelectedIndex = 0
cbR.SelectedIndex = 0
DTPtm.Text = Date.Now
DTPtk.Text = Date.Now
tbTotalHari.Text = 0
tbHargaPerHari.Text = 0
tbTotalHarga.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 btnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProses.Click
proses()
End Sub
Private Sub btnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBatal.Click
batal()
End Sub
Private Sub btnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKeluar.Click
keluar()
End Sub
End Class
Class1.vb
Public Class kelasna
Public Function perkalian(ByVal nilai1 As Integer, ByVal nilai2 As Double)
Dim hasil As Double
hasil = nilai1 * nilai2
Return hasil
End Function
End Class
Tidak ada komentar:
Posting Komentar