Exemplo n.º 1
0
 public override void Process(ActionData actionData)
 {
     var entityId = actionData.GetDataValueAsInt("EntityId");
     var entityTypeId = actionData.GetDataValueAsInt("EntityTypeId");
     var stateName = actionData.GetAsString("EntityStateName");
     var state = actionData.GetAsString("EntityState");
     var quantityExp = actionData.GetAsString("QuantityExp");
     if (state != null)
     {
         if (entityId > 0 && entityTypeId > 0)
         {
             _entityServiceClient.UpdateEntityState(entityId, entityTypeId, stateName, state, quantityExp);
         }
         else
         {
             var ticket = actionData.GetDataValue<Ticket>("Ticket");
             if (ticket != null)
             {
                 var entityTypeName = actionData.GetAsString("EntityTypeName");
                 foreach (var ticketEntity in ticket.TicketEntities)
                 {
                     var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId);
                     if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName)
                         _entityServiceClient.UpdateEntityState(ticketEntity.EntityId, ticketEntity.EntityTypeId, stateName, state, quantityExp);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        public override void Process(ActionData actionData)
        {
            var entityId     = actionData.GetDataValueAsInt("EntityId");
            var entityTypeId = actionData.GetDataValueAsInt("EntityTypeId");
            var stateName    = actionData.GetAsString("EntityStateName");
            var state        = actionData.GetAsString("EntityState");
            var quantityExp  = actionData.GetAsString("QuantityExp");

            if (state != null)
            {
                if (entityId > 0 && entityTypeId > 0)
                {
                    _entityServiceClient.UpdateEntityState(entityId, entityTypeId, stateName, state, quantityExp);
                }
                else
                {
                    var ticket = actionData.GetDataValue <Ticket>("Ticket");
                    if (ticket != null)
                    {
                        var entityTypeName = actionData.GetAsString("EntityTypeName");
                        foreach (var ticketEntity in ticket.TicketEntities)
                        {
                            var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId);
                            if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName)
                            {
                                _entityServiceClient.UpdateEntityState(ticketEntity.EntityId, ticketEntity.EntityTypeId, stateName, state, quantityExp);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 public override void Process(ActionData actionData)
 {
     var entityId = actionData.GetDataValueAsInt("EntityId");
     var entityName = actionData.GetAsString("EntityName");
     var fieldName = actionData.GetAsString("FieldName");
     var value = actionData.GetAsString("FieldValue");
     if (entityId > 0)
     {
         _entityServiceClient.UpdateEntityData(entityId, fieldName, value);
     }
     else if (!string.IsNullOrEmpty(entityName))
     {
         var entityTypeName = actionData.GetAsString("EntityTypeName");
         var entityType = _cacheService.GetEntityTypeByName(entityTypeName);
         if (entityType != null)
         {
             _entityServiceClient.UpdateEntityData(entityType, entityName, fieldName, value);
         }
     }
     else
     {
         var ticket = actionData.GetDataValue<Ticket>("Ticket");
         if (ticket != null)
         {
             var entityTypeName = actionData.GetAsString("EntityTypeName");
             foreach (var ticketEntity in ticket.TicketEntities)
             {
                 var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId);
                 if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName)
                     _entityServiceClient.UpdateEntityData(ticketEntity.EntityId, fieldName, value);
             }
         }
     }
 }
Exemplo n.º 4
0
 public override void Process(ActionData actionData)
 {
     var ticketId = actionData.GetDataValueAsInt("TicketId");
     if (ticketId > 0 && !_applicationState.IsLocked)
     {
         var ticket = _ticketService.OpenTicket(ticketId);
         ticket.PublishEvent(EventTopicNames.SetSelectedTicket);
     }
     EventServiceFactory.EventService.PublishEvent(EventTopicNames.CreateTicket);
 }
        public override void Process(ActionData actionData)
        {
            var ticketId = actionData.GetDataValueAsInt("TicketId");

            if (ticketId > 0 && !_applicationState.IsLocked)
            {
                var ticket = _ticketService.OpenTicket(ticketId);
                ticket.PublishEvent(EventTopicNames.SetSelectedTicket);
            }
            EventServiceFactory.EventService.PublishEvent(EventTopicNames.CreateTicket);
        }
Exemplo n.º 6
0
        public override void Process(ActionData actionData)
        {
            var entityId   = actionData.GetDataValueAsInt("EntityId");
            var entityName = actionData.GetAsString("EntityName");
            var fieldName  = actionData.GetAsString("FieldName");
            var value      = actionData.GetAsString("FieldValue");

            if (entityId > 0)
            {
                _entityServiceClient.UpdateEntityData(entityId, fieldName, value);
            }
            else if (!string.IsNullOrEmpty(entityName))
            {
                var entityTypeName = actionData.GetAsString("EntityTypeName");
                var entityType     = _cacheService.GetEntityTypeByName(entityTypeName);
                if (entityType != null)
                {
                    _entityServiceClient.UpdateEntityData(entityType, entityName, fieldName, value);
                }
            }
            else
            {
                var ticket = actionData.GetDataValue <Ticket>("Ticket");
                if (ticket != null)
                {
                    var entityTypeName = actionData.GetAsString("EntityTypeName");
                    foreach (var ticketEntity in ticket.TicketEntities)
                    {
                        var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId);
                        if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName)
                        {
                            _entityServiceClient.UpdateEntityData(ticketEntity.EntityId, fieldName, value);
                        }
                    }
                }
            }

            var entity = actionData.GetDataValue <Entity>("Entity");

            if (entity != null && entity.Id == entityId)
            {
                entity.SetCustomData(fieldName, value);
            }
        }