Exemple #1
0
        public async Task CriarDireto(Pedido pedido, string token)
        {
            AddBearerToken(_httpClient, token);
            var stringContent        = new StringContent(JsonConvert.SerializeObject(pedido), Encoding.UTF8, "application/json");
            AddPedidoCommand command = new AddPedidoCommand(pedido);
            var resultado            = await _httpClient.PostAsync($"pedidos/", stringContent);

            resultado.EnsureSuccessStatusCode();
        }
 public async void Handle(AddPedidoCommand command)
 {
     var token = _apiIAm.Login("*****@*****.**", "N$Tlogin1").Result;
     await _apiOrderPedido.CriarDireto(command.Pedido, token);
 }
Exemple #3
0
 public BaseVentaViewModel(FacadeProvider facadeProvider) : base(facadeProvider)
 {
     Venta              = new VentaModel();
     AddPedidoComand    = new AddPedidoCommand(this);
     DeletePedidoComman = new DeletePedidoCommand(this);
 }