Exemplo n.º 1
0
        public async Task WhenAsync(MergePatchInOutLineMvoDto c)
        {
            var idObj         = InOutLineMvoProxyUtils.ToIdString((c as IMergePatchInOutLineMvo).InOutLineId);
            var uriParameters = new InOutLineMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new InOutLineMvoPatchRequest(uriParameters, (MergePatchInOutLineMvoDto)c);
            var resp = await _ramlClient.InOutLineMvo.Patch(req);

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new InOutLineMvosCountGetQuery();

            q.Filter = InOutLineMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new InOutLineMvosCountGetRequest();

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

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(long.Parse(await resp.RawContent.ReadAsStringAsync()));
        }
Exemplo n.º 3
0
        public async Task <IInOutLineMvoState> GetHistoryStateAsync(InOutLineId inOutLineId, long version)
        {
            var idObj         = InOutLineMvoProxyUtils.ToIdString(inOutLineId);
            var uriParameters = new InOutLineMvoHistoryStateUriParameters();

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

            var req  = new InOutLineMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.InOutLineMvoHistoryState.Get(req);

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToInOutLineMvoState());
        }
Exemplo n.º 4
0
        public async Task <IInOutLineMvoStateEvent> GetStateEventAsync(InOutLineId inOutLineId, long version)
        {
            var idObj         = InOutLineMvoProxyUtils.ToIdString(inOutLineId);
            var uriParameters = new InOutLineMvoStateEventUriParameters();

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

            var req  = new InOutLineMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.InOutLineMvoStateEvent.Get(req);

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
Exemplo n.º 5
0
        public async Task <IInOutLineMvoState> GetAsync(InOutLineId inOutLineId)
        {
            IInOutLineMvoState state = null;
            var idObj         = InOutLineMvoProxyUtils.ToIdString(inOutLineId);
            var uriParameters = new InOutLineMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new InOutLineMvoGetRequest(uriParameters);

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

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToInOutLineMvoState();
            return(state);
        }
Exemplo n.º 6
0
        public async Task <IEnumerable <IInOutLineMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IInOutLineMvoState> states = null;
            var q = new InOutLineMvosGetQuery();

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

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

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToInOutLineMvoState());
            return(states);
        }
Exemplo n.º 7
0
        public async Task WhenAsync(DeleteInOutLineMvoDto c)
        {
            var idObj         = InOutLineMvoProxyUtils.ToIdString((c as IDeleteInOutLineMvo).InOutLineId);
            var uriParameters = new InOutLineMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new InOutLineMvoDeleteQuery();

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

            var req = new InOutLineMvoDeleteRequest(uriParameters);

            req.Query = q;

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

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Exemplo n.º 8
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new InOutLineMvosCountGetQuery();

            q.Filter = InOutLineMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new InOutLineMvosCountGetRequest();

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

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