From 72799981b6c7ed076734c048d423f18f5aa2e722 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 3 Mar 2017 21:48:09 +0000 Subject: [PATCH] moved the string update sql statement to a constant with the other procedures in SQLiteProcedures #56 --- .../WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs | 4 ++++ .../WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs index a5488c3..ac5e79c 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs @@ -34,6 +34,10 @@ namespace SQLiteRepository "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " + nameof(CardUniqueId.Id) + "=?"; + public const string UPDATE_CARD_LAST_USED = + "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.LastUsed) + " = ? where " + + nameof(CardUniqueId.Id) + " = ?"; + public const string SEARCH_USER_LIST = "SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " + nameof(UserIdentity.LastName) + " Like ?)"; diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs index 3f8ef98..36ef87b 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs @@ -546,7 +546,7 @@ namespace SQLiteRepository private void UpdateIdentifierLastUsed(DateTimeOffset dt, int cardId) { - var res = _connection.ExecuteScalar("update CardUniqueId set LastUsed = ? where Id = ?", + var res = _connection.ExecuteScalar(SQLiteProcedures.UPDATE_CARD_LAST_USED, dt, cardId); }