public void LerRegistros() { try { ServiceLog.WriteErrorLog("Iniciou a Execução"); DateTime agora = DateTime.Now.AddMinutes(-1); ApiSap apiSap = new ApiSap(); apiSap.IniciarColeta(); //TODO: Buscar relógios no MySQL //TODO: identificar qual o tipo de relógio //TODO: Chamar o relógio com os dados -IP, CPF, Login //TODO: Ler os registros do relógio //TODO: Inserir os registros no MySQL ServiceLog.WriteErrorLog("Concluiu a Execução com êxito"); } catch (Exception ex) { ServiceLog.WriteErrorLog("Exception: " + ex); ServiceLog.WriteErrorLog("Concluiu a Execução com erro"); } }
protected override void OnStop() { timer1.AutoReset = false; timer1.Enabled = false; ServiceLog.WriteErrorLog("Daily Reporting service stopped"); }
protected override void OnStart(string[] args) { timer1.AutoReset = true; timer1.Enabled = true; ServiceLog.WriteErrorLog("Daily Reporting service started"); }