Пример #1
0
        public async Task WhenAsync(MergePatchShipmentPackageContentMvoDto c)
        {
            var idObj         = ShipmentPackageContentMvoProxyUtils.ToIdString((c as IMergePatchShipmentPackageContentMvo).ShipmentPackageContentId);
            var uriParameters = new ShipmentPackageContentMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new ShipmentPackageContentMvoPatchRequest(uriParameters, (MergePatchShipmentPackageContentMvoDto)c);
            var resp = await _ramlClient.ShipmentPackageContentMvo.Patch(req);

            ShipmentPackageContentMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Пример #2
0
        public async Task <IShipmentPackageContentMvoState> GetHistoryStateAsync(ShipmentPackageContentId shipmentPackageContentId, long version)
        {
            var idObj         = ShipmentPackageContentMvoProxyUtils.ToIdString(shipmentPackageContentId);
            var uriParameters = new ShipmentPackageContentMvoHistoryStateUriParameters();

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

            var req  = new ShipmentPackageContentMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.ShipmentPackageContentMvoHistoryState.Get(req);

            ShipmentPackageContentMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToShipmentPackageContentMvoState());
        }
Пример #3
0
        public async Task <IShipmentPackageContentMvoEvent> GetStateEventAsync(ShipmentPackageContentId shipmentPackageContentId, long version)
        {
            var idObj         = ShipmentPackageContentMvoProxyUtils.ToIdString(shipmentPackageContentId);
            var uriParameters = new ShipmentPackageContentMvoStateEventUriParameters();

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

            var req  = new ShipmentPackageContentMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.ShipmentPackageContentMvoStateEvent.Get(req);

            ShipmentPackageContentMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
Пример #4
0
        public async Task <IShipmentPackageContentMvoState> GetAsync(ShipmentPackageContentId shipmentPackageContentId)
        {
            IShipmentPackageContentMvoState state = null;
            var idObj         = ShipmentPackageContentMvoProxyUtils.ToIdString(shipmentPackageContentId);
            var uriParameters = new ShipmentPackageContentMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new ShipmentPackageContentMvoGetRequest(uriParameters);

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

            ShipmentPackageContentMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToShipmentPackageContentMvoState();
            return(state);
        }
Пример #5
0
        public async Task <IEnumerable <IShipmentPackageContentMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IShipmentPackageContentMvoState> states = null;
            var q = new ShipmentPackageContentMvosGetQuery();

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

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

            ShipmentPackageContentMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToShipmentPackageContentMvoState());
            return(states);
        }
Пример #6
0
        public async Task WhenAsync(DeleteShipmentPackageContentMvoDto c)
        {
            var idObj         = ShipmentPackageContentMvoProxyUtils.ToIdString((c as IDeleteShipmentPackageContentMvo).ShipmentPackageContentId);
            var uriParameters = new ShipmentPackageContentMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new ShipmentPackageContentMvoDeleteQuery();

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

            var req = new ShipmentPackageContentMvoDeleteRequest(uriParameters);

            req.Query = q;

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

            ShipmentPackageContentMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Пример #7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new ShipmentPackageContentMvosCountGetQuery();

            q.Filter = ShipmentPackageContentMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new ShipmentPackageContentMvosCountGetRequest();

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

            ShipmentPackageContentMvoProxyUtils.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));
        }