Exemple #1
0
        public TaskExecutionMessage Execute(TaskExecutionPayload payloadObj)
        {
            IEntityQueryManager entityQueryManager = new EntityQueryManager();
            var draftId          = entityQueryManager.GetSpecificIdByQuery(payloadObj.TenantId, "Product", payloadObj.Id, "DraftVersion");
            var executionMessage = new TaskExecutionMessage();


            if (draftId != null)
            {
                executionMessage.Message = TaskExecutionCode.AlreadyAdded;
                return(executionMessage);
            }
            var versionId = entityQueryManager.GetSpecificIdByQuery(payloadObj.TenantId, "Product", payloadObj.Id, "ActiveVersion");
            var cloneId   = entityQueryManager.SelectInsert("ProductVersion", payloadObj.TenantId, versionId, Guid.Empty);

            if (cloneId != Guid.Empty)
            {
                var updateStatus = entityQueryManager.UpdateSpecificField(payloadObj.TenantId, "Product", payloadObj.Id, "DraftVersion", cloneId.ToString());

                executionMessage.Message = TaskExecutionCode.Redirect;
                executionMessage.Id      = cloneId;
                return(executionMessage);
            }
            return(null);
        }
Exemple #2
0
        public TaskExecutionMessage Execute(TaskExecutionPayload payloadObj)
        {
            IManagerBatchItem batchItem = new ManagerBatchItem();
            var status           = batchItem.BatchItemUpdateNextRunTime(payloadObj.TenantId, payloadObj.Id);
            var executionMessage = new TaskExecutionMessage();

            executionMessage.Message = TaskExecutionCode.Success;
            return(executionMessage);
        }