예제 #1
0
        public async Task WhenAsync(MergePatchOrganizationStructureTypeDto c)
        {
            var idObj         = (c as IMergePatchOrganizationStructureType).Id;
            var uriParameters = new OrganizationStructureTypeUriParameters();

            uriParameters.Id = idObj;

            var req  = new OrganizationStructureTypePatchRequest(uriParameters, (MergePatchOrganizationStructureTypeDto)c);
            var resp = await _ramlClient.OrganizationStructureType.Patch(req);

            OrganizationStructureTypeProxyUtils.ThrowOnHttpResponseError(resp);
        }
예제 #2
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new OrganizationStructureTypesCountGetQuery();

            q.Filter = OrganizationStructureTypeProxyUtils.GetFilterQueryValueString(filter);
            var req = new OrganizationStructureTypesCountGetRequest();

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

            OrganizationStructureTypeProxyUtils.ThrowOnHttpResponseError(resp);
            return(long.Parse(await resp.RawContent.ReadAsStringAsync()));
        }
예제 #3
0
        public async Task <IOrganizationStructureTypeStateEvent> GetStateEventAsync(string id, long version)
        {
            var idObj         = id;
            var uriParameters = new OrganizationStructureTypeStateEventUriParameters();

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

            var req  = new OrganizationStructureTypeStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.OrganizationStructureTypeStateEvent.Get(req);

            OrganizationStructureTypeProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
        public async Task <IOrganizationStructureTypeState> GetHistoryStateAsync(string id, long version)
        {
            var idObj         = id;
            var uriParameters = new OrganizationStructureTypeHistoryStateUriParameters();

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

            var req  = new OrganizationStructureTypeHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.OrganizationStructureTypeHistoryState.Get(req);

            OrganizationStructureTypeProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToOrganizationStructureTypeState());
        }
예제 #5
0
        public async Task <IOrganizationStructureTypeState> GetAsync(string id)
        {
            IOrganizationStructureTypeState state = null;
            var idObj         = id;
            var uriParameters = new OrganizationStructureTypeUriParameters();

            uriParameters.Id = idObj;

            var req = new OrganizationStructureTypeGetRequest(uriParameters);

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

            OrganizationStructureTypeProxyUtils.ThrowOnHttpResponseError(resp);
            state = resp.Content;
            return(state);
        }
예제 #6
0
        public async Task <IEnumerable <IOrganizationStructureTypeState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IOrganizationStructureTypeState> states = null;
            var q = new OrganizationStructureTypesGetQuery();

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

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

            OrganizationStructureTypeProxyUtils.ThrowOnHttpResponseError(resp);
            states = resp.Content;
            return(states);
        }
예제 #7
0
        public async Task WhenAsync(DeleteOrganizationStructureTypeDto c)
        {
            var idObj         = (c as IDeleteOrganizationStructureType).Id;
            var uriParameters = new OrganizationStructureTypeUriParameters();

            uriParameters.Id = idObj;

            var q = new OrganizationStructureTypeDeleteQuery();

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

            var req = new OrganizationStructureTypeDeleteRequest(uriParameters);

            req.Query = q;

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

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

            q.Filter = OrganizationStructureTypeProxyUtils.GetFilterQueryValueString(filter);
            var req = new OrganizationStructureTypesCountGetRequest();

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

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