private void OnTimedEvent(object sender, ElapsedEventArgs e) { LeerIni(); List <MicrosCheck> list; try { list = _dbConn.ReadDb(_configuration, _ultimoCheck, false); } catch (Exception ex) { Logger.WriteLog($"Error en TimedEvent: {ex.Message}", _logFilePath); throw; } var index = 0; foreach (var check in list) { if (check.Detalle.Count == 0) { //Logger.WriteLog($"Check {check.Encabezado.IdDoc.Znumd} no tiene detalles.", _logFilePath); break; } GenerarXML(check, index); ActualizarIni(int.Parse(check.Encabezado.IdDoc.Znumd)); _ultimoCheck = int.Parse(check.Encabezado.IdDoc.Znumd); index++; } }
static void Main(string[] args) { Console.Write("Ingresar invoice number a procesar: "); var invoiceNumber = Console.ReadLine(); _configuration = new ConfigurationReader().Read("RubySalesExporter.config.ini"); var connDB = new ConnDB($"Dsn=micros;uid=dba;pwd=micros3700"); var checks = connDB.ReadDb(_configuration, Convert.ToInt32(invoiceNumber), true); var index = 0; foreach (var check in checks) { GenerarXML(check, index); index++; } Console.WriteLine($"Procesado el fcrInvNumber {invoiceNumber}"); Console.ReadLine(); }