[chronojump] Prepare for branch (some person data in new personsession)



commit 0f7985f60902931d10a3152f1c8f606438a3bbcf
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Feb 24 18:24:23 2010 +0800

    Prepare for branch (some person data in new personsession)

 sqlite_diagrams/chronojump_sqlite.dia |  Bin 10942 -> 12329 bytes
 src/chronojump.cs                     |    2 --
 src/constants.cs                      |    2 --
 src/gui/person.cs                     |    6 +-----
 src/sqlite/person.cs                  |   26 ++++++++++++++++++++++++++
 src/sqlite/personSession.cs           |   25 -------------------------
 6 files changed, 27 insertions(+), 34 deletions(-)
---
diff --git a/sqlite_diagrams/chronojump_sqlite.dia b/sqlite_diagrams/chronojump_sqlite.dia
index 76b3ac2..a6c553a 100644
Binary files a/sqlite_diagrams/chronojump_sqlite.dia and b/sqlite_diagrams/chronojump_sqlite.dia differ
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 3fbc480..b0f0057 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -282,7 +282,6 @@ Log.WriteLine("doing backup");
 		}
 
 		string versionAvailableKnown = SqlitePreferences.Select("versionAvailable");
-		//if( versionAvailable != Constants.ServerOffline && versionAvailable != progVersion ) {
 		if( versionAvailable != Constants.ServerOffline && new Version(versionAvailable) > new Version(progVersion) ) {
 			//check if available version is higher than known available version
 			Version versionAvailableAsV = new Version(versionAvailable);
@@ -312,7 +311,6 @@ Log.WriteLine("doing backup");
 
 		//if chronojump chrashed before
 		if(crashedBefore) {
-			//if( versionAvailableKnown.Length > 0 && versionAvailableKnown != progVersion ) 
 			if( versionAvailableKnown.Length > 0 && new Version(versionAvailableKnown) > new Version(progVersion) ) 
 				messageToShowOnBoot += "\n" + Catalog.GetString("Chronojump crashed before.") + "\n" +
 				       Catalog.GetString("Please, update to new version: ") + versionAvailableKnown + "\n";
diff --git a/src/constants.cs b/src/constants.cs
index 55793d0..5b92624 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -231,8 +231,6 @@ public class Constants
 	public static string AllPulsesName = Catalog.GetString("See all pulses");
 
 	//fileNames
-	//public static string FileNameLogo = "chronojump_logo.png";
-	//public static string FileNameLogo320 = "chronojump_320.png";
 	public static string FileNameLogo = "chronojump-boscosystem.png";
 	public static string FileNameLogo320 = "chronojump-boscosystem_320.png";
 	public static string FileNameCSS = "report_web_style.css";
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 55bc52f..42e3173 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -1119,12 +1119,8 @@ public class PersonAddModifyWindow
 			else
 				label_date.Text = dateTime.ToLongDateString();
 
-Log.WriteLine(myPerson.Height.ToString());
-Log.WriteLine(myPerson.Weight.ToString());
 			spinbutton_height.Value = myPerson.Height;
 			spinbutton_weight.Value = myPerson.Weight;
-Log.WriteLine(spinbutton_height.Value.ToString());
-Log.WriteLine(spinbutton_weight.Value.ToString());
 
 			weightIni = myPerson.Weight; //store for tracking if changes
 		
@@ -1371,7 +1367,7 @@ Log.WriteLine(spinbutton_weight.Value.ToString());
 		if(adding)
 			personExists = Sqlite.Exists (Constants.PersonTable, Util.RemoveTilde(entry1.Text));
 		else
-			personExists = SqlitePersonSession.PersonExistsAndItsNotMe (personID, Util.RemoveTilde(entry1.Text));
+			personExists = SqlitePerson.ExistsAndItsNotMe (personID, Util.RemoveTilde(entry1.Text));
 
 		string errorMessage = "";
 
diff --git a/src/sqlite/person.cs b/src/sqlite/person.cs
index d0882d3..1f05e92 100644
--- a/src/sqlite/person.cs
+++ b/src/sqlite/person.cs
@@ -451,6 +451,32 @@ finishForeach:
 		return arrayAll;
 	}
 	
+	public static bool ExistsAndItsNotMe(int uniqueID, string personName)
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT uniqueID FROM " + Constants.PersonTable +
+			" WHERE LOWER(person.name) == LOWER('" + personName + "')" +
+			" AND uniqueID != " + uniqueID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+	
+		bool exists = new bool();
+		exists = false;
+		
+		if (reader.Read()) {
+			exists = true;
+			//Log.WriteLine("valor {0}", reader[0].ToString());
+		}
+		//Log.WriteLine("exists = {0}", exists.ToString());
+
+		reader.Close();
+		dbcon.Close();
+		return exists;
+	}
+	
+	
 	public static void Update(Person myPerson)
 	{
 		dbcon.Open();
diff --git a/src/sqlite/personSession.cs b/src/sqlite/personSession.cs
index daa508e..44f1541 100644
--- a/src/sqlite/personSession.cs
+++ b/src/sqlite/personSession.cs
@@ -124,31 +124,6 @@ class SqlitePersonSession : Sqlite
 		dbcon.Close();
 	}
 
-	public static bool PersonExistsAndItsNotMe(int uniqueID, string personName)
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "SELECT uniqueID FROM " + Constants.PersonTable +
-			" WHERE LOWER(person.name) == LOWER('" + personName + "')" +
-			" AND uniqueID != " + uniqueID ;
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-	
-		bool exists = new bool();
-		exists = false;
-		
-		if (reader.Read()) {
-			exists = true;
-			//Log.WriteLine("valor {0}", reader[0].ToString());
-		}
-		//Log.WriteLine("exists = {0}", exists.ToString());
-
-		reader.Close();
-		dbcon.Close();
-		return exists;
-	}
-	
 	public static bool PersonSelectExistsInSession(int myPersonID, int mySessionID)
 	{
 		dbcon.Open();



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