public List <SatyamAggregatedResultsTableEntry> getEntries(string SQLCommandString)
        {
            List <SatyamAggregatedResultsTableEntry> ret = new List <SatyamAggregatedResultsTableEntry>();
            SqlCommand sqlCommand = new SqlCommand(SQLCommandString, dbAccess.getSQLConnection());

            sqlCommand.CommandTimeout = 200;

            try
            {
                SqlDataReader reader = sqlCommand.ExecuteReader();
                while (reader.Read())
                {
                    int    ID                     = (int)reader["ID"];
                    string UserID                 = (string)reader["UserID"];
                    string JobGUID                = (string)reader["JobGUID"];
                    string JobTemplateType        = (string)reader["JobTemplateType"];
                    string JSonString             = (string)reader["ResultString"];
                    int    SatyamTaskTableEntryID = (int)reader["SatyamTaskTableEntryID"];

                    SatyamAggregatedResultsTableEntry entry = new SatyamAggregatedResultsTableEntry(ID, JobTemplateType, UserID, JobGUID, JSonString, SatyamTaskTableEntryID);
                    ret.Add(entry);
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
            }
            return(ret);
        }
        /// <summary>
        /// Results Numbers
        /// </summary>
        /// <param name="_ID"></param>
        /// <param name="_value"></param>
        /// <returns></returns>

        private bool UpdateResultsAggregated(SatyamAggregatedResultsTableEntry entry, int _value)
        {
            int    value            = _value;
            String SQLCommandString = "UPDATE " + TableName + " SET ResultsAggregated = '" + value + "' WHERE SatyamTaskTableEntryID = '" + entry.SatyamTaskTableEntryID + "' AND ResultsAggregated IS NULL";

            return(ExecuteNoQuerySQLCommand(SQLCommandString));
        }
        public SatyamAggregatedResultsTableEntry getLatestEntryByTaskID(int taskID)
        {
            string SQLCommandString = "SELECT TOP 1 * FROM " + TableName + " WHERE SatyamTaskTableEntryID = '" + taskID.ToString() + "' ORDER BY RESULTSAGGREGATED DESC";
            SatyamAggregatedResultsTableEntry entries = getEntry(SQLCommandString);

            return(entries);
        }
        public SatyamAggregatedResultsTableEntry getEntryByTaskID(int taskID)
        {
            string SQLCommandString = "SELECT * FROM " + TableName + " WHERE SatyamTaskTableEntryID = '" + taskID.ToString() + "'";
            SatyamAggregatedResultsTableEntry entry = getEntry(SQLCommandString);

            return(entry);
        }
 public void AddEntry(SatyamAggregatedResultsTableEntry entry, int ResultsAggregated = 0)
 {
     AddEntry(entry.JobTemplateType, entry.UserID, entry.JobGUID, entry.ResultString, entry.SatyamTaskTableEntryID);
     UpdateResultsAggregated(entry, ResultsAggregated);
 }