コード例 #1
0
 private void ExecuteAutomationCommand(AutomationCommand automationCommand, string selectedValue, string nextValue)
 {
     if (!string.IsNullOrEmpty(automationCommand.Values) && !automationCommand.ToggleValues)
     {
         automationCommand.PublishEvent(EventTopicNames.SelectAutomationCommandValue);
     }
     else
     {
         ExecuteAutomationCommand(automationCommand.Name, selectedValue, nextValue);
         RefreshVisuals();
     }
 }
コード例 #2
0
ファイル: TicketViewModel.cs プロジェクト: savasl/SambaPOS-3
        private void ExecuteAutomationCommand(AutomationCommand automationCommand, string selectedValue)
        {
            if (!string.IsNullOrEmpty(automationCommand.Values) && !automationCommand.ToggleValues)
            {
                automationCommand.PublishEvent(EventTopicNames.SelectAutomationCommandValue);
            }
            else
            {
                if (SelectedOrders.Any())
                {
                    foreach (var selectedOrder in SelectedOrders.ToList())
                    {
                        _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted,
                                                      new
                        {
                            Ticket = SelectedTicket,
                            Order  = selectedOrder,
                            AutomationCommandName = automationCommand.Name,
                            Value = selectedValue
                        });
                    }
                }
                else
                {
                    _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted,
                                                  new
                    {
                        Ticket = SelectedTicket,
                        AutomationCommandName = automationCommand.Name,
                        Value = selectedValue
                    });
                }

                _ticketOrdersViewModel.SelectedTicket = SelectedTicket;
                ClearSelectedItems();
                ClearSelection = true;
                RefreshVisuals();
            }
        }