Ejemplo n.º 1
0
        public CardHistoryEntry[] GetHistory(int cardID)
        {
            List <CardHistoryEntry> historyEntries = new List <CardHistoryEntry>();
            string           getHistoryQuery       = string.Format("select * from CardHistories where Card='{0}'", cardID);
            SQLiteDataReader dataReader            = ExecuteReaderQuery(getHistoryQuery);

            while (dataReader.Read())
            {
                DateTime         dateTime         = new DateTime(Convert.ToInt64(dataReader["DateTime"]));
                TrialPerformance trialPerformance = (TrialPerformance)Convert.ToInt32(dataReader["Success"]);
                var historyEntry = new CardHistoryEntry(dateTime, trialPerformance);
                historyEntries.Add(historyEntry);
            }

            return(historyEntries.ToArray());
        }
Ejemplo n.º 2
0
        public void AddHistoryEntry(TrialPerformance trialPerformance) // TODO Violating SRP? Move history management to another class?
        {
            var entry = new CardHistoryEntry(DateTime.Now, trialPerformance);

            HistoryEntries.Add(entry);
        }