private void radioButtonNoAutoLogoutEnabled_SelectionGained(object sender, EventArgs e) { SettingManager.SetStoreSetting("DisableAutoLogoff", 1); LoginControl.StopAutoLogoutTimer(); radioButtonYesAutoLogoutEnabled.IsSelected = false; SetAutoLogoutEnabledControls(); }
void parent_Loaded(object sender, RoutedEventArgs e) { StoreSetting setting = SettingManager.GetStoreSetting("EnableAutoLogoffInPasswordChange"); if ((setting.IntValue == null) || (setting.IntValue.Value == 0)) { LoginControl.StopAutoLogoutTimer(); } }
private void CreateTicketCommand() { // Make sure that start-of-day has occured if (DayOfOperation.Today == null) { PosDialogWindow.ShowDialog( Types.Strings.YouCanNotCreateTicketsUntilStartOfDayHasBeenCompleted, Types.Strings.RequiresStartOfDay, DialogButtons.Ok); return; } // Create the seating selection control if (ConfigurationManager.UseSeating) { PosDialogWindow window = SeatingSelectionControl.CreateInDefaultWindow(); var control = window.DockedControl as SeatingSelectionControl; if (control == null) { return; } control.InitializeFromTicket(null); // Show the dialog PosDialogWindow.ShowPosDialogWindow(window); if (!window.ClosedByUser) { SessionManager.ActiveTicket = TicketManager.Add(control.TicketType, Party.NoPartyId, control.SelectedSeatingId, SessionManager.ActiveEmployee.Id, ((control.SelectedCustomer != null) ? control.SelectedCustomer.Id : Customer.NoCustomerId)); SelectedTicket = SessionManager.ActiveTicket; OrderEntryControl.SetAndLoadActiveTicket(SessionManager.ActiveTicket); } MainWindow.ShowWindowShadingOverlay = false; } else { SessionManager.ActiveTicket = TicketManager.Add(TicketType.DineIn, Party.NoPartyId, Seating.NoSeatingId, SessionManager.ActiveEmployee.Id, Customer.NoCustomerId); SelectedTicket = SessionManager.ActiveTicket; OrderEntryControl.SetAndLoadActiveTicket(SessionManager.ActiveTicket); } // Stop auto-logoff timer, if it should be disabled StoreSetting setting = SettingManager.GetStoreSetting("EnableAutoLogoffWhileInOrderEntry"); if ((setting.IntValue == null) || (setting.IntValue.Value == 0)) { LoginControl.StopAutoLogoutTimer(); } // Need to change displayed tickets to open tickets, otherwise it will cause // an exception in the TicketCashoutControl when cashing-out from in-order if ((TicketFilterControl.CurrentFilter != TicketSelectionShow.MyOpen) && (TicketFilterControl.CurrentFilter != TicketSelectionShow.AllOpen) && (TicketFilterControl.CurrentFilter != TicketSelectionShow.AllDay) && (TicketFilterControl.CurrentFilter != TicketSelectionShow.All)) { TicketFilterControl.CurrentFilter = TicketSelectionShow.MyOpen; } UpdateTickets(); }
void Current_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { e.Handled = true; // Stop the auto-logoof timer LoginControl.StopAutoLogoutTimer(); // Close all database connections DataModelBase.CloseAll(); #if !DEMO // Send the exception to the upgrade server Updater.StartCrashReport(e.Exception); #endif // Save the exception, serialized to the AppData folder try { DateTime now = DateTime.Now; string rootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "TemPOS"; if (!Directory.Exists(rootDirectory)) { Directory.CreateDirectory(rootDirectory); } string path = rootDirectory + Path.DirectorySeparatorChar + "crashdata-" + now.Year + now.Month.ToString("D2") + now.Day.ToString("D2") + "-" + now.Hour.ToString("D2") + now.Minute.ToString("D2") + now.Second.ToString("D2") + ".bin"; using (FileStream fileStream = new FileStream(path, FileMode.CreateNew)) { byte[] serialData = e.Exception.SerializeObject(); using (BinaryWriter writer = new BinaryWriter(fileStream)) { writer.Write(serialData); } } } catch { } // Display the exception message DisplayExceptionDialog(e.Exception); // Remove employee table lock (that prevents simultaneous login) if (SessionManager.ActiveEmployee != null) { PosHelper.Unlock(TableName.Employee, SessionManager.ActiveEmployee.Id); } // Close this app if (_mainWindow != null) { _mainWindow.AllowClose = true; _mainWindow.Close(); } // Disable user control crap if (ConfigurationManager.UseKeyboardHook) { UserControlManager.Disable(); } UserControlManager.ShowTaskbar(true); #if !DEBUG if (PastRestartPoint) { // Restart application Process.Start(Application.ResourceAssembly.Location, "/RESTART"); App.SwitchToDefaultDesktopOnClose = false; } else { App.SwitchToDefaultDesktopOnClose = true; } #else App.SwitchToDefaultDesktopOnClose = true; #endif // Shutdown current application Application.Current.Shutdown(); Process.GetCurrentProcess().Kill(); }