Thursday, November 8, 2007

billing rental/warnet single pc





we can make a billing for pc rental or internet rental (warnet).
we can use object timer in vb.
maybe we need to give them a password form; to end or stop application.
in this application we need 2 forms; 1 for billing and 1 for password.
here is some its source code...

'this is code for billing form...

Dim mulai As Single
Dim keluar As Single
Dim biaya As Long
Dim hitung As Integer

Private Sub Command1_Click()
     biaya = 500
     Text3.Text = "500"
     mulai = Time
     keluar = Time
     Text1.Text = Format(Time, "hh:mm:ss")
     Timer1.Enabled = True
     Command1.Enabled = False
     Command2.Enabled = True
End Sub

Private Sub Command2_Click()
     Load password
     password.Show
End Sub

Private Sub Form_Resize()
     If Me.WindowState = 1 Then
           Me.Caption = Text2.Text
     Else
           Me.Caption = "Billing PC-10"
     End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
     Load password
     password.Show
     password.Caption = "Close"
     Cancel = 1
End Sub

Private Sub Timer1_Timer()
     hitung = hitung + 1
     keluar = keluar + 0.00001157448
     Text2.Text = Format(keluar - mulai, "hh:mm:ss")
     If hitung Mod 480 = 0 Then
           biaya = biaya + 500
           Text3.Text = Format(biaya, "###,###,###")
           hitung = 0
     End If
     If Me.WindowState = 1 Then
           Me.Caption = Text2.Text
     End If

End Sub


'this code for password form...
Private Sub Command1_Click()
     If Me.Caption = "Close" Then
          If Text1.Text = "aadc" Then
               End
          End If
     Else
          If Text1.Text = "aadc" Then
               Form1.Timer1.Enabled = False
               Form1.Command1.Enabled = True
               Form1.Command2.Enabled = False
          End If
     End If
     Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
     If KeyAscii = 13 Then
     Command1_Click
     End If
End Sub

click here to download...

No comments: