Hello friends, i am making an internet cafe progra,. And i need some help . Well, I was wondering if it is possble for this ;
when a time is counting down for the customer , and the customer wants to top his/her account with more time , my cafe program will auto detect the change of the customer's time and auto adds the time for the customer without logging the customer's account .
Is it possible??

FYI: I am using MySQL to control everything .
All computers will be Windows XP Professional .

Recommended Answers

All 9 Replies

Please pass more information.

have a google around about resetting the "timer" component

Hmm , maybe ask me more questions? I will answer you . Well, i dunwana spam the mysql as MYSQL will always give too many connections problem . So yeah .

why do we need to ask you more questions? :S

because you want to get it more detailed right?

Just Google search How To Create a Countdown Timer in VB and How To Refresh The Timer Control in VB and I am sure you will find what you will need.

What are loading/logging customers into? A ListView?
.If a ListView, easy. Just use one Timer and on each Timer.Tick, loop thruough all items in the ListView and subtract time from time.remaining until at "0". The Timer will do it's own thing and you can always add more time to the selected customer.

Well, what if the customer's time is still left with 1 hour and he still wants to top up ? don't he have to logout?

Thy this in a new project.
1 ListView, 1 Button

Public Class Form1
    Private WithEvents tmrCountDown As New Timer With {.Interval = 1000, .Enabled = True} '// countDown Timer.
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListView1 '// FOR TESTING.
            .View = View.Details : .FullRowSelect = True
            With .Columns
                .Add("Customer Name", 150) : .Add("Time Remaining", 125)
            End With
            With .Items
                .Add(New ListViewItem("Some Name,100".Split(","c)))
                .Add(New ListViewItem("Some otherName,300".Split(","c)))
            End With
        End With
        Button1.Text = "Add Time"
    End Sub

    Private Sub tmrCountDown_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrCountDown.Tick
        With ListView1
            If Not .Items.Count = 0 Then
                For Each itm As ListViewItem In .Items
                    itm.SubItems(1).Text -= 1
                Next
            End If
        End With
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With ListView1
            If Not .SelectedItems.Count = 0 Then
                .SelectedItems(0).SubItems(1).Text += 50
            Else
                MsgBox("Select a customer to add time to.")
            End If
        End With
    End Sub
End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.