Jumat, 06 April 2012

Coding Program Tiket


Public Class Form1

    Private Sub Form1_Load
        Me.ControlBox = False
        Me.BackColor = Color.BlanchedAlmond
        Me.Text = "Tiket Penerbangan"
        Label1.Text = "THEWAY AIRLINE"
        Label2.Text = "Kode"
        Label3.Text = "Customer"
        Label4.Text = "Tanggal"
        Label5.Text = "Jenis Pesawat"
        Label6.Text = "Hari"
        Label7.Text = "Harga"
        Label8.Text = "Jumlah"
        Label9.Text = "Potongan"
        Label10.Text = "Total"
        Label11.Text = "Total Bayar"
        combo()

        GroupBox1.Text = "Tujuan"
        GroupBox2.Text = "Waktu"
        Button1.Text = "Baru"
        Button2.Text = "Batal"
        Button3.Text = "Cetak"
        Button4.Text = "Keluar"
        baru()

        ComboBox2.Items.Add("Senin")
        ComboBox2.Items.Add("Selasa")
        ComboBox2.Items.Add("Rabu")
        ComboBox2.Items.Add("Kamis")
        ComboBox2.Items.Add("Jumat")
        ComboBox2.Items.Add("Sabtu")
        ComboBox2.Items.Add("Minggu")

        ComboBox1.Items.Add("Hercules")
        ComboBox1.Items.Add("Boeing")
        ComboBox1.Items.Add("Jet")
    End Sub

    Sub combo()
        ComboBox2.Text = "  -  P i l i h  -  "
        ComboBox1.Text = "  -  P i l i h  -  "
    End Sub

    Sub waktu()
        ListBox2.Items.Clear()
        ListBox2.Items.Add("Pagi : 08.30")
        ListBox2.Items.Add("Petang : 14.00")
        ListBox2.Items.Add("Malam : 19.30")
    End Sub
    Sub Hercules()
        ListBox1.Items.Clear()
        ListBox1.Items.Add("Banda Aceh")
        ListBox1.Items.Add("Bali")
        ListBox1.Items.Add("Irian Jaya")
    End Sub

    Sub Boeing()
        ListBox1.Items.Clear()
        ListBox1.Items.Add("Malaysia")
        ListBox1.Items.Add("Singapura")
        ListBox1.Items.Add("Thailand")
    End Sub

    Sub Jet()
        ListBox1.Items.Clear()
        ListBox1.Items.Add("Amerika")
        ListBox1.Items.Add("Prancis")
        ListBox1.Items.Add("Rusia")
    End Sub

    Sub baru()
        TextBox1.Enabled = False
        TextBox2.Enabled = False
        TextBox3.Enabled = False
        TextBox3.Enabled = False
        TextBox4.Enabled = False
        TextBox5.Enabled = False
        TextBox6.Enabled = False
        TextBox7.Enabled = False
        TextBox8.Enabled = False
        ComboBox2.Enabled = False
        ComboBox1.Enabled = False
        Button2.Enabled = False
        Button3.Enabled = False
    End Sub

    Private Sub Button1_Click
        TextBox1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = True
        TextBox1.Focus()
    End Sub

    Private Sub Button2_Click
        baru()
        TextBox1.Clear()
        TextBox2.Clear()
        TextBox3.Clear()
        TextBox4.Clear()
        TextBox5.Clear()
        TextBox6.Clear()
        TextBox7.Clear()
        TextBox8.Clear()
        combo()
        ListBox1.Items.Clear()
        ListBox2.Items.Clear()
    End Sub

    Private Sub Button4_Click
        Close()
    End Sub

    Private Sub TextBox1_LostFocus
        Select Case TextBox1.Text
            Case TextBox1.TextLength < 5 Or TextBox1.TextLength > 5
                MsgBox("Harus 5 Digit", MsgBoxStyle.Critical)
            Case Mid(TextBox1.Text, 1, 1) <> "T"
                MsgBox("Huruf pertama Harus T", MsgBoxStyle.Critical)
            Case TextBox2.Enabled = True
        End Select
        TextBox2.Focus()
    End Sub

    Private Sub TextBox2_LostFocus
        If TextBox2.Text = "" Then
            MsgBox("Data Harus Diisi", MsgBoxStyle.Information, "THEWAY AIRLINE")
        Else
            TextBox3.Enabled = True
            TextBox3.Focus()
        End If
    End Sub

    Private Sub TextBox3_LostFocus
        If IsDate(TextBox3.Text) = False Then
            MsgBox("Harus Diisi Format Tanggal", MsgBoxStyle.Information, "THEWAY AIRLINE")
        Else
            ComboBox1.Enabled = True
        End If
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged
        If ComboBox2.Text = "Senin" Then
            waktu()
        ElseIf ComboBox2.Text = "Selasa" Then
            waktu()
        ElseIf ComboBox2.Text = "Rabu" Then
            waktu()
        ElseIf ComboBox2.Text = "Kamis" Then
            waktu()
        ElseIf ComboBox2.Text = "Jumat" Then
            waktu()
        ElseIf ComboBox2.Text = "Sabtu" Then
            waktu()
        ElseIf ComboBox2.Text = "Minggu" Then
            waktu()
        End If
    End Sub
    Private Sub ComboBox1_SelectedIndexChanged
        If ComboBox1.Text = "Hercules" Then
            Hercules()
        ElseIf ComboBox1.Text = "Boeing" Then
            Boeing()
        ElseIf ComboBox1.Text = "Jet" Then
            Jet()
        End If
    End Sub

    Private Sub ListBox1_SelectedIndexChanged
        If ListBox1.Text = "Banda Aceh" Then
            TextBox4.Text = "4000000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Bali" Then
            TextBox4.Text = "850000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Irian Jaya Then" Then
            TextBox4.Text = "1100000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Malaysia" Then
            TextBox4.Text = "950000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Singapura" Then
            TextBox4.Text = "1200000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Thailand" Then
            TextBox4.Text = "2300000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Amerika" Then
            TextBox4.Text = "4300000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Prancis" Then
            TextBox4.Text = "5200000"
            ComboBox2.Enabled = True
        ElseIf ListBox1.Text = "Rusia" Then
            TextBox4.Text = "7200000"
            ComboBox2.Enabled = True
        End If
    End Sub

    Private Sub ListBox2_SelectedIndexChanged
        If ListBox2.Text = "Pagi : 08.30" Then
            TextBox5.Enabled = True
        ElseIf ListBox2.Text = "Petang : 14.00" Then
            TextBox5.Enabled = True
        ElseIf ListBox2.Text = "Malam : 19.30" Then
            TextBox5.Enabled = True
        End If
        TextBox5.Focus()
    End Sub

    Private Sub TextBox5_LostFocus
        TextBox7.Text = Val(TextBox4.Text) * Val(TextBox5.Text)
        If Val(TextBox5.Text) > 3 Then
            TextBox6.Text = Val(TextBox7.Text) * 0.3
        End If
        TextBox8.Text = Val(TextBox7.Text) - Val(TextBox6.Text)
    End Sub

    Private Sub Button3_Click
        If TextBox5.Text = "0" Then
            MsgBox("PEMESANAN TIKET GAGAL", MsgBoxStyle.Critical, "THEWAY AIRLINE")
        Else
            MsgBox("PEMESANAN TIKET BERHASIL", MsgBoxStyle.Information, "THEWAY AIRLINE")
        End If
    End Sub
End Class

Tinggalkan Komentar Anda Untuk Memperbaiki Isi Blog ini

1 komentar:

  1. Daftar Agen Casino Online Terpercaya 2021
    Situs Agen Casino Online Terpercaya 2021. Daftar Agen Casino Online Terpercaya งานออนไลน์ 2021. Joker123, 메리트카지노 Joker388, Joker388 & Joker Poker are also found in 제왕 카지노

    BalasHapus