示例#1
0
        public async Task WhenAsync(MergePatchShipmentReceiptMvoDto c)
        {
            var idObj         = ShipmentReceiptMvoProxyUtils.ToIdString((c as IMergePatchShipmentReceiptMvo).ShipmentReceiptId);
            var uriParameters = new ShipmentReceiptMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new ShipmentReceiptMvoPatchRequest(uriParameters, (MergePatchShipmentReceiptMvoDto)c);
            var resp = await _ramlClient.ShipmentReceiptMvo.Patch(req);

            ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
示例#2
0
        public async Task <IShipmentReceiptMvoState> GetHistoryStateAsync(ShipmentReceiptId shipmentReceiptId, long version)
        {
            var idObj         = ShipmentReceiptMvoProxyUtils.ToIdString(shipmentReceiptId);
            var uriParameters = new ShipmentReceiptMvoHistoryStateUriParameters();

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

            var req  = new ShipmentReceiptMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.ShipmentReceiptMvoHistoryState.Get(req);

            ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToShipmentReceiptMvoState());
        }
示例#3
0
        public async Task <IShipmentReceiptMvoEvent> GetStateEventAsync(ShipmentReceiptId shipmentReceiptId, long version)
        {
            var idObj         = ShipmentReceiptMvoProxyUtils.ToIdString(shipmentReceiptId);
            var uriParameters = new ShipmentReceiptMvoStateEventUriParameters();

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

            var req  = new ShipmentReceiptMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.ShipmentReceiptMvoStateEvent.Get(req);

            ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
示例#4
0
        public async Task <IShipmentReceiptMvoState> GetAsync(ShipmentReceiptId shipmentReceiptId)
        {
            IShipmentReceiptMvoState state = null;
            var idObj         = ShipmentReceiptMvoProxyUtils.ToIdString(shipmentReceiptId);
            var uriParameters = new ShipmentReceiptMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new ShipmentReceiptMvoGetRequest(uriParameters);

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

            ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToShipmentReceiptMvoState();
            return(state);
        }
示例#5
0
        public async Task <IEnumerable <IShipmentReceiptMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IShipmentReceiptMvoState> states = null;
            var q = new ShipmentReceiptMvosGetQuery();

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

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

            ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToShipmentReceiptMvoState());
            return(states);
        }
示例#6
0
        public async Task WhenAsync(DeleteShipmentReceiptMvoDto c)
        {
            var idObj         = ShipmentReceiptMvoProxyUtils.ToIdString((c as IDeleteShipmentReceiptMvo).ShipmentReceiptId);
            var uriParameters = new ShipmentReceiptMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new ShipmentReceiptMvoDeleteQuery();

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

            var req = new ShipmentReceiptMvoDeleteRequest(uriParameters);

            req.Query = q;

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

            ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
示例#7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new ShipmentReceiptMvosCountGetQuery();

            q.Filter = ShipmentReceiptMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new ShipmentReceiptMvosCountGetRequest();

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

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