Пример #1
0
        public void CheckStatus(Object stateInfo)
        {
            if (!freetoConnect)
            {
                return;
            }
            freetoConnect = false;
            try
            {
                var connection = new OleDbConnection(NumberService.GetConnectionString(Antri.Properties.Settings.Default.ConnectionString));
                connection.Open();
                var dbCommand = new OleDbCommand("SELECT TOP 1 NO_ANTRIAN, LOKET FROM RSUD_ANTRIAN ORDER BY NO_ANTRIAN DESC",
                                                 connection);
                var reader = dbCommand.ExecuteReader();
                reader.Read();
                SetNewPair((int)reader["NO_ANTRIAN"], (int)reader["LOKET"]);

                connection.Close();
            }
            catch (Exception ex)
            {
                Logger.WriteLog(string.Format("Error ada begini, tolong panggil SIMRS: {0}", ex.Message));
            }
            freetoConnect = true;
        }