예제 #1
0
        private Direccion LeerDatosDireccionActual()
        {
            var tipoCatalogo   = new StringBuilder(7);
            var tipoDireccion  = new StringBuilder(7);
            var nombreCalle    = new StringBuilder(61);
            var numeroExterior = new StringBuilder(31);
            var numeroInterior = new StringBuilder(31);
            var colonia        = new StringBuilder(61);
            var codigoPostal   = new StringBuilder(7);
            var telefono1      = new StringBuilder(16);
            var telefono2      = new StringBuilder(16);
            var telefono3      = new StringBuilder(16);
            var telefono4      = new StringBuilder(16);
            var email          = new StringBuilder(51);
            var direccionWeb   = new StringBuilder(51);
            var ciudad         = new StringBuilder(61);
            var estado         = new StringBuilder(61);
            var pais           = new StringBuilder(61);
            var textoExtra     = new StringBuilder(61);
            var idDireccion    = new StringBuilder(12);
            var idCatalogo     = new StringBuilder(12);

            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTIPOCATALOGO", tipoCatalogo, 7);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTIPODIRECCION", tipoDireccion, 7);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CNOMBRECALLE", nombreCalle, 61);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CNUMEROEXTERIOR", numeroExterior, 31);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CNUMEROINTERIOR", numeroInterior, 31);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CCOLONIA", colonia, 61);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CCODIGOPOSTAL", codigoPostal, 7);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTELEFONO1", telefono1, 16);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTELEFONO2", telefono2, 16);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTELEFONO3", telefono3, 16);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTELEFONO4", telefono4, 16);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CEMAIL", email, 51);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CDIRECCIONWEB", direccionWeb, 51);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CCIUDAD", ciudad, 61);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CESTADO", estado, 61);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CPAIS", pais, 61);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CTEXTOEXTRA", textoExtra, 61);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CIDDIRECCION", idDireccion, 12);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDireccion("CIDCATALOGO", idCatalogo, 12);
            var direccion = new Direccion();

            direccion.TipoCatalogo   = int.Parse(tipoCatalogo.ToString());
            direccion.TipoDireccion  = int.Parse(tipoDireccion.ToString());
            direccion.NombreCalle    = nombreCalle.ToString();
            direccion.NumeroExterior = numeroExterior.ToString();
            direccion.NumeroInterior = numeroInterior.ToString();
            direccion.Colonia        = colonia.ToString();
            direccion.CodigoPostal   = codigoPostal.ToString();
            direccion.Telefono1      = telefono1.ToString();
            direccion.Telefono2      = telefono2.ToString();
            direccion.Telefono3      = telefono3.ToString();
            direccion.Telefono4      = telefono4.ToString();
            direccion.Email          = email.ToString();
            direccion.DireccionWeb   = direccionWeb.ToString();
            direccion.Ciudad         = ciudad.ToString();
            direccion.Estado         = estado.ToString();
            direccion.Pais           = pais.ToString();
            direccion.TextoExtra     = textoExtra.ToString();
            direccion.Id             = int.Parse(idDireccion.ToString());
            direccion.IdCatalogo     = int.Parse(idCatalogo.ToString());
            if (direccion.TipoCatalogo == 1 || direccion.TipoCatalogo == 2)
            {
                direccion.ClienteProveedor = _clienteProveedorRepositorio.BuscarClienteProveedor(direccion.IdCatalogo);
                direccion.CodCteProv       = direccion.ClienteProveedor.Codigo;
            }

            return(direccion);
        }
예제 #2
0
        private Documento LeerDatosDocumentoActual()
        {
            var folio           = new StringBuilder(Constantes.kLongitudFolio);
            var numeroMoneda    = new StringBuilder(Constantes.kLongitudMoneda);
            var tipoDeCambio    = new StringBuilder(9);
            var importe         = new StringBuilder(9);
            var sistemaDeOrigen = new StringBuilder(7);
            var fecha           = new StringBuilder(Constantes.kLongFecha);
            var serie           = new StringBuilder(Constantes.kLongSerie);
            var referencia      = new StringBuilder(Constantes.kLongReferencia);
            var gasto1          = new StringBuilder(9);
            var gasto2          = new StringBuilder(9);
            var gasto3          = new StringBuilder(9);
            var id            = new StringBuilder(12);
            var conceptoId    = new StringBuilder(12);
            var clienteId     = new StringBuilder(12);
            var agenteId      = new StringBuilder(12);
            var observaciones = new StringBuilder(Constantes.kLongMensaje);
            var textoExtra1   = new StringBuilder(Constantes.kLongTextoExtra);
            var textoExtra2   = new StringBuilder(Constantes.kLongTextoExtra);
            var textoExtra3   = new StringBuilder(Constantes.kLongTextoExtra);
            var fechaExtra    = new StringBuilder(Constantes.kLongFecha);

            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CFOLIO", folio, Constantes.kLongitudFolio);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CIDMONEDA", numeroMoneda, Constantes.kLongitudMoneda);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CTIPOCAM01", tipoDeCambio, 9);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CNETO", importe, 9);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CSISTORIG", sistemaDeOrigen, 7);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CFECHA", fecha, Constantes.kLongFecha);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CSERIEDO01", serie, Constantes.kLongSerie);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CREFEREN01", referencia, Constantes.kLongReferencia);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CGASTO1", gasto1, 9);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CGASTO2", gasto2, 9);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CGASTO3", gasto3, 9);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CIDDOCUMENTO", id, 12);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CIDCONCEPTODOCUMENTO", conceptoId, 12);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CIDCLIENTEPROVEEDOR", clienteId, 12);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CIDAGENTE", agenteId, 12);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("COBSERVACIONES", observaciones, Constantes.kLongMensaje);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CTEXTOEXTRA1", textoExtra1, Constantes.kLongTextoExtra);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CTEXTOEXTRA2", textoExtra2, Constantes.kLongTextoExtra);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CTEXTOEXTRA3", textoExtra3, Constantes.kLongTextoExtra);
            _errorContpaqiSdkRepositorio.ResultadoSdk = _sdk.fLeeDatoDocumento("CFECHAEXTRA", fechaExtra, Constantes.kLongFecha);
            var documento = new Documento();

            documento.Folio           = double.Parse(folio.ToString());
            documento.NumeroMoneda    = int.Parse(numeroMoneda.ToString());
            documento.TipoDeCambio    = double.Parse(tipoDeCambio.ToString());
            documento.Importe         = double.Parse(importe.ToString());
            documento.SistemaDeOrigen = int.TryParse(sistemaDeOrigen.ToString(), out var _sistemaOrigen) ? _sistemaOrigen : 0;
            documento.Fecha           = DateTime.ParseExact(fecha.ToString(), "M/d/yyyy HH:mm:ss:fff", null);
            documento.Serie           = serie.ToString();
            documento.Referencia      = referencia.ToString();
            documento.Gasto1          = double.Parse(gasto1.ToString());
            documento.Gasto2          = double.Parse(gasto2.ToString());
            documento.Gasto3          = double.Parse(gasto3.ToString());
            documento.Id = int.Parse(id.ToString());
            documento.IdConceptoDocumento = int.Parse(conceptoId.ToString());
            documento.IdClienteProveedor  = int.Parse(clienteId.ToString());
            documento.IdAgente            = int.TryParse(agenteId.ToString(), out var _agenteId) ? _agenteId : 0;
            documento.Observaciones       = observaciones.ToString();
            documento.TextoExtra1         = textoExtra1.ToString();
            documento.TextoExtra2         = textoExtra2.ToString();
            documento.TextoExtra3         = textoExtra3.ToString();
            documento.FechaExtra          = DateTime.ParseExact(fechaExtra.ToString(), "M/d/yyyy HH:mm:ss:fff", null);
            documento.ConceptoDocumento   = _conceptoDeDocumentoRepositorio.BuscarConceptoDocumento(documento.IdConceptoDocumento);
            documento.ClienteProveedor    = _clienteProveedorRepositorio.BuscarClienteProveedor(documento.IdClienteProveedor);
            documento.Agente                 = _agenteRepositorio.BuscarAgente(documento.IdAgente);
            documento.Movimientos            = _movimientoRepositorio.TraerMovimientos(documento.Id);
            documento.CodigoConcepto         = documento.ConceptoDocumento.Codigo;
            documento.CodigoClienteProveedor = documento.ClienteProveedor.Codigo;
            documento.CodigoAgente           = documento.Agente.Codigo;
            return(documento);
        }