Exemple #1
0
        public static async Task <SalesOrderServiceCreateResponse> Call(AxdSalesOrder order)
        {
            SalesOrderServiceClient client = new SalesOrderServiceClient();

            AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
            return(await client.createAsync(order));
        }
Exemple #2
0
        public ActionResult Index(SalesOrderModel model)
        {
            var client = new SalesOrderServiceClient();
            var sales  = client.GetSales(model.StartDate, model.EndDate, model.Name).ToList();

            model.Items = sales;
            return(View(model));
        }
Exemple #3
0
        public ActionResult Detail(string id)
        {
            var model = new SalesOrderModel();

            if (!string.IsNullOrEmpty(id))
            {
                var salesOrderID = int.Parse(id);
                if (salesOrderID > 0)
                {
                    var client       = new SalesOrderServiceClient();
                    var orderDetails = client.GetSalesOrderDetailBySalesOrderID(salesOrderID).ToList();
                    model.Items = orderDetails;
                }
            }

            return(View(model));
        }
        private static void AddWCFServices(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddScoped<IAddressTypeService>(provider =>
            {
                var client = new AddressTypeServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["AddressTypeAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<IContactTypeService>(provider =>
            {
                var client = new ContactTypeServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["ContactTypeAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<ICountryService>(provider =>
            {
                var client = new CountryServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["CountryAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<ICustomerService>(provider =>
            {
                var client = new CustomerServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["CustomerAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<ISalesOrderService>(provider =>
            {
                var client = new SalesOrderServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["SalesOrderAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<ISalesPersonService>(provider =>
            {
                var client = new SalesPersonServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["SalesPersonAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<ISalesTerritoryService>(provider =>
            {
                var client = new SalesTerritoryServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["SalesTerritoryAPI:Uri"])
                );

                return client;
            });
            services.AddScoped<IStateProvinceService>(provider =>
            {
                var client = new StateProvinceServiceClient(
                    new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue },
                    new EndpointAddress(configuration["StateProvinceAPI:Uri"])
                );

                return client;
            });
        }
Exemple #5
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(SalesOrderServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpsBinding_ISalesOrderService));
 }
Exemple #6
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(SalesOrderServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpsBinding_ISalesOrderService));
 }
Exemple #7
0
 public SalesOrderServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(SalesOrderServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Exemple #8
0
 public SalesOrderServiceClient(EndpointConfiguration endpointConfiguration) :
     base(SalesOrderServiceClient.GetBindingForEndpoint(endpointConfiguration), SalesOrderServiceClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Exemple #9
0
 public SalesOrderServiceClient() :
     base(SalesOrderServiceClient.GetDefaultBinding(), SalesOrderServiceClient.GetDefaultEndpointAddress())
 {
     this.Endpoint.Name = EndpointConfiguration.BasicHttpsBinding_ISalesOrderService.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }