Esempio n. 1
0
        private UnifiedResponse.WaterMarkedAssetInfo UpdateWaterMarkedAssetInfo(UnifiedResponse.WaterMarkedAssetInfo data, string ParentAssetId)
        {
            TableOperation InsertOrReplace = TableOperation.InsertOrReplace(new UnifiedResponse.TWaterMarkedAssetInfo(data, ParentAssetId));

            _WaterMarkedAssetInfo.Execute(InsertOrReplace);
            return(data);
        }
 public TWaterMarkedAssetInfo(WaterMarkedAssetInfo Data, string ParentAssetID)
 {
     this.PartitionKey = ParentAssetID;
     this.State        = Data.State.ToString();
     this.RowKey       = Data.EmbebedCodeValue;
     this.AssetID      = Data.AssetID;
     this.Details      = Data.Details;
     this.EmbebedCode  = Data.EmbebedCodeValue;
 }
Esempio n. 3
0
        private UnifiedResponse.WaterMarkedAssetInfo GetWaterMarkedAssetInfo(string AssetId, string EmbebedCodeValue)
        {
            UnifiedResponse.WaterMarkedAssetInfo z = null;
            TableOperation retrieveOperation       = TableOperation.Retrieve <UnifiedResponse.TWaterMarkedAssetInfo>(AssetId, EmbebedCodeValue);
            TableResult    retrievedResult         = _WaterMarkedAssetInfo.Execute(retrieveOperation);

            if (retrievedResult.Result != null)
            {
                z = ((UnifiedResponse.TWaterMarkedAssetInfo)retrievedResult.Result).GetWaterMarkedAsssetInfo();
            }

            return(z);
        }
Esempio n. 4
0
        public UnifiedResponse.WaterMarkedAssetInfo EvalWaterMarkedAssetInfo(string ParentAssetID, string EmbebedCodeValue)
        {
            UnifiedResponse.WaterMarkedAssetInfo currentWaterMarkInfo = GetWaterMarkedAssetInfo(ParentAssetID, EmbebedCodeValue);

            if (currentWaterMarkInfo.State == ExecutionStatus.Running)
            {
                var wmrTable = tableClient.GetTableReference(ReferenceNames.WaterMarkedRender);
                wmrTable.CreateIfNotExists();

                TableQuery <UnifiedResponse.TWaterMarkedRender> query =
                    new TableQuery <UnifiedResponse.TWaterMarkedRender>().Where(TableQuery.GenerateFilterCondition(
                                                                                    "PartitionKey", QueryComparisons.Equal, $"{ParentAssetID}-{EmbebedCodeValue}"));

                var wmrList = wmrTable.ExecuteQuery(query);
                if (wmrList != null)
                {
                    var wmErrorList = wmrList.Where(m => m.State == ExecutionStatus.Error.ToString());
                    if (wmErrorList.Count() > 0)
                    {
                        //Error
                        currentWaterMarkInfo.State = ExecutionStatus.Error;
                        //Update EmbebedCode
                        currentWaterMarkInfo.State   = ExecutionStatus.Error;
                        currentWaterMarkInfo.Details = "";
                        foreach (var render in wmErrorList)
                        {
                            currentWaterMarkInfo.Details += $"{render.EmbebedCodeValue}: {render.Details} {Environment.NewLine}";
                        }
                    }
                    else
                    {
                        //Not Error
                        int finishcount = wmrList.Where(m => m.State == ExecutionStatus.Finished.ToString()).Count();
                        if (finishcount == wmrList.Count())
                        {
                            //Finish
                            currentWaterMarkInfo.State = ExecutionStatus.Finished;
                        }
                        currentWaterMarkInfo.Details = $"Ready {finishcount} of {wmrList.Count()}";
                    }
                }
                UpdateWaterMarkedAssetInfo(currentWaterMarkInfo, ParentAssetID);
            }

            return(currentWaterMarkInfo);
        }
        public UnifiedResponse.WaterMarkedRender GetWaterMarkedRender(string ParentAssetID, string EmbebedCodeValue, string RenderName)
        {
            UnifiedResponse.WaterMarkedRender    x   = null;
            UnifiedResponse.WaterMarkedAssetInfo wai = new UnifiedResponse.WaterMarkedAssetInfo()
            {
                AssetID = ParentAssetID,
            };
            TableOperation retrieveOperation = TableOperation.Retrieve <UnifiedResponse.TWaterMarkedRender>($"{ParentAssetID}-{EmbebedCodeValue}", RenderName);
            TableResult    retrievedResult   = _WaterMarkRenderTable.Execute(retrieveOperation);

            if (retrievedResult.Result != null)
            {
                x = ((UnifiedResponse.TWaterMarkedRender)retrievedResult.Result).GetWaterMarkedRender();
            }

            return(x);
        }
Esempio n. 6
0
        public UnifiedResponse.WaterMarkedRender GetWaterMarkedRender(string ParentAssetID, string EmbebedCodeValue, string RenderName)
        {
            UnifiedResponse.WaterMarkedRender    x   = null;
            UnifiedResponse.WaterMarkedAssetInfo wai = new UnifiedResponse.WaterMarkedAssetInfo()
            {
                AssetID = ParentAssetID,
            };
            var myTable = tableClient.GetTableReference(ReferenceNames.WaterMarkedRender);

            myTable.CreateIfNotExists();
            TableOperation retrieveOperation = TableOperation.Retrieve <UnifiedResponse.TWaterMarkedRender>($"{ParentAssetID}-{EmbebedCodeValue}", RenderName);
            TableResult    retrievedResult   = myTable.Execute(retrieveOperation);

            if (retrievedResult.Result != null)
            {
                x = ((UnifiedResponse.TWaterMarkedRender)retrievedResult.Result).GetWaterMarkedRender();
            }

            return(x);
        }