Click here to Skip to main content
15,845,308 members

Comments by noob_noob (Top 22 by date)

noob_noob 29-Nov-17 3:10am View    
the function saves data in the database,and displays the data on the form named Queue(this is the form that displays the number that is being served).
noob_noob 29-Nov-17 3:01am View    
Private Sub AppNxt_Click(sender As Object, e As EventArgs) Handles AppNxt.Click
        Dim strHostName1 As String
        strHostName1 = System.Net.Dns.GetHostName()

        If (wapp.Text = 0) Then
            MessageBox.Show("There are no queues as of now!")

        ElseIf (Queue.Label7.Text < FrmNumApp.NumApp.Text) Then
            Dim sqlconn5 As New SqlConnection
            Dim sqlquery5 As New SqlCommand
            Dim connString5 As String
            wapp.Text = CStr(CDbl(wapp.Text) - 1)
                connString5 = "Server=MISKRISTIAN-PC\HMO_OPD;Database=HMO_OPD_QUEUE;User Id=sa;Password=sa;"
                sqlconn5.ConnectionString = connString5
                sqlquery5.Connection = sqlconn5
                sqlquery5.CommandText = "INSERT INTO AppCon([Number],[Counter])VALUES(@Number,@Number)"
                sqlquery5.Parameters.AddWithValue("@Number", Queue.Label7.Text)
                sqlquery5.Parameters.AddWithValue("@Counter", Queue.Label19.Text)
            Catch ex As Exception
            End Try

            Queue.Label7.Text = CStr(CDbl(Queue.Label7.Text) + 1)
            Queue.Label11.Text = "0"
            My.Computer.Audio.Play(My.Resources.DoorBell, AudioPlayMode.Background)
            Dim speaker As New SpeechSynthesizer()
            Dim speak As New Prosody()
            speak.Duration = 3
            speaker.Rate = -5
            speaker.Volume = 100
            speaker.Speak("Now serving number " + Queue.Label7.Text)
            Queue.Label19.Text = strHostName1
        End If

    End Sub

this is the function of the "next button"
noob_noob 27-Nov-17 20:13pm View    
Can you give me an idea that can execute all four of them?
The system populates the window by calling the data that was generated when a user clicks a button that generates a ticket from the system.

this system does not generate sensitive information, there is nothing to worry about that.
noob_noob 23-Nov-17 3:19am View    
Hi, thanks for replying to my question. I did some fiddling with the tick event and this is what I ended up with:

Private Sub Timer7_Tick(sender As Object, e As EventArgs) Handles Timer7.Tick
Timer7.Interval = 5000
Timer7.Enabled = True
Dim scn As New SqlConnection
Dim scm As New SqlCommand
Dim str1 As String
str1 = "Server=MISKRISTIAN-PC\HMO_OPD;Database=HMO_OPD_QUEUE;User Id=sa;Password=sa;"
scn.ConnectionString = str1
scm.Connection = scn
scm.CommandText = "SELECT * from ConCon"
scm.CommandText = "SELECT * from AppCon"
scm.CommandText = "SELECT * from PrioCon"
scm.CommandText = "SELECT * from RetCon"
Catch ex As Exception
End Try


End Sub

this is wrong in so many ways but I'm on a deadend here. Can you help me? Thanks.
noob_noob 30-Oct-17 5:11am View    
I have created a counter for the queue, all I need now is to count how many are stacked in the queue to display it on the controller. Thanks!