Beispiel #1
0
        public HttpResponseMessage RetornaCotacaoAxado(string cdcesta, string cdcepcliente)
        {
            AxadoCotacoes    ret         = new AxadoCotacoes();
            ConfigAppMembers cf          = Util.ConfigApp.getConfig();
            string           outRest     = string.Empty;
            string           jsonRetorno = string.Empty;

            try
            {
                ret = AxadoADO.RetornaTabelaCotacao(cdcesta, cdcepcliente, cf.datasource, cf.schema, out jsonRetorno);
                Util.LogUtil.GravaLog(this, string.Format("RetornaCotacaoAxado pedido:{0} - {1} ", cdcesta, jsonRetorno), cf.Cnpj, Log.TipoLog.info);
            }
            catch (Exception e)
            {
                Util.LogUtil.GravaLog(this, "RetornaCotacaoAxado: " + e.ToString(), "", Log.TipoLog.erro);
                return(Request.CreateResponse(HttpStatusCode.BadRequest, "ERRO"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, ret));
        }
Beispiel #2
0
        public HttpResponseMessage RetornaCotacaoAxado(HttpRequestMessage request, [FromBody] AxadoPostRest axadopost)
        {
            AxadoCotacoes    ret         = new AxadoCotacoes();
            ConfigAppMembers cf          = Util.ConfigApp.getConfig();
            string           outRest     = string.Empty;
            string           jsonRetorno = string.Empty;

            try
            {
                ret = AxadoADO.RetornaTabelaCotacao(axadopost.CepCliente, axadopost.VrTotalPedido, axadopost.PesoTotal, axadopost.TotalItens, axadopost.IdPedido, out outRest, out jsonRetorno);

                Util.LogUtil.GravaLog(this, "RetornaCotacaoAxado pedido: " + axadopost.IdPedido + jsonRetorno, cf.Cnpj, Log.TipoLog.info);
            }
            catch (Exception e)
            {
                Util.LogUtil.GravaLog(this, "RetornaCotacaoAxado: " + e.ToString(), "", Log.TipoLog.erro);
                return(Request.CreateResponse(HttpStatusCode.BadRequest, "ERRO"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, jsonRetorno));
        }