コード例 #1
0
        private void OnSelectEntityExecuted(EntityScreenItemViewModel obj)
        {
            if (!string.IsNullOrWhiteSpace(AutomationCommandName))
            {
                var commandValue = obj.Model.EntityState;
                if (!string.IsNullOrWhiteSpace(AutomationCommandValue))
                {
                    commandValue = AutomationCommandValue;
                    if (commandValue.Contains("{"))
                    {
                        var entity = _cacheService.GetEntityById(obj.Model.EntityId);
                        commandValue = _printerService.ExecuteFunctions(commandValue, entity);
                    }
                }

                _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted,
                                              new
                {
                    Ticket                = Ticket.Empty,
                    EntityId              = obj.Model.EntityId,
                    EntityTypeId          = SelectedEntityScreen.EntityTypeId,
                    AutomationCommandName = AutomationCommandName,
                    CommandValue          = commandValue
                });
                return;
            }
            if (obj.Model.EntityId > 0 && obj.Model.ItemId == 0)
            {
                _currentOperationRequest.Publish(_cacheService.GetEntityById(obj.Model.EntityId));
            }
            else if (obj.Model.ItemId > 0)
            {
                ExtensionMethods.PublishIdEvent(obj.Model.ItemId, EventTopicNames.DisplayTicket);
            }
        }
コード例 #2
0
 private void OnSelectEntityExecuted(EntityScreenItemViewModel obj)
 {
     if (obj.Model.EntityId > 0 && obj.Model.ItemId == 0)
     {
         _currentOperationRequest.Publish(_cacheService.GetEntityById(obj.Model.EntityId));
     }
     else if (obj.Model.ItemId > 0)
     {
         ExtensionMethods.PublishIdEvent(obj.Model.ItemId, EventTopicNames.DisplayTicket);
     }
 }
コード例 #3
0
        private void OnSelectEntityExecuted(EntityScreenItemViewModel obj)
        {
            if (!string.IsNullOrWhiteSpace(AutomationCommandName))
            {
                var commandValue = obj.Model.EntityState;
                if (!string.IsNullOrWhiteSpace(AutomationCommandValue))
                {
                    commandValue = AutomationCommandValue;
                    if (commandValue.Contains("{"))
                    {
                        var entity = _cacheService.GetEntityById(obj.Model.EntityId);
                        commandValue = _printerService.ExecuteFunctions(commandValue, entity);
                    }
                }

                _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted,
                                              new
                                                  {
                                                      Ticket = Ticket.Empty,
                                                      EntityId = obj.Model.EntityId,
                                                      EntityTypeId = SelectedEntityScreen.EntityTypeId,
                                                      AutomationCommandName = AutomationCommandName,
                                                      CommandValue = commandValue
                                                  });
                return;
            }
            if (obj.Model.EntityId > 0 && obj.Model.ItemId == 0)
                _currentOperationRequest.Publish(_cacheService.GetEntityById(obj.Model.EntityId));
            else if (obj.Model.ItemId > 0)
            {
                ExtensionMethods.PublishIdEvent(obj.Model.ItemId, EventTopicNames.DisplayTicket);
            }
        }
コード例 #4
0
 private void OnSelectEntityExecuted(EntityScreenItemViewModel obj)
 {
     if (obj.Model.EntityId > 0 && obj.Model.ItemId == 0)
         _currentOperationRequest.Publish(_cacheService.GetEntityById(obj.Model.EntityId));
     else if (obj.Model.ItemId > 0)
     {
         ExtensionMethods.PublishIdEvent(obj.Model.ItemId, EventTopicNames.DisplayTicket);
     }
 }