Exemple #1
0
        public async Task WhenAsync(MergePatchInventoryItemEntryMvoDto c)
        {
            var idObj         = InventoryItemEntryMvoProxyUtils.ToIdString((c as IMergePatchInventoryItemEntryMvo).InventoryItemEntryId);
            var uriParameters = new InventoryItemEntryMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new InventoryItemEntryMvoPatchRequest(uriParameters, (MergePatchInventoryItemEntryMvoDto)c);
            var resp = await _ramlClient.InventoryItemEntryMvo.Patch(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Exemple #2
0
        public async Task <IInventoryItemEntryMvoState> GetHistoryStateAsync(InventoryItemEntryId inventoryItemEntryId, long version)
        {
            var idObj         = InventoryItemEntryMvoProxyUtils.ToIdString(inventoryItemEntryId);
            var uriParameters = new InventoryItemEntryMvoHistoryStateUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new InventoryItemEntryMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.InventoryItemEntryMvoHistoryState.Get(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToInventoryItemEntryMvoState());
        }
Exemple #3
0
        public async Task <IInventoryItemEntryMvoEvent> GetStateEventAsync(InventoryItemEntryId inventoryItemEntryId, long version)
        {
            var idObj         = InventoryItemEntryMvoProxyUtils.ToIdString(inventoryItemEntryId);
            var uriParameters = new InventoryItemEntryMvoStateEventUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new InventoryItemEntryMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.InventoryItemEntryMvoStateEvent.Get(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
Exemple #4
0
        public async Task <IInventoryItemEntryMvoState> GetAsync(InventoryItemEntryId inventoryItemEntryId)
        {
            IInventoryItemEntryMvoState state = null;
            var idObj         = InventoryItemEntryMvoProxyUtils.ToIdString(inventoryItemEntryId);
            var uriParameters = new InventoryItemEntryMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new InventoryItemEntryMvoGetRequest(uriParameters);

            var resp = await _ramlClient.InventoryItemEntryMvo.Get(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToInventoryItemEntryMvoState();
            return(state);
        }
Exemple #5
0
        public async Task <IEnumerable <IInventoryItemEntryMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IInventoryItemEntryMvoState> states = null;
            var q = new InventoryItemEntryMvosGetQuery();

            q.FirstResult = firstResult;
            q.MaxResults  = maxResults;
            q.Sort        = InventoryItemEntryMvoProxyUtils.GetOrdersQueryValueString(orders);
            q.Fields      = InventoryItemEntryMvoProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator);
            q.Filter      = InventoryItemEntryMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new InventoryItemEntryMvosGetRequest();

            req.Query = q;
            var resp = await _ramlClient.InventoryItemEntryMvos.Get(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToInventoryItemEntryMvoState());
            return(states);
        }
Exemple #6
0
        public async Task WhenAsync(DeleteInventoryItemEntryMvoDto c)
        {
            var idObj         = InventoryItemEntryMvoProxyUtils.ToIdString((c as IDeleteInventoryItemEntryMvo).InventoryItemEntryId);
            var uriParameters = new InventoryItemEntryMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new InventoryItemEntryMvoDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.InventoryItemVersion);

            var req = new InventoryItemEntryMvoDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.InventoryItemEntryMvo.Delete(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Exemple #7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new InventoryItemEntryMvosCountGetQuery();

            q.Filter = InventoryItemEntryMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new InventoryItemEntryMvosCountGetRequest();

            req.Query = q;
            var resp = await _ramlClient.InventoryItemEntryMvosCount.Get(req);

            InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            string str = await resp.RawContent.ReadAsStringAsync();

            if (str.StartsWith("\""))
            {
                str = str.Substring(1);
            }
            if (str.EndsWith("\""))
            {
                str = str.Substring(0, str.Length - 1);
            }
            return(long.Parse(str));
        }