//string connStr = "Data Source=SAIKRISHNA;Initial Catalog=ankapur;Persist Security Info=True;User ID=ankapuruser1;Password=user123"; public Tickets1() { InitializeComponent(); //string originalrestcode = Application.Current.Properties["restcode"].ToString(); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Start(); DispatcherTimer timer1 = new DispatcherTimer(); timer1.Interval = TimeSpan.FromSeconds(30); timer1.Tick += timer_Tick1; timer1.Start(); cborest.Visibility = Visibility.Hidden; BindRestaurantdtls(cborest); string restcode = ""; if (Application.Current.Properties["restcode"] == null) { Application.Current.Properties["restcode"] = "HN"; } if (Application.Current.Properties["restcode"].ToString().Trim() == "ZZ") { this.cborest.Visibility = Visibility.Visible; MessageBox.Show("Please select the Restaurant"); cborest.Focus(); //cborest.SelectedValue = restcode; } else { restcode = Application.Current.Properties["restcode"].ToString(); } ///To add functionality for refreshing every 30 secs addUserControl(); Tickets tc = new Tickets(); if (tc.IsActive) { tc.Close(); } else { tc.Show(); } try { string st = " New Order with Order id" + b.OrderId; SpeechSynthesizer sp = new SpeechSynthesizer(); sp.SelectVoiceByHints(VoiceGender.Male, VoiceAge.Adult); sp.Volume = 100; sp.Rate = -3; sp.Speak(st); } catch (Exception) { MessageBox.Show("PLease switch on the TV in the kitchen"); } //PlaySound(); }
private void cborest_SelectionChanged(object sender, SelectionChangedEventArgs e) { string restcode = Application.Current.Properties["restcode"].ToString().Trim(); if (restcode == "ZZ") { if (cborest.SelectedValue.ToString().Trim() == "BW") { Application.Current.Properties["restcode"] = "BW"; } else if (cborest.SelectedValue.ToString().Trim() == "HN") { Application.Current.Properties["restcode"] = "HN"; } else if (cborest.SelectedValue.ToString().Trim() == "MD") { Application.Current.Properties["restcode"] = "MD"; } else if (cborest.SelectedValue.ToString().Trim() == "KP") { Application.Current.Properties["restcode"] = "KP"; } else if (cborest.SelectedValue.ToString().Trim() == "AN") { Application.Current.Properties["restcode"] = "AN"; } else { restcode = Application.Current.Properties["restcode"].ToString().Trim(); } stkMain.Children.Clear(); addUserControl(); Tickets tc = new Tickets(); if (tc.IsActive) { tc.Close(); } else { tc.Show(); } } else { if (cborest.SelectedValue.ToString().Trim() == "BW") { Application.Current.Properties["restcode"] = "BW"; } else if (cborest.SelectedValue.ToString().Trim() == "HN") { Application.Current.Properties["restcode"] = "HN"; } else if (cborest.SelectedValue.ToString().Trim() == "MD") { Application.Current.Properties["restcode"] = "MD"; } else if (cborest.SelectedValue.ToString().Trim() == "KP") { Application.Current.Properties["restcode"] = "KP"; } else if (cborest.SelectedValue.ToString().Trim() == "AN") { Application.Current.Properties["restcode"] = "AN"; } else { restcode = Application.Current.Properties["restcode"].ToString().Trim(); } stkMain.Children.Clear(); addUserControl(); Tickets tc = new Tickets(); if (tc.IsActive) { tc.Close(); } else { tc.Show(); } } }