Пример #1
0
        /// <summary>
        /// Inserta datos de una factura en el log de facturas.
        /// </summary>
        /// <returns></returns>
        public void RegistraLogDeArchivoXML(short soptype, string sopnumbe, string mensaje, string noAprobacion, string idusuario, string innerxml,
                                            string eBaseNuevo, string eBinarioActual, string mensajeBinActual)
        {
            try
            {
                //log de facturas xml emitido y xml anulado
                cfdLogFacturaXML logVenta = new cfdLogFacturaXML(_Conexion.ConnStr);

                logVenta.AddNew();
                logVenta.Soptype            = soptype;
                logVenta.Sopnumbe           = sopnumbe;
                logVenta.Mensaje            = Utiles.Derecha(mensaje, 255);
                logVenta.Estado             = eBaseNuevo;
                logVenta.NoAprobacion       = noAprobacion;
                logVenta.FechaEmision       = DateTime.Now;
                logVenta.IdUsuario          = Utiles.Derecha(idusuario, 10);
                logVenta.IdUsuarioAnulacion = "-";
                logVenta.FechaAnulacion     = new DateTime(1900, 1, 1);
                if (!string.IsNullOrEmpty(innerxml))
                {
                    logVenta.ArchivoXML = innerxml;
                }
                logVenta.EstadoActual = eBinarioActual;
                logVenta.MensajeEA    = Utiles.Derecha(mensajeBinActual, 255);
                logVenta.Save();
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        /// <summary>
        /// Inserta datos de una factura en el log de facturas.
        /// </summary>
        /// <returns></returns>
        public void RegistraLogDeArchivoXML(short soptype, string sopnumbe, string mensaje, string noAprobacion, string idusuario, string innerxml,
                                            string eBaseNuevo, string eBinarioActual, string mensajeBinActual)
        {
            try
            {
                ultimoMensaje   = "";
                numMensajeError = 0;
                //log de facturas xml emitido y xml anulado
                cfdLogFacturaXML logVenta = new cfdLogFacturaXML(_Conexion.ConnStr);

                logVenta.AddNew();
                logVenta.Soptype            = soptype;
                logVenta.Sopnumbe           = sopnumbe;
                logVenta.Mensaje            = Utiles.Derecha(mensaje, 255);
                logVenta.Estado             = eBaseNuevo;
                logVenta.NoAprobacion       = noAprobacion;
                logVenta.FechaEmision       = DateTime.Now;
                logVenta.IdUsuario          = Utiles.Derecha(idusuario, 10);
                logVenta.IdUsuarioAnulacion = "-";
                logVenta.FechaAnulacion     = new DateTime(1900, 1, 1);
                if (!innerxml.Equals(""))
                {
                    logVenta.ArchivoXML = innerxml;
                }
                logVenta.EstadoActual = eBinarioActual;
                logVenta.MensajeEA    = Utiles.Derecha(mensajeBinActual, 255);
                logVenta.Save();
            }
            catch (Exception eLog)
            {
                ultimoMensaje = "Contacte a su administrador. No se puede registrar la tarea en la Bitácora. [RegistraLogDeArchivoXML] " + eLog.Message;
                numMensajeError++;
            }
        }
Пример #3
0
        /// <summary>
        /// Inserta datos de una factura en el log de facturas.
        /// </summary>
        /// <returns></returns>
        public void Save(string mensaje, string idusuario, string innerxml, string idExterno)
        {
            try
            {
                _sMsj = "";
                _iErr = 0;
                //log de facturas xml emitido y xml anulado
                cfdLogFacturaXML logVenta = new cfdLogFacturaXML(_Conexion.ConnStr);

                logVenta.AddNew();
                logVenta.Soptype  = _sopType;
                logVenta.Sopnumbe = _sopnumbe;

                logVenta.Estado       = _cicloDeVida.targetSingleStatus;
                logVenta.EstadoActual = _cicloDeVida.targetBinStatus;
                logVenta.NoAprobacion = _cicloDeVida.idxTargetSingleStatus.ToString();
                logVenta.MensajeEA    = Utiles.Derecha(_cicloDeVida.EstadoEnPalabras(_cicloDeVida.targetBinStatus), 255);
                logVenta.Mensaje      = Utiles.Derecha(mensaje, 255);
                if (!innerxml.Equals(""))
                {
                    logVenta.ArchivoXML = innerxml;
                }
                logVenta.IdExterno = idExterno;

                logVenta.FechaEmision       = DateTime.Now;
                logVenta.IdUsuario          = Utiles.Derecha(idusuario, 10);
                logVenta.IdUsuarioAnulacion = "-";
                logVenta.FechaAnulacion     = new DateTime(1900, 1, 1);

                logVenta.Save();
            }
            catch (Exception eLog)
            {
                _sMsj = "Contacte al administrador. No se puede ingresar la tarea en la Bitácora. [LogFacturaXMLService.Save] " + eLog.Message;
                _iErr++;
                throw;
            }
        }