//---------------------------------------------------------------------------------------//
        public ResultsIdInfo[] RetrieveAllNotNotified()
        {
            const string STRLOG_MethodName = "RetrieveAllNotNotified";

            Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName);

            List<ResultsIdInfo> resultsIdInfoList = new List<ResultsIdInfo>();

            lock (this.resultsLock)
            {
                try
                {
                    SqlCommand sqlCommand = new SqlCommand(STRSQLCMD_RetrieveResultsAllNotNotified, this.sqlConnection);
                    sqlCommand.CommandType = CommandType.StoredProcedure;

                    try
                    {
                        this.sqlConnection.Open();

                        SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
                        while (sqlDataReader.Read() == true)
                        {
                            ResultsIdInfo resultsIdInfo = new ResultsIdInfo();
                            string xmlWarningMessages = string.Empty;

                            object sdrObject = null;
                            if ((sdrObject = sqlDataReader[STRSQL_ResultsId]) != System.DBNull.Value)
                                resultsIdInfo.queueId = (int)sdrObject;
                            if ((sdrObject = sqlDataReader[STRSQL_ExperimentId]) != System.DBNull.Value)
                                resultsIdInfo.experimentId = (int)sdrObject;
                            if ((sdrObject = sqlDataReader[STRSQL_SbName]) != System.DBNull.Value)
                                resultsIdInfo.sbName = (string)sdrObject;

                            //
                            // Add the results info to the list
                            //
                            resultsIdInfoList.Add(resultsIdInfo);
                        }
                        sqlDataReader.Close();
                    }
                    catch (SqlException ex)
                    {
                        throw new Exception(STRERR_SqlException + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(STRERR_Exception + ex.Message);
                    }
                    finally
                    {
                        this.sqlConnection.Close();
                    }
                }
                catch (Exception ex)
                {
                    Logfile.WriteError(ex.Message);
                }
            }

            string logMessage = STRLOG_count + resultsIdInfoList.Count.ToString();

            Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName, logMessage);

            return resultsIdInfoList.ToArray();
        }
Esempio n. 2
0
        //---------------------------------------------------------------------------------------//

        public ResultsIdInfo[] RetrieveAllNotNotified()
        {
            const string STRLOG_MethodName = "RetrieveAllNotNotified";

            Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName);

            List <ResultsIdInfo> resultsIdInfoList = new List <ResultsIdInfo>();

            lock (this.resultsLock)
            {
                try
                {
                    SqlCommand sqlCommand = new SqlCommand(STRSQLCMD_RetrieveResultsAllNotNotified, this.sqlConnection);
                    sqlCommand.CommandType = CommandType.StoredProcedure;

                    try
                    {
                        this.sqlConnection.Open();

                        SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
                        while (sqlDataReader.Read() == true)
                        {
                            ResultsIdInfo resultsIdInfo      = new ResultsIdInfo();
                            string        xmlWarningMessages = string.Empty;

                            object sdrObject = null;
                            if ((sdrObject = sqlDataReader[STRSQL_ResultsId]) != System.DBNull.Value)
                            {
                                resultsIdInfo.queueId = (int)sdrObject;
                            }
                            if ((sdrObject = sqlDataReader[STRSQL_ExperimentId]) != System.DBNull.Value)
                            {
                                resultsIdInfo.experimentId = (int)sdrObject;
                            }
                            if ((sdrObject = sqlDataReader[STRSQL_SbName]) != System.DBNull.Value)
                            {
                                resultsIdInfo.sbName = (string)sdrObject;
                            }

                            //
                            // Add the results info to the list
                            //
                            resultsIdInfoList.Add(resultsIdInfo);
                        }
                        sqlDataReader.Close();
                    }
                    catch (SqlException ex)
                    {
                        throw new Exception(STRERR_SqlException + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(STRERR_Exception + ex.Message);
                    }
                    finally
                    {
                        this.sqlConnection.Close();
                    }
                }
                catch (Exception ex)
                {
                    Logfile.WriteError(ex.Message);
                }
            }

            string logMessage = STRLOG_count + resultsIdInfoList.Count.ToString();

            Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName, logMessage);

            return(resultsIdInfoList.ToArray());
        }