예제 #1
0
        protected async Task <OfflineResponse> ExecuteOfflineRequest(List <IFunction> functions, RequestConfig requestConfig = null)
        {
            if (requestConfig == null)
            {
                requestConfig = new RequestConfig();
            }

            RequestHandler requestHandler = new RequestHandler(this.Config, requestConfig);

            OfflineResponse response = await requestHandler.ExecuteOffline(functions).ConfigureAwait(false);

            return(response);
        }
예제 #2
0
        /// <summary>
        /// Execute multiple Intacct API functions
        /// </summary>
        /// <param name="apiFunctions"></param>
        /// <param name="requestConfig"></param>
        /// <returns></returns>
        public async Task <OnlineResponse> ExecuteBatch(List <IFunction> apiFunctions, RequestConfig requestConfig = null)
        {
            if (requestConfig == null)
            {
                requestConfig = new RequestConfig();
            }

            OnlineResponse response = await this.ExecuteOnlineRequest(apiFunctions, requestConfig).ConfigureAwait(false);

            if (requestConfig.Transaction == true)
            {
                foreach (Result result in response.Results)
                {
                    result.EnsureStatusNotFailure();
                }
            }

            return(response);
        }
예제 #3
0
        /// <summary>
        /// Execute multiple functions to the Intacct API
        /// </summary>
        /// <param name="apiFunctions"></param>
        /// <param name="requestConfig"></param>
        /// <returns></returns>
        public async Task <OfflineResponse> ExecuteBatch(List <IFunction> apiFunctions, RequestConfig requestConfig = null)
        {
            if (requestConfig == null)
            {
                requestConfig = new RequestConfig();
            }

            return(await this.ExecuteOfflineRequest(apiFunctions, requestConfig).ConfigureAwait(false));
        }