private async void AddOrder() { var ipServidor = await SecureStorage.GetAsync("ip_servidor"); var numeroMesa = Convert.ToInt32(await SecureStorage.GetAsync("numero_mesa")); var valorTotal = Convert.ToDouble(lblTotalPrice.Text.Replace("R$ ", "")); List <ItemPedido> itensPedido = new List <ItemPedido>(); foreach (var orderItem in App.ItensPedido) { var itemPedido = new ItemPedido(); itemPedido.ID_Produto = orderItem.Id; itemPedido.Quantidade = orderItem.Quantity; itemPedido.AdicionaisSelecionados = orderItem.SelectedAditionals; itensPedido.Add(itemPedido); } var address = new EndpointAddress("http://" + ipServidor + "/GarcOnService"); var bind = new BasicHttpBinding(); bind.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; var garconClient = new GarcOnClient(bind, address); garconClient.ClientCredentials.UserName.UserName = "******"; garconClient.ClientCredentials.UserName.Password = "******"; garconClient.AddOrderCompleted += GarconClient_AddOrderCompleted; garconClient.AddOrderAsync(numeroMesa, valorTotal, JsonConvert.SerializeObject(itensPedido)); }
private void ServerIsAlive() { var ipServidor = txtIP.Text; var address = new EndpointAddress("http://" + ipServidor + "/GarcOnService"); var bind = new BasicHttpBinding(); bind.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; var garconClient = new GarcOnClient(bind, address); garconClient.ClientCredentials.UserName.UserName = "******"; garconClient.ClientCredentials.UserName.Password = "******"; garconClient.GetDataCompleted += GarconClient_GetDataCompleted; garconClient.GetDataAsync(); }
private async void GetData() { var ipServidor = await SecureStorage.GetAsync("ip_servidor"); var user = txtUser.Text; var password = txtPassword.Text; var address = new EndpointAddress("http://" + ipServidor + "/GarcOnService"); var bind = new BasicHttpBinding(); bind.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; var garconClient = new GarcOnClient(bind, address); garconClient.ClientCredentials.UserName.UserName = user; garconClient.ClientCredentials.UserName.Password = password; garconClient.GetDataCompleted += GarconClient_GetDataCompleted; garconClient.GetDataAsync(); }
private async void AddAccountRequest() { var ipServidor = await SecureStorage.GetAsync("ip_servidor"); var numeroMesa = Convert.ToInt32(await SecureStorage.GetAsync("numero_mesa")); var valorTotal = Convert.ToDouble(App.ItensPedidosFinalizados.Sum(i => i.TotalPrice)); var sugestao = editorSugestao.Text; var address = new EndpointAddress("http://" + ipServidor + "/GarcOnService"); var bind = new BasicHttpBinding(); bind.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; var garconClient = new GarcOnClient(bind, address); garconClient.ClientCredentials.UserName.UserName = "******"; garconClient.ClientCredentials.UserName.Password = "******"; garconClient.AddAccountRequestCompleted += GarconClient_AddAccountRequestCompleted; garconClient.AddAccountRequestAsync(numeroMesa, valorTotal, sugestao); }
public GarcOnClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(GarcOnClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public GarcOnClient(EndpointConfiguration endpointConfiguration) : base(GarcOnClient.GetBindingForEndpoint(endpointConfiguration), GarcOnClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public GarcOnClient() : base(GarcOnClient.GetDefaultBinding(), GarcOnClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IGarcOn.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(GarcOnClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IGarcOn)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(GarcOnClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IGarcOn)); }