private void buttonRestart_Click(object sender, RoutedEventArgs e) { OrderEntryCommands.ExecuteLogoutCommand(); User32.ExitWindowsEx(2, 0); App.SwitchToDefaultDesktopOnClose = true; App.ShutdownApplication(false); }
void buttonOk_Click(object sender, RoutedEventArgs e) { // Yuck, but it works DateTime nowTime = DateTime.Now; int? intValue = OrderEntryCommands.GetPrepTime().IntValue; if (intValue != null) { DateTime earliestTime = nowTime + new TimeSpan(0, intValue.Value - 1, 60 - nowTime.Second); if (SelectedDateTime != null && SelectedDateTime.Value < (earliestTime - new TimeSpan(0, 1, 0))) { PosDialogWindow.ShowDialog( Strings.FutureTimeTooEarly + earliestTime.ToLongTimeString(), Strings.FutureTimeTooEarlyError); } else { KeepChanges = true; // Closes the dialog window Window.GetWindow(this).Close(); } } }
private void buttonDock_Click(object sender, RoutedEventArgs e) { RegisterContextMenu.IsOpen = false; int registerSubId = 0; RegisterDrawer registerDrawer = RegisterDrawer.GetFloating(SessionManager.ActiveEmployee.Id); if (registerDrawer == null) { PosDialogWindow.ShowDialog( Types.Strings.RegisterMenuNotFloating, Types.Strings.Error); return; } if (registerSubId == 0) { DeviceManager.OpenCashDrawer1(); } else if (registerSubId == 1) { DeviceManager.OpenCashDrawer2(); } RegisterManager.DockRegisterDrawer(registerDrawer, registerSubId); OrderEntryCommands.SetupNoOrderCommands(); PosDialogWindow.ShowDialog( Types.Strings.RegisterMenuDrawerIsNowDocked, Types.Strings.Notification); OrderEntryCommands.UpdateTicketDetailCommands(); }
public void SetStatusLabel() { bool isFuture = ((SelectedTicket.StartTime != null) && (SelectedTicket.PrepareTime == null)); if ((SelectedTicket.PrepareTime == null) && (SelectedTicket.StartTime == null)) { labelStatus.Content = Types.Strings.OrderEntrySuspendedOrder; } else if (SelectedTicket.IsCanceled) { labelStatus.Content = Types.Strings.Canceled; } else if (SelectedTicket.IsClosed) { labelStatus.Content = Types.Strings.Closed; } else if (isFuture) { labelStatus.Content = Types.Strings.OrderEntryActiveFuture; } else if (OrderEntryCommands.SelectedTicketHasUnfiredItems()) { labelStatus.Content = Types.Strings.OrderEntryActiveEntrees; } else if (SelectedTicket.ReadyTime == null) { labelStatus.Content = Types.Strings.OrderEntryActive; } else { labelStatus.Content = Types.Strings.OrderEntryServed; } }
void buttonTouchInputOptions3_Click(object sender, EventHandlers.ButtonTouchInputClickArgs args) { TextBlockButton button = buttonTouchInputOptions3.Buttons[args.ButtonIndex]; UpdateTicketOptions(button); UpdateReceiptTapeItem(); OrderEntryCommands.UpdateInOrderCommands(); }
private void listBoxTransactions_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Update buttons than can be effected by ticket selection changes OrderEntryCommands.UpdateTicketItemButtons(); if (SelectionChanged != null) { SelectionChanged.Invoke(this, e); } }
public static void StartOfDay() { DayOfOperation.ProcessStartOfDay(); #if !DEMO PrinterManager.PrintLineToReceipt(DeviceManager.ActivePosPrinterLocal, Strings.StartOfDay + ": " + DateTime.Now); PrinterManager.PrintLineToReceipt(DeviceManager.ActivePosPrinterLocal); #endif OrderEntryCommands.SetupNoOrderCommands(); }
public static void StartRegister() { // No network card or bad network setup if (RegisterId == null) { PosDialogWindow.ShowDialog(MainWindow.Singleton, Strings.CanNotDetermineTheRegisterIDCheckNetworkSetup, Strings.Error); return; } #if !DEMO // Are and physical register drawers even setup? if ((DeviceManager.ActiveCashDrawer1 == null) && (DeviceManager.ActiveCashDrawer2 == null)) { PosDialogWindow.ShowDialog(MainWindow.Singleton, Strings.ThereAreNoPhysicalCashRegisterDrawersSetup, Strings.Error); return; } // Are both register drawers assigned to other employees already? bool drawer1Available, drawer2Available; RegisterManager.CheckAvailable(out drawer1Available, out drawer2Available); if (!drawer1Available && !drawer2Available) { bool bothDrawersSetup = ((DeviceManager.ActiveCashDrawer1 != null) && (DeviceManager.ActiveCashDrawer2 != null)); PosDialogWindow.ShowDialog(MainWindow.Singleton, (bothDrawersSetup ? Strings.BothDrawersAre : Strings.TheRegisterDrawerIs) + Strings.AlreadyBeingUsedBy + (bothDrawersSetup ? Strings.OtherEmployees : Strings.AnotherEmployee), Strings.Error); return; } #endif PosDialogWindow window = RegisterDrawerStartControl.CreateInDefaultWindow(); RegisterDrawerStartControl control = window.DockedControl as RegisterDrawerStartControl; PosDialogWindow.ShowPosDialogWindow(MainWindow.Singleton, window); if (!window.ClosedByUser && (control.StartingAmount != null)) { RegisterManager.ActiveRegisterDrawer = RegisterDrawer.Add(RegisterId.Value, 0, // TODO: Set RegisterSubId to the physical register drawer used SessionManager.ActiveEmployee.Id, control.StartingAmount.Value); // Resetup command buttons OrderEntryCommands.SetupNoOrderCommands(); // Open the register so the drawer can be placed in it OpenCashDrawer(); } }
private void buttonExitAll_Click(object sender, RoutedEventArgs e) { OrderEntryCommands.ExecuteLogoutCommand(); var ownerWindow = (Window.GetWindow(this) as IShadeable); _notification = ActionNotificationControl.Create(ownerWindow, Strings.ExitStoppingSql, Strings.Notification); _notification.Show(); var thread = new Thread(ServiceStopThreadStart); thread.Start(thread); }
private static void PrintEndOfYear(IShadeable parentWindow) { _endOfYearReportParentWindow = parentWindow; _endOfYearReportParentWindow.ShowShadingOverlay = true; Ticket.ResetAutoIdentity(); TicketItem.ResetAutoIdentity(); TicketItemOption.ResetAutoIdentity(); SettingManager.SetStoreSetting("DailyIdOffset", 0); OrderEntryCommands.SetupNoOrderCommands(); // Show Report ReportManager.PrintEndOfYear(DayOfOperation.YearOfLastStartOfDay, EOYReportClosed_EventHandler); }
private void buttonFloat_Click(object sender, RoutedEventArgs e) { RegisterContextMenu.IsOpen = false; if (PosDialogWindow.ShowDialog( Types.Strings.RegisterMenuConfirmFloat, Types.Strings.Confirmation, DialogButtons.YesNo) == DialogButton.Yes) { RegisterManager.OpenCashDrawer(); RegisterManager.FloatActiveRegisterDrawer(); OrderEntryCommands.SetupNoOrderCommands(); PosDialogWindow.ShowDialog( Types.Strings.RegisterMenuNotifyFloat, Types.Strings.Notification); } OrderEntryCommands.UpdateTicketDetailCommands(); }
private void buttonStartRegister_Click(object sender, RoutedEventArgs e) { RegisterContextMenu.IsOpen = false; if (DayOfOperation.Today != null) { RegisterManager.StartRegister(); OrderEntryCommands.SetupNoOrderCommands(); OrderEntryCommands.UpdateTicketDetailCommands(); } else { PosDialogWindow.ShowDialog( Types.Strings.RegisterMenuRunStartOfDay, Types.Strings.RegisterMenuUnableToProceed); } }
private void buttonRestartProgram_Click(object sender, RoutedEventArgs e) { OrderEntryCommands.ExecuteLogoutCommand(); //Desktop temposDesktop = Desktop.OpenDesktop("TemposDesktop"); if (App.IsUsingDesktop && !LocalSetting.Values.Boolean["KioskMode"]) { Desktop.Default.CreateProcess(Application.ResourceAssembly.Location, "/RESTART"); App.SwitchToDefaultDesktopOnClose = true; } else { VistaSecurity.Restart("/RESTART"); App.SwitchToDefaultDesktopOnClose = false; } App.ShutdownApplication(); }
private void buttonCloseOut_Click(object sender, RoutedEventArgs e) { RegisterContextMenu.IsOpen = false; if (PosDialogWindow.ShowDialog( Types.Strings.RegisterMenuConfirmDrawerClose, Types.Strings.Confirmation, DialogButtons.YesNo) != DialogButton.Yes) { return; } RegisterManager.OpenCashDrawer(); RegisterDrawer activeRegisterDrawer = RegisterManager.ActiveRegisterDrawer; RegisterManager.CloseActiveRegisterDrawer(); OrderEntryCommands.UpdateTicketDetailCommands(); PrintRegisterReport(activeRegisterDrawer); }
public void Login(Employee employee) { Person employeePerson = Person.Get(Employee.GetPersonId(employee.Id)); textBlockUserName.Text = employeePerson.FirstName; SessionManager.ActiveEmployee = employee; SettingManager.SetEmployeeSetting(employee.Id, "LastLogin", DateTime.Now); // Initialize Employee Settings InitializeEmployeeSettings(employee); RegisterManager.SetActiveRegisterDrawer(); OrderEntryCommands.SetupNoOrderCommands(); InitializeTicketSelection(SessionManager.ActiveTicket); ShowTicketSelection(true); LoadSuspendedTicket(); }
void SessionManager_TicketCleared(object sender, EventArgs e) { ShowCouponControl(false); ShowDiscountControl(false); couponEntryControl.Visibility = Visibility.Hidden; couponEntryControl.SelectedTicket = null; discountControl.Visibility = Visibility.Hidden; discountControl.SelectedTicket = null; buttonTouchInputCategory.Clear(); orderEntryItemSelection.Clear(); orderEntryItemOptions.Clear(); orderEntryPizzaItemOptions.Clear(); receiptTape1.Items.Clear(); InitializeTicketSelection(SessionManager.ActiveTicket); ShowTicketSelection(true); OrderEntryCommands.SetupNoOrderCommands(); }
private static void PrintEndOfDay(IShadeable parentWindow) { // Setup shading overlay _endOfDayReportParentWindow = parentWindow; _endOfDayReportParentWindow.ShowShadingOverlay = true; // Reset order id's and process the DayOfOperation DayOfOperation today = DayOfOperation.Today; DayOfOperation.SetTodayNull(); TicketManager.SetOrderIdOffset(); DayOfOperation.ProcessEndOfDay(today, SessionManager.ActiveEmployee.Id, TicketManager.GetOrderIdOffset()); OrderEntryCommands.SetupNoOrderCommands(); // Show Report ReportManager.PrintEndOfDay(today, EODReportClosed_EventHandler); }
public void RemoveSelectedItemFromReceiptTape() { // Remove all child items List <TicketItemTemplate> childTicketItems = (from TicketItemTemplate item in Items where item.TicketItem.ParentTicketItemId == SelectedItem.TicketItem.PrimaryKey.Id select item).ToList(); foreach (TicketItemTemplate childTicketItem in childTicketItems) { Items.Remove(childTicketItem); } // Remove the item from the receipt tape Items.Remove(SelectedItem); OrderEntryControl.SetOrderAmountText(TicketSubTotal.ToString("C2")); SessionManager.ResetItemEntry(); OrderEntryControl.InitializeTicket(); OrderEntryCommands.UpdateInOrderCommands(); ClearSelection(); }
private static void PrintTicketItems(IEnumerable <TicketItem> ticketItems, PrintDestination printDestination, PosPrinter printer, Ticket ticket, TicketItemPrintOptions printOptions) { DateTime realStartTime = SqlDateTime.MaxValue.Value; if (ticket.StartTime != null) { int?intValue = OrderEntryCommands.GetPrepTime().IntValue; if (intValue != null) { realStartTime = (ticket.StartTime.Value - new TimeSpan(0, 0, ticket.StartTime.Value.Second) - new TimeSpan(0, intValue.Value, 0)); } } bool showMakeTags = (((printDestination == PrintDestination.Kitchen1) || (printDestination == PrintDestination.Kitchen2) || (printDestination == PrintDestination.Kitchen3)) && ((ticket.StartTime == null) || (realStartTime <= DateTime.Now))); // Hide make tags on ticket voids and cancels if ((printOptions == TicketItemPrintOptions.AllAsVoid) || (printOptions == TicketItemPrintOptions.AllAsCancelMade) || (printOptions == TicketItemPrintOptions.AllAsCancelUnmade) || (printOptions == TicketItemPrintOptions.TicketRefund) || (printOptions == TicketItemPrintOptions.TicketItemReturn) || (printOptions == TicketItemPrintOptions.TicketItemVoid)) { showMakeTags = false; } foreach (TicketItem ticketItem in ticketItems) { PrintTicketItemToReceipt(printer, ticketItem, showMakeTags, printOptions, ticket.Type); } }
private void buttonLockWorkstation_Click(object sender, RoutedEventArgs e) { OrderEntryCommands.ExecuteLogoutCommand(); User32.LockWorkStation(); }
void StringsCore_LanguageChanged(object sender, EventArgs e) { QueryCurrentWeather(); OrderEntryCommands.SetupNoOrderCommands(); SetDisplayedTicketTypeToStatusBar(); }
private void buttonEndOfDay_Click(object sender, RoutedEventArgs e) { FunctionsContextMenu.IsOpen = false; PosHelper.EndOfDay(); OrderEntryCommands.UpdateTicketDetailCommands(); }
private static void PrintHeaderInformation(PrintDestination printDestination, PosPrinter printer, Ticket ticket, TicketItemPrintOptions printOptions) { // Print the receipt header image string filename = "receipt-header.gif"; if (File.Exists(filename)) { PrintToReceipt(printer, PrinterEscapeCodes.SetCenter); printer.PrintBitmap(PrinterStation.Receipt, filename, 200, PosPrinter.PrinterBitmapCenter); } // Occasion / Seating Information if (ConfigurationManager.UseSeating) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + ticket.Type.GetFriendlyName()); } // Print Ticket Number PrintLineToReceipt(printer, ((ticket.OrderId == null) ? "" : Strings.Order + ticket.OrderId.Value + ", ") + Strings.Ticket + ticket.PrimaryKey.Id); Person person = PersonManager.GetPersonByEmployeeId(ticket.EmployeeId); PrintLineToReceipt(printer, Strings.Employee + ": " + person.FirstName + " " + person.LastName.Substring(0, 1)); if (ticket.SeatingId > 0) { Seating seating = SeatingManager.GetSeating(ticket.SeatingId); PrintLineToReceipt(printer, Strings.Table + seating.Description); } // Print date and time (now, future time, or ticket close time) DateTime time = DateTime.Now; int? intValue = OrderEntryCommands.GetPrepTime().IntValue; if (printOptions == TicketItemPrintOptions.AllAsVoid) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.TicketVoid); } else if (printOptions == TicketItemPrintOptions.TicketRefund) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.TicketRefund); } else if (printOptions == TicketItemPrintOptions.AllAsCancelMade) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.TicketCancelMade); } else if (printOptions == TicketItemPrintOptions.AllAsCancelUnmade) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.TicketCancelUnmade); } else if (printOptions == TicketItemPrintOptions.TicketItemVoid) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.TicketItemVoid); } else if (printOptions == TicketItemPrintOptions.TicketItemReturn) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.TicketItemReturn); } else if (ticket.StartTime.HasValue && intValue.HasValue && ((ticket.StartTime.Value - new TimeSpan(0, 0, ticket.StartTime.Value.Second) - new TimeSpan(0, intValue.Value, 0)) >= time) && !ticket.IsClosed) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.FutureOrder); time = ticket.StartTime.Value; } else if (ticket.StartTime.HasValue && !ticket.IsClosed) { PrintLineToReceipt(printer, PrinterEscapeCodes.SetCenter + Strings.MakeNow); time = ticket.StartTime.Value; } if (ticket.IsClosed && ticket.CloseTime.HasValue) { time = ticket.CloseTime.Value; } PrintLineToReceipt(printer, time.ToShortDateString() + PrinterEscapeCodes.SetRight + time.ToShortTimeString()); // Newline PrintLineToReceipt(printer); // Customer's Information bool isKitchen = ((printDestination == PrintDestination.Kitchen1) || (printDestination == PrintDestination.Kitchen2) || (printDestination == PrintDestination.Kitchen3)); if (!isKitchen && (ticket.CustomerId > 0)) { person = PersonManager.GetPersonByCustomerId(ticket.CustomerId); PrintLineToReceipt(printer, person.FirstName + " " + person.LastName); if ((ticket.Type == TicketType.Delivery) || (ticket.Type == TicketType.Catering)) { ZipCode zipCode = ZipCode.Get(person.ZipCodeId); ZipCodeCity zipCodeCity = ZipCodeCity.Get(zipCode.CityId); ZipCodeState zipCodeState = ZipCodeState.Get(zipCodeCity.StateId); PrintLineToReceipt(printer, person.AddressLine1); if (!string.IsNullOrEmpty(person.AddressLine2)) { PrintLineToReceipt(printer, person.AddressLine2); } PrintLineToReceipt(printer, zipCodeCity.City + ", " + zipCodeState.Abbreviation + " " + zipCode.PostalCode.ToString("D5")); } if (person.PhoneNumberId1 > 0) { PhoneNumber phoneNumber = PhoneNumber.Get(person.PhoneNumberId1); PrintLineToReceipt(printer, phoneNumber.GetFormattedPhoneNumber()); } // Newline PrintLineToReceipt(printer); } }
private void buttonSuspend_Click(object sender, RoutedEventArgs e) { OrderEntryCommands.ExecuteLogoutCommand(); Powrprof.SetSuspendState(false, true, false); }
public void ClearSelection() { listBoxTransactions.SelectedItem = null; OrderEntryCommands.UpdateTicketItemButtons(); }
private void buttonExitProgram_Click(object sender, RoutedEventArgs e) { OrderEntryCommands.ExecuteLogoutCommand(); App.SwitchToDefaultDesktopOnClose = true; App.ShutdownApplication(); }