[chronojump] Fixed: edit person show personSession of current session



commit 23a2dadc78130d8bca6d95bc4d8e0dda22e8f597
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Mar 5 15:27:39 2010 +0800

    Fixed: edit person show personSession of current session

 src/gui/person.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 8d05f17..d3814af 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -900,6 +900,7 @@ public class PersonAddModifyWindow
 		this.currentSession = currentSession;
 		this.currentPerson = currentPerson;
 
+		//when comesFromRecuperateWin is true, is considered editing because uniqueID is known
 		if(currentPerson.UniqueID == -1)
 			adding = true;
 		else
@@ -1179,9 +1180,13 @@ public class PersonAddModifyWindow
 			
 
 			//PERSONSESSION STUFF
-			//select a personSession of last session
-			//to obtain it's attributes
-			PersonSession myPS = SqlitePersonSession.Select(currentPerson.UniqueID, -1);
+			PersonSession myPS = new PersonSession();
+			if(comesFromRecuperateWin)
+				//select a personSession of last session to obtain it's attributes
+				myPS = SqlitePersonSession.Select(currentPerson.UniqueID, -1);
+			else
+				//we edit a person that is already on this session, then take personSession data from this session
+				myPS = SqlitePersonSession.Select(currentPerson.UniqueID, currentSession.UniqueID);
 
 			spinbutton_height.Value = myPS.Height;
 			spinbutton_weight.Value = myPS.Weight;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]