public ActionResult FConsult(string cep, decimal tamanho = 0, decimal peso = 0)
        {
            FreightConsult model = null;

            if (!string.IsNullOrEmpty(cep) && tamanho > 0 && peso > 0)
            {
                model = _service.FreightConsult(cep, tamanho, peso, Session["Token"].ToString());
            }

            ViewBag.Message = "Consulta de Fretes";
            return(View(model));
        }
Beispiel #2
0
        public IActionResult Consult(string cep, decimal tamanho, decimal peso)
        {
            var parameters = new FreightConsult();

            parameters.CepDestino = cep;
            parameters.Tamanho    = tamanho;
            parameters.Peso       = peso;

            try
            {
                return(Ok(_service.Consult(parameters)));
            }catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }