public httpWebSend(Vgp vgl) { _vgp = vgl; _datos = new OracleData(_vgp); _log = new Registro.Registro(); selects = new BuildCommands(); }
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; } } }
private string getCliente(string factura) { string cliente = string.Empty; DataTable dtConsulta = new DataTable(); BuildCommands selects = new BuildCommands(); OracleData _datos = new OracleData(_vgp); dtConsulta = _datos.daDataTable(selects.getCliente(_vgp._LogReporteDian.LODI_LLAVE_V2), _vgp); if (dtConsulta.Rows.Count > 0) { foreach (DataRow dr in dtConsulta.Rows) { cliente = dr[0].ToString(); } } return(cliente); }
public void actualizarlogReporteDian(string estado, string HttpWebResponseXml) { if (estado == "E") { OracleData _datos = new OracleData(_vgp); BuildCommands select = new BuildCommands(); _datos.executeUploadRequest(select.UploadRequestFE(), _vgp); _datos.executeDetLogDian(select.insertDetLogDian(), _vgp); //_datos.execute(select.updateLogReporteDian(estado, _vgp.logreportedian.LODI_LLAVE_V2), _vgp); //_datos.executeUpdateInfoDian(select.updateInformacionDian(), _vgp); } else { Correo.Correo _correo = new Correo.Correo(_vgp); _correo.envioCorreoDesarrollador("La factura : " + _vgp._LogReporteDian.LODI_LLAVE_V2 + " No fue aceptada por el CENF.", "Se presento alguna novedad durante el envio de la factura : " + _vgp._LogReporteDian.LODI_LLAVE_V2 + " Adjunto respuesta del CENF. \r\n" + HttpWebResponseXml, _vgp); } }
public Prompt(IPromptConfiguration configuration) { try { // If Configuration is null, use default settings Configuration = configuration ?? new PromptConfiguration(); ReadLine.HistoryEnabled = string.Equals(Configuration.GetOption("HistoryEnabled"), true.ToString()); BuildCommands.ScanForPrompt(this); HistoryFile.Load(configuration); } catch (Exception e) { // Don't allow an exception to crash the application by a throw // Show the error so that an developer can fix the problem. Console.WriteLine(e); } }
public void Rescan() { BuildCommands.ScanForPrompt(prompt); }
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."); } }