コード例 #1
0
ファイル: TagService.cs プロジェクト: rtbhosale/SmartTouch
        public WorkflowRemoveTagResponse RemoveTag(WorkflowRemoveTagRequest request)
        {
            Logger.Current.Informational("Request received for removing a tag for a contact");
            WorkflowRemoveTagResponse response = new WorkflowRemoveTagResponse();

            if (request.TagId != 0 && request.ContactId != 0)
            {
                tagRepository.DeleteForContact(request.TagId, request.ContactId, request.AccountId);
                accountService.InsertIndexingData(new InsertIndexingDataRequest()
                {
                    IndexingData = new Domain.Accounts.IndexingData()
                    {
                        EntityIDs = new List <int>()
                        {
                            request.ContactId
                        }, IndexType = (int)IndexType.Contacts
                    }
                });
                addToTopic(request.TagId, request.AccountId, request.ContactId, request.CreatedBy, false);
            }
            return(response);
        }
コード例 #2
0
        public override void OnEntry(Message message)
        {
            Console.WriteLine("Removed tag entered" + ", message: " + message.MessageId);
            Logger.Current.Informational("Request received for processing TagRemove state." + ", message: " + message.ToString());
            WorkflowRemoveTagResponse response = tagService.RemoveTag(new WorkflowRemoveTagRequest()
            {
                TagId     = EntityId,
                ContactId = message.ContactId,
                CreatedBy = CreatedBy,
                AccountId = message.AccountId
            });

            if (response.Exception == null)
            {
                workflowService.InsertContactWorkflowAudit(new InsertContactWorkflowAuditRequest()
                {
                    WorkflowId       = WorkflowId,
                    WorkflowActionId = StateId,
                    ContactId        = message.ContactId,
                    AccountId        = message.AccountId,
                    MessageId        = message.MessageId
                });
            }
        }