コード例 #1
0
ファイル: httpWebSend.cs プロジェクト: feml/cursoUdemy
 public httpWebSend(Vgp vgl)
 {
     _vgp    = vgl;
     _datos  = new OracleData(_vgp);
     _log    = new Registro.Registro();
     selects = new BuildCommands();
 }
コード例 #2
0
        private void buttonCerrar_Click(object sender, EventArgs e)
        {
            DialogResult boton = MessageBox.Show("Si vuelve se borraran todos los datos ingresados", "Alerta", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (boton == DialogResult.OK)
            {
                if (Session.isNull())
                {
                    Registro.Registro a = new Registro.Registro();
                    a.Show();
                    this.cleanInputs();
                    this.Hide();
                }
                else
                {
                    Login.Funcionalidad a = new Login.Funcionalidad(Session.getRol());
                    a.Show();
                    this.cleanInputs();
                    this.Hide();
                }
            }
            else
            {
                //se deberia quedar en esta pantalla
            }
        }
コード例 #3
0
        public void generarInfoDian(string factura, int oficina, int transaccion)
        {
            BuildCommands select = new BuildCommands();

            _vgp._TargetFile._Archivo = "pdbinfodian.txt";
            _vgp._ClienteID           = "pdbInfoDian";
            //string tipodoc = string.Empty;
            switch (transaccion)
            {
            case 1:
            {
                try
                {
                    _vgp._IcpdbInfoDian.tipodocumento            = "FC";
                    _vgp._IcpdbInfoDian.tipoDocumentoDescriptivo = "FACTURA";
                    OracleData _datos = new OracleData(_vgp);
                    _datos.execute((select.procedimientoInfoDianFactura(factura, oficina, _vgp._IcpdbInfoDian.tipodocumento, "I")), _vgp);
                }
                catch (Exception ex)
                {
                    string lo = ex.Message;
                }
                break;
            }

            case 2:
            {
                _vgp._IcpdbInfoDian.tipodocumento            = "NC";
                _vgp._IcpdbInfoDian.tipoDocumentoDescriptivo = "NOTA CREDITO";
                OracleData _datos = new OracleData(_vgp);
                _datos.execute((select.procedimientoInfoDianNota(factura, oficina, _vgp._IcpdbInfoDian.tipodocumento, "I")), _vgp);
                break;
            }

            case 3:
            {
                _vgp._IcpdbInfoDian.tipodocumento            = "ND";
                _vgp._IcpdbInfoDian.tipoDocumentoDescriptivo = "NOTA DEBITO";
                OracleData _datos = new OracleData(_vgp);
                _datos.execute((select.procedimientoInfoDianNota(factura, oficina, _vgp._IcpdbInfoDian.tipodocumento, "I")), _vgp);
                break;
            }

            default:
            {
                string _default = "El metodo caFEtysVS02_pdbInfoDian_generarInfoDian contiene un caso sin catalogar \r\n Informacion de parametro Nombre : transaccion Valor : " + transaccion;
                _log = new Registro.Registro();
                _log.wr(_vgp._Directorio, "Default.txt", _default);
                Correo.Correo _correo = new Correo.Correo(_vgp);
                _correo.envioCorreoDesarrollador("El metodo caFEtysVS02_pdbInfoDian_generarInfoDian contiene un caso sin catalogar", "El metodo caFEtysVS02_pdbInfoDian_generarInfoDian contiene un caso sin catalogar \r\n Parametros  factura : " + factura + "\r\n oficina : " + oficina + "\r\n transaccion: " + transaccion, _vgp);
                break;
            }
            }
        }
コード例 #4
0
 private void buttonVolver_Click(object sender, EventArgs e)
 {
     if (Session.isNull())
     {
         Registro.Registro a = new Registro.Registro();
         a.Show();
         this.Hide();
     }
     else
     {
         AbmRol a = new AbmRol();
         a.Show();
         this.Hide();
     }
 }
コード例 #5
0
 //private Vgp _vgp;
 public Correo(Vgp vgp)
 {
     _log = new Registro.Registro();
     //_vgp = Vgp;
 }
コード例 #6
0
ファイル: Anexos.cs プロジェクト: feml/cursoUdemy
 public Anexos(Vgp vgp)
 {
     _vgp    = vgp;
     _log    = new Registro.Registro();
     _correo = new Correo.Correo(vgp);
 }
コード例 #7
0
ファイル: CallExecute.cs プロジェクト: feml/cursoUdemy
 public CallExecute(Vgp vgp)
 {
     _vgp = vgp;
     _log = new Registro.Registro();
 }
コード例 #8
0
ファイル: HttpWebXmls.cs プロジェクト: feml/cursoUdemy
 public HttpWebXmls(Vgp vgl)
 {
     _vgp = vgl;
     _log = new Registro.Registro();
 }
コード例 #9
0
 public HttpSendXmlDocument(Vgp vgp)
 {
     _vgp = vgp;
     _log = new Registro.Registro();
 }
コード例 #10
0
ファイル: LogicaProceso.cs プロジェクト: feml/cursoUdemy
        public void Inicio(string nfactura)
        {
            _vgp            = new Vgp();
            _log            = new Registro.Registro();
            _datos          = new OracleData(_vgp);
            _select         = new BuildCommands();
            _cronometro     = new Stopwatch();
            _correo         = new Correo.Correo(_vgp);
            _vgp._ClienteID = "FacElcV2_logicaProceso_inicio";
            DataTable dtlogReporteDian = new DataTable();

            string[] _nParametros;
            object[] _vParametros;
            _nParametros = new string[1] {
                ":LODI_ESTADO"
            };
            _vParametros = new object[1] {
                "P"
            };
            dtlogReporteDian = _datos.daDataTable(_select.logReporteDian(), _nParametros, _vParametros, _vgp);
            if (dtlogReporteDian.Rows.Count > 0)
            {
                try
                {
                    _vgp._LogReporteDian.totalFacturasPendientes = dtlogReporteDian.Rows.Count;
                    _log.msg("Facturas pendientes por procesar : " + _vgp._LogReporteDian.totalFacturasPendientes);
                    foreach (DataRow drFacturas in dtlogReporteDian.Rows)
                    {
                        _cronometro.Start();
                        inicializarVariablesLogReporteDian();
                        #region informacion log_reporte_dian
                        try
                        {
                            _vgp._LogReporteDian.LODI_SECUENCIA_NB = long.Parse(drFacturas[0].ToString());
                        }
                        catch (Exception ex)
                        {
                            _cronometro.Stop();
                            string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                                   "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() " +
                                                   "instruccion : _vgp._LogReporteDian.LODI_SECUENCIA_NB = long.Parse(drFacturas[0].ToString());" + "\r\nTiempo de proceso : " + _cronometro.Elapsed;
                            _log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                            _correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                        }
                        try
                        {
                            _vgp._LogReporteDian.LODI_OFICINA_NB = int.Parse(drFacturas[1].ToString());
                        }
                        catch (Exception ex)
                        {
                            _cronometro.Stop();
                            string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                                   "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() " +
                                                   "instruccion : _vgp._LogReporteDian.LODI_OFICINA_NB = int.Parse(drFacturas[1].ToString());" + "\r\nTiempo de proceso : " + _cronometro.Elapsed;
                            _log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                            _correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                        }
                        try
                        {
                            _vgp._LogReporteDian.LODI_TRANSACCION_NB = int.Parse(drFacturas[2].ToString());
                        }
                        catch (Exception ex)
                        {
                            _cronometro.Stop();
                            string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                                   "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() " +
                                                   "instruccion : _vgp._LogReporteDian.LODI_TRANSACCION_NB = int.Parse(drFacturas[2].ToString());" + "\r\nTiempo de proceso : " + _cronometro.Elapsed;
                            _log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                            _correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                        }
                        _vgp._LogReporteDian.LODI_LLAVE_V2 = drFacturas[3].ToString();
                        //consecutivo++;
                        //_newconsecutivo = "PRUE98000" + consecutivo.ToString();
                        _newconsecutivo = nfactura;//"SETT3";

                        try
                        {
                            _vgp._LogReporteDian.LODI_FECREGISTRO_DT = DateTime.Parse(drFacturas[4].ToString());
                        }
                        catch (Exception ex)
                        {
                            _cronometro.Stop();
                            string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                                   "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() " +
                                                   "instruccion : _vgp._LogReporteDian.LODI_FECREGISTRO_DT = DateTime.Parse(drFacturas[4].ToString());" + "\r\nTiempo de proceso : " + _cronometro.Elapsed;
                            _log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                            _correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                        }
                        _vgp._LogReporteDian.LODI_ESTADO_V2 = drFacturas[5].ToString();
                        try
                        {
                            _vgp._LogReporteDian.LODI_CAMPO1_NB = int.Parse(drFacturas[6].ToString());
                        }
                        catch (Exception ex)
                        {
                            _cronometro.Stop();
                            string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                                   "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() " +
                                                   "instruccion : _vgp._LogReporteDian.LODI_CAMPO1_NB = int.Parse(drFacturas[6].ToString());" + "\r\nTiempo de proceso : " + _cronometro.Elapsed;
                            //_log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                            //_correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                        }
                        _vgp._LogReporteDian.LODI_CAMPO2_V2 = drFacturas[7].ToString();
                        try
                        {
                            _vgp._LogReporteDian.LODI_CAMPO3_DT = DateTime.Parse(drFacturas[8].ToString());
                        }
                        catch (Exception ex)
                        {
                            _cronometro.Stop();
                            string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                                   "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() " +
                                                   "instruccion : _vgp._LogReporteDian.LODI_CAMPO1_NB = int.Parse(drFacturas[6].ToString());" + "\r\nTiempo de proceso : " + _cronometro.Elapsed;
                            //_log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                            //_correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                        }
                        _vgp._LogReporteDian.LODI_ESTADODIAN_V2 = drFacturas[9].ToString();
                        #endregion fin informacion log_reporte_dian

                        _log.msg("Secuencia : " + _vgp._LogReporteDian.LODI_SECUENCIA_NB + "  Oficina : " + _vgp._LogReporteDian.LODI_OFICINA_NB + "  Llave : " + _vgp._LogReporteDian.LODI_LLAVE_V2 + "  Fecha : " + _vgp._LogReporteDian.LODI_FECREGISTRO_DT);
                        if (_vgp._LogReporteDian.LODI_LLAVE_V2 == "EVVC653")
                        {
                            procesarFacturaAsync();
                        }
                        //procesarFacturaAsync();
                        _vgp._FacturasProcesadas += 1;
                        _cronometro.Stop();
                        _log.msg("Factura procesada : " + _vgp._LogReporteDian.LODI_LLAVE_V2 + "\r\nTiempo de proceso : " + _cronometro.Elapsed + "\r\n Facturas Procesadas : " + _vgp._FacturasProcesadas + "     Facturas Restantes : " + " " + (_vgp._LogReporteDian.totalFacturasPendientes - _vgp._FacturasProcesadas).ToString());
                        _cronometro.Reset();
                    }
                }
                catch (Exception ex)
                {
                    _cronometro.Stop();
                    string _mensajeError = @"Exception : " + ex.Source + "\nData source: " + ex.Message + "\nInnerException: " + ex.InnerException +
                                           "Procedimiento : caFEtysVS02_logicaProceso_public async void inicio() \r\nTiempo de proceso : " + _cronometro.Elapsed;
                    _log.wr(_vgp._Directorio, "Exception.txt", _mensajeError);
                    _correo.envioCorreoDesarrollador(ex.Message, _mensajeError, _vgp);
                }
            }
            else
            {
                _log.wr(_vgp._TargetFile._Directorio, _vgp._TargetFile._Archivo, "No hay facturas para procesar.");
            }
        }