Beispiel #1
0
        public async Task SelecionarFrete(string usuario, string modalidade, GeoCoordinate geolocalizarUsuario)
        {
            var carrinho = await _carrinhoStore.ObterCarrinho(usuario);

            var fretes = await _freteService.CalcularCarrinho(carrinho, geolocalizarUsuario);

            carrinho.SelecionarFrete(fretes.FirstOrDefault(f => f.Modalidade.Equals(modalidade)));
            await _carrinhoStore.AtualizarCarrinho(carrinho);
        }
Beispiel #2
0
        public async Task <IActionResult> Index()
        {
            var carrinho = await _carrinhoStore.ObterCarrinho(User.Identity.Name);

            var fretes = await _freteService.CalcularCarrinho(carrinho, await _geoposicaoService.GeolocalizarUsuario());

            return(View(new CheckoutViewModel()
            {
                OpcoesFrete = fretes,
                Carrinho = carrinho,
            }));
        }
Beispiel #3
0
        public async Task <IActionResult> Index()
        {
            var carrinho = await _carrinhoStore.ObterCarrinho(User.Identity.Name);

            var at = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token");

            var fretes = await _freteService.CalcularCarrinho(carrinho, await _geoposicaoService.GeolocalizarUsuario(), at);

            return(View(new CheckoutViewModel()
            {
                OpcoesFrete = fretes,
                Carrinho = carrinho,
            }));
        }
Beispiel #4
0
        public async Task <IActionResult> Index()
        {
            var carrinho = await _carrinhoStore.ObterCarrinho(User.Identity.Name);

            var cargodoUsuario = User.Claims.FirstOrDefault(f => f.Type.Equals("Cargo"));

            var at = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token");

            var fretes = await _freteService.CalcularCarrinho(carrinho, await _geoposicaoService.GeolocalizarUsuario(), at);

            return(View(new CarrinhoViewModel()
            {
                Carrinho = carrinho,
                Fretes = fretes
            }));
        }