private void UpdateTicketOptions(TextBlockButton button) { if ((SessionManager.ActiveTicketItem == null) || (button == null)) { return; } // DEBUG: This isn't always going to be 'this' simple... If the ingredient // is already on, then it's might be getting removed (not added)... It // might also indicate the addition of extra. Change count (the constant '1', // in the Add() below) is always positive, even on deletions. It's a factor // that allows support for "extra-extra" type options. if (button.IsChecked == true) { if (!TicketItemOption.HasOption(SessionManager.ActiveTicketItem.PrimaryKey, GetId(button))) { TicketItemOption option = TicketItemOption.Add(SessionManager.ActiveTicketItem.PrimaryKey.Id, GetId(button), PosModels.Types.TicketItemOptionType.None, 1); } } else { TicketItemOption.Delete(SessionManager.ActiveTicketItem, GetId(button), true); } OrderEntryControl.UpdateDisplayedOrderAmount(); }
private void NotifyParent(bool sameButton) { Item item = SessionManager.ActiveItem; if ((SessionManager.ActiveCategory == null) || (item == null)) { return; } // Add a new item OrderEntryControl.ClearItemOptions(); SessionManager.ActiveItem = item; OrderEntryControl.AddItemToOrder(item); SessionManager.ActiveItem = item; OrderEntryControl.UpdateDisplayedOrderAmount(); OrderEntryControl.SetItemOptions(); }
private void UpdateTicketOptions(TextBlockButton button) { if (button.IsChecked == true) { if (!TicketItemOption.HasOption(SessionManager.ActiveTicketItem.PrimaryKey, GetId(button))) { TicketItemOption option = TicketItemOption.Add(SessionManager.ActiveTicketItem.PrimaryKey.Id, GetId(button), PosModels.Types.TicketItemOptionType.Add, 1); } } else { TicketItemOption.Delete( SessionManager.ActiveTicketItem, GetId(button), true); } OrderEntryControl.UpdateDisplayedOrderAmount(); }