public ResponseConsultarVolanteDespacho ConsultarVolanteDespacho(RequestConsultarVolanteDespacho request)
        {
            ResponseConsultarVolanteDespacho response = new ResponseConsultarVolanteDespacho();
            VolanteDespachoBL cvbl = new VolanteDespachoBL();

            response = cvbl.ConsultarVolanteDespacho(request);
            return(response);
        }
Exemplo n.º 2
0
        public ResponseConsultarVolanteDespacho ConsultarVolanteDespacho(RequestConsultarVolanteDespacho request)
        {
            ResponseConsultarVolanteDespacho response = new ResponseConsultarVolanteDespacho();
            VolanteDespachoDA VolanteDespachoDA       = new VolanteDespachoDA();

            response = VolanteDespachoDA.ConsultarVolanteDespacho(request);

            return(response);
        }
Exemplo n.º 3
0
        public ResponseConsultarVolanteDespacho ConsultarVolanteDespacho(RequestConsultarVolanteDespacho request)
        {
            ResponseConsultarVolanteDespacho response = new ResponseConsultarVolanteDespacho();
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cnxANTP"].ToString());

            try
            {
                SqlCommand cmd = new SqlCommand("USP_ListaVolanteDespacho", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@BL", SqlDbType.VarChar, 25).Value = request.BL;
                con.Open();

                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    response.Empresa                   = dr.IsDBNull(dr.GetOrdinal("Empresa")) ? "" : dr.GetString(dr.GetOrdinal("Empresa"));
                    response.CodigoRegimen             = dr.IsDBNull(dr.GetOrdinal("CodigoRegimen")) ? "" : dr.GetString(dr.GetOrdinal("CodigoRegimen"));
                    response.Regimen                   = dr.IsDBNull(dr.GetOrdinal("Regimen")) ? "" : dr.GetString(dr.GetOrdinal("Regimen"));
                    response.Recalada                  = dr.IsDBNull(dr.GetOrdinal("Recalada")) ? "" : dr.GetString(dr.GetOrdinal("Recalada"));
                    response.PuertoOrigen              = dr.IsDBNull(dr.GetOrdinal("PuertoOrigen")) ? "" : dr.GetString(dr.GetOrdinal("PuertoOrigen"));
                    response.DescripcionPuerto         = dr.IsDBNull(dr.GetOrdinal("DescPuertoOrigen")) ? "" : dr.GetString(dr.GetOrdinal("DescPuertoOrigen"));
                    response.PuertoEmbarque            = dr.IsDBNull(dr.GetOrdinal("PuertoEmbarque")) ? "" : dr.GetString(dr.GetOrdinal("PuertoEmbarque"));
                    response.DescripcionPuertoEmbarque = dr.IsDBNull(dr.GetOrdinal("DescPuertoEmbarque")) ? "" : dr.GetString(dr.GetOrdinal("DescPuertoEmbarque"));
                    response.TipoDocumento             = dr.IsDBNull(dr.GetOrdinal("TipoDocumento")) ? "" : dr.GetString(dr.GetOrdinal("TipoDocumento"));
                    response.DescripcionDocumento      = dr.IsDBNull(dr.GetOrdinal("DescripcionDocumento")) ? "" : dr.GetString(dr.GetOrdinal("DescripcionDocumento"));
                    response.BL            = dr.IsDBNull(dr.GetOrdinal("BL")) ? "" : dr.GetString(dr.GetOrdinal("BL"));
                    response.NumeroVolante = dr.IsDBNull(dr.GetOrdinal("NumeroVolante")) ? "" : dr.GetString(dr.GetOrdinal("NumeroVolante"));
                }
            }
            catch (Exception ex)
            {
                response = null;
            }
            finally
            {
                con.Close();
            }

            return(response);
        }