Esempio n. 1
0
        public MMRKStatus UpdateMMRKStatus(MMRKStatus mmrkStatus)
        {
            //Update MMRK Status
            TMMRKStatus    myStatus        = new TMMRKStatus(mmrkStatus);
            TableOperation InsertOrReplace = TableOperation.InsertOrReplace(myStatus);

            _MMRKSttausTable.Execute(InsertOrReplace);
            return(mmrkStatus);
        }
        public async Task <MMRKStatus> UpdateMMRKStatus(MMRKStatus mmrkStatus)
        {
            //Update MMRK Status
            TMMRKStatus    myStatus        = new TMMRKStatus(mmrkStatus);
            TableOperation InsertOrReplace = TableOperation.InsertOrReplace(myStatus);
            await _MMRKSttausTable.ExecuteAsync(InsertOrReplace);

            return(mmrkStatus);
        }
Esempio n. 3
0
        public MMRKStatus GetMMRKStatus(string AsssetId, string JobRender)
        {
            MMRKStatus     myData            = null;
            TableOperation retrieveOperation = TableOperation.Retrieve <TMMRKStatus>(AsssetId, JobRender);
            TableResult    retrievedResult   = _MMRKSttausTable.Execute(retrieveOperation);

            if (retrievedResult.Result != null)
            {
                var Status = ((TMMRKStatus)retrievedResult.Result);
                myData = Status.GetMMRKStatus();
            }
            return(myData);
        }
        public static async Task <HttpResponseMessage> UpdateMMRKStatus([HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequestMessage req, TraceWriter log)
        {
            dynamic BodyData = await req.Content.ReadAsAsync <object>();

            //Create JobStatus from body data
            MMRKStatus MMRK = BodyData.ToObject <MMRKStatus>();

            //Save Status
            IActionsProvider myActions = ActionProviderFactory.GetActionProvider();

            if (MMRK.FileURL == "{NO UPDATE}")
            {
                string jobRender         = $"[{MMRK.JobID}]{MMRK.FileName}";
                var    currentMMRKStatus = myActions.GetMMRKStatus(MMRK.AssetID, jobRender);
                string url = currentMMRKStatus.FileURL;
                MMRK.FileURL = url;
            }
            myActions.UpdateMMRKStatus(MMRK);
            return(req.CreateResponse(HttpStatusCode.OK, MMRK, JsonMediaTypeFormatter.DefaultMediaType));
        }