[chronojump] Compujump now SQL insert personSession (if missing) at RFID recognition
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Compujump now SQL insert personSession (if missing) at RFID recognition
- Date: Mon, 10 Jul 2017 20:44:45 +0000 (UTC)
commit c327f1b45ce9fff123f57072ee1e7f87c892554b
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Jul 10 22:42:24 2017 +0200
Compujump now SQL insert personSession (if missing) at RFID recognition
src/gui/networks.cs | 2 +-
src/personSession.cs | 3 ++-
src/sqlite/personSession.cs | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 15c19d7..e6122a3 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -550,7 +550,7 @@ public partial class ChronoJumpWindow
private void insertAndAssignPersonSessionIfNeeded(Json json)
{
PersonSession ps = SqlitePersonSession.Select(false, currentPerson.UniqueID,
currentSession.UniqueID);
- if(ps == null)
+ if(ps.UniqueID == -1)
currentPersonSession = new PersonSession (
currentPerson.UniqueID, currentSession.UniqueID,
json.LastPersonByRFIDHeight, json.LastPersonByRFIDWeight,
diff --git a/src/personSession.cs b/src/personSession.cs
index d112b3d..ba27b2d 100644
--- a/src/personSession.cs
+++ b/src/personSession.cs
@@ -36,7 +36,8 @@ public class PersonSession {
private string comments;
- public PersonSession() {
+ public PersonSession()
+ {
}
//loading
diff --git a/src/sqlite/personSession.cs b/src/sqlite/personSession.cs
index 30df64f..af02220 100644
--- a/src/sqlite/personSession.cs
+++ b/src/sqlite/personSession.cs
@@ -225,6 +225,7 @@ class SqlitePersonSession : Sqlite
reader = dbcmd.ExecuteReader();
PersonSession ps = new PersonSession();
+ ps.UniqueID = -1;
while(reader.Read()) {
ps = new PersonSession(
Convert.ToInt32(reader[0].ToString()), //uniqueID
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]