Ejemplo n.º 1
0
        public async Task WhenAsync(MergePatchItemIssuanceMvoDto c)
        {
            var idObj         = ItemIssuanceMvoProxyUtils.ToIdString((c as IMergePatchItemIssuanceMvo).ShipmentItemIssuanceId);
            var uriParameters = new ItemIssuanceMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new ItemIssuanceMvoPatchRequest(uriParameters, (MergePatchItemIssuanceMvoDto)c);
            var resp = await _ramlClient.ItemIssuanceMvo.Patch(req);

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Ejemplo n.º 2
0
        public async Task <IItemIssuanceMvoState> GetHistoryStateAsync(ShipmentItemIssuanceId shipmentItemIssuanceId, long version)
        {
            var idObj         = ItemIssuanceMvoProxyUtils.ToIdString(shipmentItemIssuanceId);
            var uriParameters = new ItemIssuanceMvoHistoryStateUriParameters();

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

            var req  = new ItemIssuanceMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.ItemIssuanceMvoHistoryState.Get(req);

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToItemIssuanceMvoState());
        }
Ejemplo n.º 3
0
        public async Task <IItemIssuanceMvoEvent> GetStateEventAsync(ShipmentItemIssuanceId shipmentItemIssuanceId, long version)
        {
            var idObj         = ItemIssuanceMvoProxyUtils.ToIdString(shipmentItemIssuanceId);
            var uriParameters = new ItemIssuanceMvoStateEventUriParameters();

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

            var req  = new ItemIssuanceMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.ItemIssuanceMvoStateEvent.Get(req);

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
Ejemplo n.º 4
0
        public async Task <IItemIssuanceMvoState> GetAsync(ShipmentItemIssuanceId shipmentItemIssuanceId)
        {
            IItemIssuanceMvoState state = null;
            var idObj         = ItemIssuanceMvoProxyUtils.ToIdString(shipmentItemIssuanceId);
            var uriParameters = new ItemIssuanceMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new ItemIssuanceMvoGetRequest(uriParameters);

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

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToItemIssuanceMvoState();
            return(state);
        }
Ejemplo n.º 5
0
        public async Task <IEnumerable <IItemIssuanceMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IItemIssuanceMvoState> states = null;
            var q = new ItemIssuanceMvosGetQuery();

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

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

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToItemIssuanceMvoState());
            return(states);
        }
Ejemplo n.º 6
0
        public async Task WhenAsync(DeleteItemIssuanceMvoDto c)
        {
            var idObj         = ItemIssuanceMvoProxyUtils.ToIdString((c as IDeleteItemIssuanceMvo).ShipmentItemIssuanceId);
            var uriParameters = new ItemIssuanceMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new ItemIssuanceMvoDeleteQuery();

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

            var req = new ItemIssuanceMvoDeleteRequest(uriParameters);

            req.Query = q;

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

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Ejemplo n.º 7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new ItemIssuanceMvosCountGetQuery();

            q.Filter = ItemIssuanceMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new ItemIssuanceMvosCountGetRequest();

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

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