//allows admin person to reclassify without BCS feedback private void QickClassify_Click(object sender, RoutedEventArgs e) { if (vm.QuickReClassifyButtonText == "Quick Reclassify Off") vm.QuickReClassifyButtonText = "Quick Reclassify On"; else vm.QuickReClassifyButtonText = "Quick Reclassify Off"; if (vm.bSimulatePhigetsMode == false) { vm.bSimulatePhigetsMode = true; if (registerView == null) { registerView = new RegisterItem(); Views.Children.Add(registerView); if (vm.bLoggedIn) { ReClassify.Visibility = Visibility.Visible; Classify.Visibility = Visibility.Visible; } } } registerView.SetFocusBarcode(); }
void CheckSystemState(bool PhidgitState) { logger.Info("CheckSystemState start"); if (PhidgitState || vm.bSimulatePhigetsMode) { this.Dispatcher.Invoke(new Action(delegate() //use dispatcher to update UI { textBlock1.Text = "Phidget operational .. waiting for database connection"; vm.bControllerOn = true; if (!vm.bSimulatePhigetsMode) { led1.ColorOn = Colors.Green; led1.IsActive = true; } // label1.Background = Brushes.Green; DBErrorMsg.Text = string.Empty; })); } else { DBErrorMsg.Text = "Phidgit controller not operational"; textBlock1.Text = "System Initialization Failed"; led1.ColorOn = Colors.Red; led1.IsActive = true; } vm.OpenDB(StoreConnectionString); vm.OpenAssemblyDB(AssemblyConnectionString); vm.GetOurEntities(); //operates on background thread this.Dispatcher.Invoke(new Action(delegate() //use dispatcher to update UI { if (vm.DBerrormsg == string.Empty) { led2.ColorOn = Colors.Green; led2.IsActive = true; vm.bTurnOnRegister = true; textBlock1.Text = "System Initialization Complete"; if (led1.ColorOn == Colors.Green || vm.bSimulatePhigetsMode) { if (((App)Application.Current).bQSS) { qssView = new QSS(); Views.Children.Add(qssView); } else { registerView = new RegisterItem(); Views.Children.Add(registerView); } } } else { DBErrorMsg.Text = vm.DBerrormsg; textBlock1.Text = "System Initialization Failed"; led2.ColorOn = Colors.Red; led2.IsActive = true; vm.bTurnOnRegister = false; } })); logger.Info("CheckSystemState end"); }