[chronojump] Networks after GetPersonByRFID if person exists on local check that ID is the same than server
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Networks after GetPersonByRFID if person exists on local check that ID is the same than server
- Date: Thu, 15 Apr 2021 11:33:34 +0000 (UTC)
commit 91ec37e86b1d0c82711d6cb479d507dcc1f6e874
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Apr 15 13:31:32 2021 +0200
Networks after GetPersonByRFID if person exists on local check that ID is the same than server
src/gui/networks.cs | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 6c7cfd13..c229d1c6 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -693,12 +693,12 @@ public partial class ChronoJumpWindow
//select person by RFID
Person pLocal = SqlitePerson.SelectByRFID(capturedRFID);
+ Person pServer = json.GetPersonByRFID(capturedRFID); //needed to check if photo changed (or
in the future height,weight, ...)
+
if(pLocal.UniqueID == -1)
{
LogB.Information("RFID person does not exist locally!!");
- Person pServer = json.GetPersonByRFID(capturedRFID);
-
if(! json.Connected) {
LogB.Information("Cannot connect with server!");
if(dialogMessageNotAtServer == null || ! dialogMessageNotAtServer.Visible)
@@ -772,7 +772,18 @@ public partial class ChronoJumpWindow
pChangedShowTasks = true;
}
}
- else {
+ else if(json.Connected && pLocal.UniqueID != pServer.UniqueID)
+ {
+ LogB.Information("PersonID on client does not match personID on server for rfid: " +
capturedRFID);
+ if(dialogMessageNotAtServer == null || ! dialogMessageNotAtServer.Visible)
+ {
+ dialogMessageNotAtServer = new DialogMessage(Constants.MessageTypes.WARNING,
+ string.Format("PersonID {0} on client does not match personID
{1} on server for rfid: {2}",
+ pLocal.UniqueID, pServer.UniqueID, capturedRFID));
//GTK
+
+ compujumpPersonLogoutDo();
+ }
+ } else {
LogB.Information("RFID person exists locally!!");
if(rfidIsDifferent || dialogPersonPopup == null || ! dialogPersonPopup.Visible)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]