Private Sub Timer7_Tick(sender As Object, e As EventArgs) Handles Timer7.Tick Timer7.Interval = 5000 Timer7.Enabled = True Try 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 scn.Open() scm.CommandText = "SELECT * from ConCon" scm.CommandText = "SELECT * from AppCon" scm.CommandText = "SELECT * from PrioCon" scm.CommandText = "SELECT * from RetCon" scm.ExecuteNonQuery() scn.Close() Catch ex As Exception MessageBox.Show(ex.Message) End Try Refresh() End Sub
Private Sub AppNxt_Click(sender As Object, e As EventArgs) Handles AppNxt.Click 'next 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) Try connString5 = "Server=MISKRISTIAN-PC\HMO_OPD;Database=HMO_OPD_QUEUE;User Id=sa;Password=sa;" sqlconn5.ConnectionString = connString5 sqlquery5.Connection = sqlconn5 sqlconn5.Open() sqlquery5.CommandText = "INSERT INTO AppCon([Number],[Counter])VALUES(@Number,@Number)" sqlquery5.Parameters.AddWithValue("@Number", Queue.Label7.Text) sqlquery5.Parameters.AddWithValue("@Counter", Queue.Label19.Text) sqlquery5.ExecuteNonQuery() sqlconn5.Close() Catch ex As Exception MessageBox.Show(ex.Message) 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() 'tts speak.Duration = 3 speaker.Rate = -5 speaker.Volume = 100 speaker.Speak("Now serving number " + Queue.Label7.Text) speaker.SelectVoiceByHints(VoiceGender.Male) Queue.Label19.Text = strHostName1 End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)