//
        public override void DoCreate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var resultData = maximoTemplateData.InvokeProxy();
            var id         = string.Empty;

            maximoTemplateData.ResultObject = new MaximoResult(id, resultData);
        }
Exemple #2
0
        public void UpdateStatus(UpdateStatusOperationData opData)
        {
            MaximoOperationExecutionContext maximoExecutionContext = GetContext(opData);
            var    user = SecurityFacade.CurrentUser();
            object wo   = maximoExecutionContext.IntegrationObject;

            //just to validate that the json can be converted to a num
            WsUtil.SetValue(wo, "wonum", opData.wonum);
            var    woStatus    = WsUtil.SetValue(wo, "STATUS", opData.status);
            var    statusDate  = WsUtil.SetValue(wo, "STATUSDATE", opData.statusdate ?? DateTime.Now.FromServerToRightKind());
            object statusIFace = WsUtil.SetValue(wo, "STATUSIFACE", true);
            var    nemo        = ReflectionUtil.InstantiateProperty(wo, "NP_STATUSMEMO", new { Value = WsUtil.GetRealValue(wo, "MEMO") });

            WsUtil.SetChanged(nemo, statusIFace, statusDate, woStatus);
            maximoExecutionContext.InvokeProxy();
        }
        public override void DoUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var resultData = maximoTemplateData.InvokeProxy();
            var data       = resultData.ToString();

            Log.DebugFormat("Receiving response from ISM update {0}", data);
            var resultDataValues   = ParseResultData(data);
            var idProperty         = resultDataValues["requesterid"];
            var transactionComment = resultDataValues["comment"];

            if (transactionComment != "Success - No Errors Encountered")
            {
                throw new Exception("ISM Web Service Did Not Return a Successful Response: " + transactionComment);
            }
            maximoTemplateData.ResultObject = new MaximoResult(idProperty, null);
        }