chronojump r439 - in trunk: . build/data chronojump_server chronojump_server/bin glade sqlite_diagrams src src/gui src/sqlite



Author: xaviblas
Date: Fri Jan 16 18:30:39 2009
New Revision: 439
URL: http://svn.gnome.org/viewvc/chronojump?rev=439&view=rev

Log:
	Now we are able to connect from client gtk (corall) to server on pinux and do a ping, or insert a
	person!!!!!!
	But the webservice from the navigator still doesn't work

	fixed that a repeated person cannot get inside server: with the new serveruniqueid
	in person table.

	created server tables Sping and SEvaluator
	added src/sqlite/server.cs, remember to svn add
	added src/serverPing.cs, remember to svn add

	fixed makefile to allow 'make server' work ok, but check wsdl
	compilation

	server experimental:
	-now a person can be experimentally uploaded from client to server,
	also personSesisonWeight table
	-list of persons on server can be retrieved

	backup database active again



Added:
   trunk/src/serverPing.cs
   trunk/src/sqlite/server.cs
Modified:
   trunk/Makefile
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/changelog.txt
   trunk/chronojump_server/ChronojumpServer.cs
   trunk/chronojump_server/bin/chronojumpServer.dll
   trunk/chronojump_server/com_mono_server.txt
   trunk/glade/chronojump.glade
   trunk/sqlite_diagrams/chronojump_sqlite.dia
   trunk/src/chronojump.cs
   trunk/src/constants.cs
   trunk/src/gui/chronojump.cs
   trunk/src/gui/person.cs
   trunk/src/person.cs
   trunk/src/sqlite/main.cs
   trunk/src/sqlite/person.cs
   trunk/src/util.cs

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Fri Jan 16 18:30:39 2009
@@ -39,13 +39,13 @@
 
 CHRONOJUMP_DEP_GRAPHS = src/stats/graphs/graphData.cs src/stats/graphs/graphSerie.cs src/stats/graphs/global.cs src/stats/graphs/sjCmjAbk.cs src/stats/graphs/sjCmjAbkPlus.cs src/stats/graphs/djIndex.cs src/stats/graphs/djQ.cs src/stats/graphs/rjIndex.cs src/stats/graphs/rjPotencyBosco.cs src/stats/graphs/rjEvolution.cs src/stats/graphs/ieIub.cs src/stats/graphs/fv.cs src/stats/graphs/potency.cs src/stats/graphs/rjAVGSD.cs
 
-CHRONOJUMP_DEP_SQLITE = src/sqlite/main.cs src/sqlite/preferences.cs src/sqlite/person.cs src/sqlite/session.cs src/sqlite/jump.cs src/sqlite/jumpRj.cs src/sqlite/jumpType.cs src/sqlite/run.cs src/sqlite/runInterval.cs src/sqlite/runType.cs src/sqlite/personSession.cs src/sqlite/stat.cs src/sqlite/pulse.cs src/sqlite/pulseType.cs src/sqlite/reactionTime.cs src/sqlite/event.cs src/sqlite/sport.cs src/sqlite/speciallity.cs src/sqlite/country.cs
+CHRONOJUMP_DEP_SQLITE = src/sqlite/main.cs src/sqlite/preferences.cs src/sqlite/person.cs src/sqlite/session.cs src/sqlite/jump.cs src/sqlite/jumpRj.cs src/sqlite/jumpType.cs src/sqlite/run.cs src/sqlite/runInterval.cs src/sqlite/runType.cs src/sqlite/personSession.cs src/sqlite/stat.cs src/sqlite/pulse.cs src/sqlite/pulseType.cs src/sqlite/reactionTime.cs src/sqlite/event.cs src/sqlite/sport.cs src/sqlite/speciallity.cs src/sqlite/country.cs src/sqlite/server.cs
 
 CHRONOJUMP_DEP_EXECUTE = src/execute/event.cs src/execute/jump.cs src/execute/run.cs src/execute/pulse.cs src/execute/reactionTime.cs
 
 CHRONOJUMP_DEP_SERVER = chronojump_server/ChronojumpServer.cs
 
-CHRONOJUMP_DEP = src/chronojump.cs src/person.cs src/event.cs src/eventType.cs src/jump.cs src/jumpType.cs src/run.cs src/runType.cs src/pulse.cs src/pulseType.cs src/reactionTime.cs src/reactionTimeType.cs src/session.cs src/exportSession.cs src/treeViewEvent.cs src/treeViewPerson.cs src/treeViewJump.cs src/treeViewRun.cs src/treeViewPulse.cs src/treeViewReactionTime.cs src/util.cs src/utilGtk.cs src/constants.cs src/report.cs src/updateProgressBar.cs src/prepareEventGraphObjects.cs src/sport.cs src/log.cs $(CHRONOJUMP_DEP_GUI) $(CHRONOJUMP_DEP_STATS) $(CHRONOJUMP_DEP_GRAPHS) $(CHRONOJUMP_DEP_SQLITE) $(CHRONOJUMP_DEP_REPORT) $(CHRONOJUMP_DEP_EXECUTE) $(CHRONOJUMP_DEP_SERVER)
+CHRONOJUMP_DEP = src/chronojump.cs src/person.cs src/event.cs src/eventType.cs src/jump.cs src/jumpType.cs src/run.cs src/runType.cs src/pulse.cs src/pulseType.cs src/reactionTime.cs src/reactionTimeType.cs src/session.cs src/exportSession.cs src/treeViewEvent.cs src/treeViewPerson.cs src/treeViewJump.cs src/treeViewRun.cs src/treeViewPulse.cs src/treeViewReactionTime.cs src/util.cs src/utilGtk.cs src/constants.cs src/report.cs src/updateProgressBar.cs src/prepareEventGraphObjects.cs src/sport.cs src/log.cs src/serverPing.cs $(CHRONOJUMP_DEP_GUI) $(CHRONOJUMP_DEP_STATS) $(CHRONOJUMP_DEP_GRAPHS) $(CHRONOJUMP_DEP_SQLITE) $(CHRONOJUMP_DEP_REPORT) $(CHRONOJUMP_DEP_EXECUTE) $(CHRONOJUMP_DEP_SERVER)
 
 RESOURCES_GLADE = -resource:glade/chronojump.glade,chronojump.glade
 
@@ -106,18 +106,18 @@
 
 #--------Dependences of CHRONOJUMP_SERVER
 
-CHRONOJUMP_SERVER_DEP = chronojump_server/chronojumpServerCSharp.cs src/sqlite/*.cs src/util.cs src/person.cs src/event.cs src/jump.cs src/run.cs src/pulse.cs src/reactionTime.cs src/session.cs src/eventType.cs src/jumpType.cs src/runType.cs src/pulseType.cs src/sport.cs src/constants.cs src/log.cs 
+CHRONOJUMP_SERVER_DEP = chronojump_server/chronojumpServerCSharp.cs src/sqlite/*.cs src/util.cs src/person.cs src/event.cs src/jump.cs src/run.cs src/pulse.cs src/reactionTime.cs src/session.cs src/eventType.cs src/jumpType.cs src/runType.cs src/pulseType.cs src/sport.cs src/constants.cs src/log.cs src/serverPing.cs
 
 
 #--------Makefiles
 
 #chronojump and chronojump_mini (default if used 'make')
 all: $(CHRONOJUMP).prg $(CHRONOJUMP_MINI).prg
+server: $(CHRONOJUMP_SERVER)
 #all: $(CHRONOJUMP).prg $(CHRONOJUMP_MINI).prg $(CHRONOJUMP_MINI_VALIDATE).prg
 
-#chronojump, chronojump_mini and server (use 'make server')
-#server: $(CHRONOJUMP).prg $(CHRONOJUMP_MINI).prg $(CHRONOJUMP_SERVER)
-server: $(CHRONOJUMP_SERVER)
+#chronojump_server: use 'make server'
+server: $(CHRONOJUMP_SERVER).dll
 
 
 #-------------------------------
@@ -145,9 +145,10 @@
 # Compile server webservice & WSDL
 #------------------------------------
 
-$(CHRONOJUMP_SERVER): $(CHRONOJUMP_SERVER_DEP) chronojump_server/chronojumpServer.asmx
+$(CHRONOJUMP_SERVER).dll: $(CHRONOJUMP_SERVER_DEP) chronojump_server/chronojumpServer.asmx
 	$(MCS) -t:library -out:chronojump_server/bin/chronojumpServer.dll -r:System.Data -r:Mono.Data.Sqlite -r:System.Web.Services -r:Mono.Posix $(CHRONOJUMP_SERVER_DEP)
-	$(WSDL)
+	#currently deactivated WSDL compilation: (seems it doesn't work because when there's no network, there's no localhost)
+	#$(WSDL)
 
 
 #--------------------------

Modified: trunk/build/data/chronojump.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/chronojump_mini.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Fri Jan 16 18:30:39 2009
@@ -1,3 +1,27 @@
+Finishing the SPing code
+
+16 jan 2008
+	Now we are able to connect from client gtk (corall) to server on pinux and do a ping, or insert a
+	person!!!!!!
+	But the webservice from the navigator still doesn't work
+
+	fixed that a repeated person cannot get inside server: with the new serveruniqueid
+	in person table.
+
+	created server tables Sping and SEvaluator
+	added src/sqlite/server.cs, remember to svn add
+	added src/serverPing.cs, remember to svn add
+
+	fixed makefile to allow 'make server' work ok, but check wsdl
+	compilation
+
+	server experimental:
+	-now a person can be experimentally uploaded from client to server,
+	also personSesisonWeight table
+	-list of persons on server can be retrieved
+
+	backup database active again
+
 13 jan 2008
 	0.8.1.1
 	on gui preferences, port windows and linux with combobox

Modified: trunk/chronojump_server/ChronojumpServer.cs
==============================================================================
--- trunk/chronojump_server/ChronojumpServer.cs	(original)
+++ trunk/chronojump_server/ChronojumpServer.cs	Fri Jan 16 18:30:39 2009
@@ -13,23 +13,25 @@
 //
 
 
+using System.Collections; //ArrayList
+
 /// <remarks/>
 /// <remarks>
 ///ChronojumpServer
 ///</remarks>
-[System.Web.Services.WebServiceBinding(Name="ChronojumpServerSoap", Namespace="http://www.sampleFakeWeb.org/";)]
+[System.Web.Services.WebServiceBinding(Name="ChronojumpServerSoap", Namespace="http://80.32.81.197:8080/";)]
 [System.Diagnostics.DebuggerStepThroughAttribute()]
 [System.ComponentModel.DesignerCategoryAttribute("code")]
 public class ChronojumpServer : System.Web.Services.Protocols.SoapHttpClientProtocol {
     
     public ChronojumpServer() {
-        this.Url = "http://localhost:8080/chronojumpServer.asmx";;
+        this.Url = "http://80.32.81.197:8080/chronojumpServer.asmx";;
     }
     
     /// <remarks>
 ///Conecta BBDD
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sampleFakeWeb.org/ConnectDatabase";, RequestNamespace="http://www.sampleFakeWeb.org/";, ResponseNamespace="http://www.sampleFakeWeb.org/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/ConnectDatabase";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string ConnectDatabase() {
         object[] results = this.Invoke("ConnectDatabase", new object[0]);
         return ((string)(results[0]));
@@ -45,9 +47,27 @@
     }
     
     /// <remarks>
+///DisConecta BBDD
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/DisConnectDatabase";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public string DisConnectDatabase() {
+        object[] results = this.Invoke("DisConnectDatabase", new object[0]);
+        return ((string)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginDisConnectDatabase(System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("DisConnectDatabase", new object[0], callback, asyncState);
+    }
+    
+    public string EndDisConnectDatabase(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((string)(results[0]));
+    }
+    
+    /// <remarks>
 ///Select person name
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sampleFakeWeb.org/SelectPersonName";, RequestNamespace="http://www.sampleFakeWeb.org/";, ResponseNamespace="http://www.sampleFakeWeb.org/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectPersonName";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string SelectPersonName(int personID) {
         object[] results = this.Invoke("SelectPersonName", new object[] {
             personID});
@@ -67,10 +87,10 @@
     /// <remarks>
 ///See all persons
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sampleFakeWeb.org/SelectAllPersons";, RequestNamespace="http://www.sampleFakeWeb.org/";, ResponseNamespace="http://www.sampleFakeWeb.org/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public string[] SelectAllPersons() {
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectAllPersons";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public ArrayList SelectAllPersons() {
         object[] results = this.Invoke("SelectAllPersons", new object[0]);
-        return ((string[])(results[0]));
+        return ((ArrayList)(results[0]));
     }
     
     public System.IAsyncResult BeginSelectAllPersons(System.AsyncCallback callback, object asyncState) {
@@ -85,7 +105,7 @@
     /// <remarks>
 ///Select events from all persons
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sampleFakeWeb.org/SelectAllPersonEvents";, RequestNamespace="http://www.sampleFakeWeb.org/";, ResponseNamespace="http://www.sampleFakeWeb.org/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectAllPersonEvents";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public object[] SelectAllPersonEvents(int personID) {
         object[] results = this.Invoke("SelectAllPersonEvents", new object[] {
             personID});
@@ -103,9 +123,49 @@
     }
     
     /// <remarks>
+///Insert person
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertPerson";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int InsertPerson(Person myPerson, int sessionID) {
+        object[] results = this.Invoke("InsertPerson", new object[] {
+            myPerson, sessionID});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginInsertPerson(Person myPerson, int sessionID, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("InsertPerson", new object[] {
+            myPerson, sessionID}, callback, asyncState);
+    }
+    
+    public int EndInsertPerson(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Insert ping
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertPing";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public object[] InsertPing(ServerPing myPing) {
+        object[] results = this.Invoke("InsertPing", new object[] {
+            myPing});
+        return ((object[])(results[0]));
+    }
+    
+    public System.IAsyncResult BeginInsertPing(ServerPing myPing, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("InsertPing", new object[] {
+            myPing}, callback, asyncState);
+    }
+    
+    public object[] EndInsertPing(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((object[])(results[0]));
+    }
+
+    /// <remarks>
 ///List directory files (only as a sample)
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sampleFakeWeb.org/ListDirectory";, RequestNamespace="http://www.sampleFakeWeb.org/";, ResponseNamespace="http://www.sampleFakeWeb.org/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/ListDirectory";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string[] ListDirectory(string path) {
         object[] results = this.Invoke("ListDirectory", new object[] {
             path});

Modified: trunk/chronojump_server/bin/chronojumpServer.dll
==============================================================================
Binary files. No diff available.

Modified: trunk/chronojump_server/com_mono_server.txt
==============================================================================
--- trunk/chronojump_server/com_mono_server.txt	(original)
+++ trunk/chronojump_server/com_mono_server.txt	Fri Jan 16 18:30:39 2009
@@ -34,6 +34,9 @@
 http://localhost:8080/samples/html/button.aspx
 
 
+per a crear la base de dades de server (si no ho està fer)
+~/informatica/progs_meus/chronojump/chronojump/build/data$ mono chronojump.prg createBlankDBServer
+
 *************
 INSTALACIO
 *************
@@ -49,6 +52,8 @@
 
 instalÂlats:
 
+sembla que els apaches no calen, perà un error que tenia me l'ha dit millor amb els apaches
+
 apache_1.3.34-2ubuntu0.1_i386.deb         libapache-mod-mono_1.1.10-1_i386.deb  mono-apache-server_1.1.10-0ubuntu2_all.deb 
 apache2-utils_2.0.55-4ubuntu2.1_i386.deb  libapr0_2.0.55-4ubuntu2.1_i386.deb    mono-xsp_1.1.10-0ubuntu2_all.deb            wwwconfig-common_0.0.44_all.deb
 apache-common_1.3.34-2ubuntu0.1_i386.deb  mono-xsp-base_1.1.10-0ubuntu2_all.deb

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Fri Jan 16 18:30:39 2009
@@ -8244,7 +8244,7 @@
 		      <signal name="activate" handler="on_new_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3326">
+			<widget class="GtkImage" id="image3428">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8265,7 +8265,7 @@
 		      <signal name="activate" handler="on_open_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3327">
+			<widget class="GtkImage" id="image3429">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8286,7 +8286,7 @@
 		      <signal name="activate" handler="on_edit_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3328">
+			<widget class="GtkImage" id="image3430">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8308,7 +8308,7 @@
 		      <signal name="activate" handler="on_delete_session_activate" last_modification_time="Thu, 28 Jul 2005 13:37:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3329">
+			<widget class="GtkImage" id="image3431">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8336,7 +8336,7 @@
 		      <signal name="activate" handler="on_export_session_activate" last_modification_time="Sat, 12 Feb 2005 21:57:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3330">
+			<widget class="GtkImage" id="image3432">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-convert</property>
 			  <property name="icon_size">1</property>
@@ -8372,7 +8372,7 @@
 		      <signal name="activate" handler="on_preferences_activate" last_modification_time="Mon, 04 Oct 2004 19:19:19 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3331">
+			<widget class="GtkImage" id="image3433">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8392,6 +8392,52 @@
 		  </child>
 
 		  <child>
+		    <widget class="GtkMenuItem" id="menuitem_server">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_Server (experimental)</property>
+		      <property name="use_underline">True</property>
+
+		      <child>
+			<widget class="GtkMenu" id="menuitem_server_menu">
+
+			  <child>
+			    <widget class="GtkMenuItem" id="menuitem_server_ping">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Ping</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_menuitem_server_ping" last_modification_time="Wed, 14 Jan 2009 12:29:25 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="menuitem_server_see_all">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">See all persons</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_menuitem_server_see_all" last_modification_time="Wed, 14 Jan 2009 02:03:41 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="menuitem_server_insert_person">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Insert_current_person</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_menuitem_server_insert_person" last_modification_time="Wed, 14 Jan 2009 02:03:56 GMT"/>
+			    </widget>
+			  </child>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSeparatorMenuItem" id="separador18">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
 		    <widget class="GtkImageMenuItem" id="quit1">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_Quit</property>
@@ -8399,7 +8445,7 @@
 		      <signal name="activate" handler="on_quit1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3332">
+			<widget class="GtkImage" id="image3434">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-quit</property>
 			  <property name="icon_size">1</property>
@@ -8433,7 +8479,7 @@
 		      <signal name="activate" handler="on_person_add_single_activate" last_modification_time="Thu, 18 Aug 2005 23:07:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3333">
+			<widget class="GtkImage" id="image3435">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8454,7 +8500,7 @@
 		      <signal name="activate" handler="on_person_add_multiple_activate" last_modification_time="Thu, 18 Aug 2005 23:01:23 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3334">
+			<widget class="GtkImage" id="image3436">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8481,7 +8527,7 @@
 		      <signal name="activate" handler="on_recuperate_person_activate" last_modification_time="Sun, 12 Dec 2004 00:40:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3335">
+			<widget class="GtkImage" id="image3437">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8502,7 +8548,7 @@
 		      <signal name="activate" handler="on_recuperate_persons_from_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3336">
+			<widget class="GtkImage" id="image3438">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8529,7 +8575,7 @@
 		      <signal name="activate" handler="on_edit_current_person_clicked" last_modification_time="Sun, 17 Oct 2004 11:43:33 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3337">
+			<widget class="GtkImage" id="image3439">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8550,7 +8596,7 @@
 		      <signal name="activate" handler="on_show_all_person_events_activate" last_modification_time="Mon, 29 Aug 2005 09:51:24 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3338">
+			<widget class="GtkImage" id="image3440">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-index</property>
 			  <property name="icon_size">1</property>
@@ -8577,7 +8623,7 @@
 		      <signal name="activate" handler="on_delete_current_person_from_session_activate" last_modification_time="Thu, 28 Jul 2005 15:49:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3339">
+			<widget class="GtkImage" id="image3441">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8689,7 +8735,7 @@
 			      <signal name="activate" handler="on_button_more_clicked" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3340">
+				<widget class="GtkImage" id="image3442">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8714,7 +8760,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_clicked" last_modification_time="Sun, 17 Oct 2004 11:47:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3341">
+			<widget class="GtkImage" id="image3443">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8735,7 +8781,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_clicked" last_modification_time="Tue, 19 Oct 2004 11:54:17 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3342">
+			<widget class="GtkImage" id="image3444">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8801,7 +8847,7 @@
 			      <signal name="activate" handler="on_button_more_rj_clicked" last_modification_time="Fri, 11 Mar 2005 14:45:23 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3343">
+				<widget class="GtkImage" id="image3445">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8826,7 +8872,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3344">
+			<widget class="GtkImage" id="image3446">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8847,7 +8893,7 @@
 		      <signal name="activate" handler="on_repair_selected_reactive_jump_clicked" last_modification_time="Wed, 07 Dec 2005 01:14:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3345">
+			<widget class="GtkImage" id="image3447">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8868,7 +8914,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3346">
+			<widget class="GtkImage" id="image3448">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8895,7 +8941,7 @@
 		      <signal name="activate" handler="on_jump_type_add_activate" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3347">
+			<widget class="GtkImage" id="image3449">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9040,7 +9086,7 @@
 			      <signal name="activate" handler="on_button_run_more_clicked" last_modification_time="Fri, 22 Apr 2005 14:37:06 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3348">
+				<widget class="GtkImage" id="image3450">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9065,7 +9111,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3349">
+			<widget class="GtkImage" id="image3451">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9086,7 +9132,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3350">
+			<widget class="GtkImage" id="image3452">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9152,7 +9198,7 @@
 			      <signal name="activate" handler="on_button_run_interval_more_clicked" last_modification_time="Tue, 16 Aug 2005 01:18:41 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3351">
+				<widget class="GtkImage" id="image3453">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9177,7 +9223,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3352">
+			<widget class="GtkImage" id="image3454">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9198,7 +9244,7 @@
 		      <signal name="activate" handler="on_repair_selected_run_interval_clicked" last_modification_time="Wed, 03 May 2006 15:15:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3353">
+			<widget class="GtkImage" id="image3455">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -9219,7 +9265,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3354">
+			<widget class="GtkImage" id="image3456">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9246,7 +9292,7 @@
 		      <signal name="activate" handler="on_run_type_add_activate" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3355">
+			<widget class="GtkImage" id="image3457">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9326,7 +9372,7 @@
 		      <signal name="activate" handler="on_menuitem_view_stats_activate" last_modification_time="Tue, 26 Jul 2005 23:54:29 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3356">
+			<widget class="GtkImage" id="image3458">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9347,7 +9393,7 @@
 		      <signal name="activate" handler="on_show_report_activate" last_modification_time="Tue, 06 Sep 2005 09:10:32 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3357">
+			<widget class="GtkImage" id="image3459">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9415,7 +9461,7 @@
 		      <signal name="activate" handler="on_menuitem_manual_activate" last_modification_time="Wed, 03 Oct 2007 23:31:41 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3358">
+			<widget class="GtkImage" id="image3460">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-info</property>
 			  <property name="icon_size">1</property>
@@ -9451,7 +9497,7 @@
 		      <signal name="activate" handler="on_about1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3359">
+			<widget class="GtkImage" id="image3461">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-about</property>
 			  <property name="icon_size">1</property>
@@ -9478,7 +9524,7 @@
 		      <signal name="activate" handler="on_debug_crash_activate" last_modification_time="Thu, 23 Oct 2008 22:57:02 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3360">
+			<widget class="GtkImage" id="image3462">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-dialog-error</property>
 			  <property name="icon_size">1</property>

Modified: trunk/sqlite_diagrams/chronojump_sqlite.dia
==============================================================================
Binary files. No diff available.

Modified: trunk/src/chronojump.cs
==============================================================================
--- trunk/src/chronojump.cs	(original)
+++ trunk/src/chronojump.cs	Fri Jan 16 18:30:39 2009
@@ -54,10 +54,10 @@
 	{
 		bool timeLogPassedOk = Log.Start(args);
 		Log.WriteLine(string.Format("Time log passed: {0}", timeLogPassedOk.ToString()));
-		Log.WriteLine(string.Format("Trying database in ... " + Util.GetDatabaseDir()));
-		Log.WriteLine(string.Format("Trying database in ... " + Util.GetDatabaseTempDir()));
+		Log.WriteLine(string.Format("Client database option 1 in ... " + Util.GetDatabaseDir()));
+		Log.WriteLine(string.Format("Client database option 2 in ... " + Util.GetDatabaseTempDir()));
 		string errorFile = Log.GetFile();
-
+		
 		StreamWriter sw = new StreamWriter(new BufferedStream(new FileStream(errorFile, FileMode.Create)));
 		System.Console.SetOut(sw);
 		System.Console.SetError(sw);
@@ -72,6 +72,11 @@
 			Environment.Exit(1);
 		}
 
+		if(args.Length > 0 && args[0] == "createBlankDBServer") {
+			createBlankDBServer();
+			Environment.Exit(1);
+		}
+		
 		Catalog.Init ("chronojump", "./locale");
 			
 		new ChronoJump(args);
@@ -100,7 +105,6 @@
 		
 
 		/* SERVER COMMUNICATION TESTS */
-		/*
 		try {
 			ChronojumpServer myServer = new ChronojumpServer();
 
@@ -112,11 +116,11 @@
 			Log.WriteLine(myServer.ConnectDatabase());
 			//select name of person with uniqueid 1
 			Log.WriteLine(myServer.SelectPersonName(1));
+			Log.WriteLine(myServer.DisConnectDatabase());
 		}
 		catch {
 			Log.WriteLine("Unable to call server");
 		}
-		*/
 		/* END OF SERVER COMMUNICATION TESTS */
 
 		//print version of chronojump
@@ -172,9 +176,9 @@
 
 
 			File.Create(runningFileName);
-			Sqlite.CreateTables();
+			Sqlite.CreateTables(false); //not server
 			creatingDB = false;
-		} else {/*
+		} else {
 			//backup the database
 			Util.BackupDirCreateIfNeeded();
 
@@ -183,7 +187,6 @@
 			Util.BackupDatabase();
 			Log.WriteLine ("made a database backup"); //not compressed yet, it seems System.IO.Compression.DeflateStream and
 			//System.IO.Compression.GZipStream are not in mono
-			*/
 
 
 			if(! Sqlite.IsSqlite3()) {
@@ -285,12 +288,26 @@
 	}
 
 	private static void createBlankDB() {
-		Console.WriteLine("Creating blank database");
+		Log.WriteLine("Creating blank database");
 		Sqlite.ConnectBlank();
 		Sqlite.CreateFile();
-		Sqlite.CreateTables();
+		Sqlite.CreateTables(false); //not server
 		Console.WriteLine("Done! Exiting");
 	}
+	
+	private static void createBlankDBServer() {
+		Log.WriteLine("Creating blank database for server");
+		Log.WriteLine("Creating blank database for server2");
+		if(Sqlite.CheckFileServer())
+			Console.WriteLine("File already exists. Cannot create.");
+		else {
+			Sqlite.ConnectServer();
+			Sqlite.CreateFile();
+			Sqlite.CreateTables(true); //server
+			Console.WriteLine("Done! Exiting");
+		}
+	}
+
 
 	/* --------------------
 	/* splash window things 

Modified: trunk/src/constants.cs
==============================================================================
--- trunk/src/constants.cs	(original)
+++ trunk/src/constants.cs	Fri Jan 16 18:30:39 2009
@@ -72,6 +72,13 @@
 	public const string PulseTypeTable = "pulseType";
 	public const string ReactionTimeTypeTable = "reactionTimeType";
 
+	//server	
+	public const string ServerPingTable = "SPing"; 
+	public const string ServerEvaluatorTable = "SEvaluator"; 
+	public const string IPUnknown = "Unknown"; 
+	public static int ServerUndefinedID = -1;
+	public static string ServerOffline = Catalog.GetString("Server is currently offline.");
+
 /*	OLD, check this
 	public static string PotencyLewisCMJFormula = Catalog.GetString("Peak Power")+ " CMJ (Lewis) " +
 		"(" + Catalog.GetString("body weight") + "+" + Catalog.GetString("extra weight") + ")*9.81*" +
@@ -297,7 +304,6 @@
 	public static string ChronopicDefaultPortWindows = "COM?";
 	public static string ChronopicDefaultPortLinux = "/dev/ttyUSB?";
 	
-	public static int ServerUndefinedID = -1;
 
 	//for dialog windows
 	public enum MessageTypes {

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Fri Jan 16 18:30:39 2009
@@ -28,6 +28,7 @@
 using Mono.Unix;
 using System.IO; //"File" things
 using System.Threading;
+using System.Collections; //ArrayList
 
 
 public class ChronoJumpWindow 
@@ -57,6 +58,8 @@
 	[Widget] Gtk.ComboBox combo_runs_interval;
 	[Widget] Gtk.ComboBox combo_pulses;
 
+	[Widget] Gtk.MenuItem menuitem_server_insert_person;
+
 	[Widget] Gtk.MenuItem menuitem_edit_selected_jump;
 	[Widget] Gtk.MenuItem menuitem_delete_selected_jump;
 	[Widget] Gtk.Button button_edit_selected_jump;
@@ -907,9 +910,85 @@
 		myItem.Activated += on_delete_current_person_from_session_activate;
 		myMenu.Attach( myItem, 0, 1, 3, 4 );
 
+		/*
+		Gtk.SeparatorMenuItem mySep2 = new SeparatorMenuItem();
+		myMenu.Attach( mySep2, 0, 1, 4, 5 );
+
+		myItem = new MenuItem ( "Upload to server (experimental)");
+		myItem.Activated += on_person_upload_to_server_activate;
+		myMenu.Attach( myItem, 0, 1, 5, 6 );
+		*/
+
 		myMenu.Popup();
 		myMenu.ShowAll();
 	}
+		
+	//menu server calls
+	private void on_menuitem_server_ping (object o, EventArgs args) {
+		try {
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+
+			ServerPing myPing = new ServerPing(-1, Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
+			myServer.InsertPing(myPing);
+			
+			Log.WriteLine(myServer.DisConnectDatabase());
+
+			new DialogMessage(Constants.MessageTypes.INFO, "Inserted" + myPing.ToString());
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+	}
+
+	private void on_menuitem_server_insert_person (object o, EventArgs args) {
+		try {
+			on_person_upload_to_server_activate(o, args);
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+	}
+
+	private void on_menuitem_server_see_all (object o, EventArgs args) {
+		try {
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+			ArrayList persons = myServer.SelectAllPersons();
+			Log.WriteLine(myServer.DisConnectDatabase());
+
+			new DialogMessage(Constants.MessageTypes.INFO, "Persons in server:\n" + Util.ArrayListToSingleString(persons));
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+	}
+	
+	private void on_person_upload_to_server_activate (object o, EventArgs args) {
+		if(currentPerson.ServerUniqueID == Constants.ServerUndefinedID) {
+
+			ChronojumpServer myServer = new ChronojumpServer();
+
+			Log.WriteLine(myServer.ConnectDatabase());
+			Log.WriteLine(myServer.SelectPersonName(1));
+
+			//this inserts also in personSession using client session
+			//this maybe have to be changed in future to server session
+
+			int idAtServer = myServer.InsertPerson(currentPerson, currentSession.UniqueID);
+
+			Log.WriteLine(myServer.DisConnectDatabase());
+
+			//update person (serverUniqueID) on client database
+			currentPerson.ServerUniqueID = idAtServer;
+			SqlitePerson.Update(currentPerson);
+
+			new DialogMessage(Constants.MessageTypes.INFO, "Inserted (" + currentPerson.UniqueID + ") " + 
+					currentPerson.Name + " into server BD as ID: " + idAtServer);
+		} else {
+			new DialogMessage(Constants.MessageTypes.WARNING, "(" + currentPerson.UniqueID + ") " + 
+					currentPerson.Name + " already exists in the BD as ID: " + currentPerson.ServerUniqueID + ".\n Nothing done!.");
+		}
+
+	}
+
 
 	/* ---------------------------------------------------------
 	 * ----------------  TREEVIEW JUMPS ------------------------
@@ -4196,6 +4275,8 @@
 		//button_pulse_last.Sensitive=false;
 		
 //		button_last_delete.Sensitive = false;
+		
+		menuitem_server_insert_person.Sensitive = false;
 	}
 	
 	private void sensitiveGuiYesSession () {
@@ -4233,6 +4314,8 @@
 		
 		//menuitem_jump_type_add.Sensitive = false;
 //		button_last_delete.Sensitive = false;
+		
+		menuitem_server_insert_person.Sensitive = false;
 	}
 	
 	private void sensitiveGuiYesPerson () {
@@ -4257,6 +4340,8 @@
 		combo_runs.Sensitive = true;
 		combo_runs_interval.Sensitive = true;
 		combo_pulses.Sensitive = true;
+
+		menuitem_server_insert_person.Sensitive = true;
 	}
 	
 	private void sensitiveGuiYesEvent () {

Modified: trunk/src/gui/person.cs
==============================================================================
--- trunk/src/gui/person.cs	(original)
+++ trunk/src/gui/person.cs	Fri Jan 16 18:30:39 2009
@@ -1196,7 +1196,7 @@
 					textview2.Buffer.Text,
 					Constants.RaceUndefinedID,
 					Convert.ToInt32(Util.FindOnArray(':', 2, 0, UtilGtk.ComboGetActive(combo_countries), countries)),
-					Constants.ServerUndefinedID);
+					currentPerson.ServerUniqueID);
 
 			SqlitePerson.Update (currentPerson); 
 		

Modified: trunk/src/person.cs
==============================================================================
--- trunk/src/person.cs	(original)
+++ trunk/src/person.cs	Fri Jan 16 18:30:39 2009
@@ -179,22 +179,27 @@
 	
 	public int Height {
 		get { return height; }
+		set { height = value; }
 	}
 	
 	public int Weight {
 		get { return weight; }
+		set { weight = value; }
 	}
 	
 	public int SportID {
 		get { return sportID; }
+		set { sportID = value; }
 	}
 
 	public int SpeciallityID {
 		get { return speciallityID; }
+		set { speciallityID = value; }
 	}
 
 	public int Practice {
 		get { return practice; }
+		set { practice = value; }
 	}
 	
 	public string Description {
@@ -204,14 +209,17 @@
 	
 	public int Race {
 		get { return race; }
+		set { race = value; }
 	}
 
 	public int CountryID {
 		get { return countryID; }
+		set { countryID = value; }
 	}
 
 	public int ServerUniqueID {
 		get { return serverUniqueID; }
+		set { serverUniqueID = value; }
 	}
 
 	public int UniqueID {

Added: trunk/src/serverPing.cs
==============================================================================
--- (empty file)
+++ trunk/src/serverPing.cs	Fri Jan 16 18:30:39 2009
@@ -0,0 +1,78 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * ChronoJump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * ChronoJump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Xavier de Blas: 
+ * http://www.xdeblas.com, http://www.deporteyciencia.com (parleblas)
+ */
+
+using System;
+using System.Data;
+using System.Text; //StringBuilder
+
+using Mono.Unix;
+
+public class ServerPing
+{
+	private int uniqueID;
+	private int evaluatorID;
+	private string ip;
+	private string date;
+
+	//only initializing
+	//needed by the webservice
+	public ServerPing() {
+	}
+
+	public ServerPing(int evaluatorID, string ip, string date) {
+		this.evaluatorID = evaluatorID;
+		this.ip = ip;
+		this.date = date;
+	}
+
+	public int InsertAtDB(bool dbconOpened){
+		int myID = SqliteServer.InsertPing(dbconOpened, evaluatorID, ip, date);
+		return myID;
+	}	
+
+	public override string ToString() {
+		return "ID: " + uniqueID + "; evaluatorID: " + evaluatorID + "; IP: " + ip + "; date: " + date;
+	}
+	
+	public int UniqueID {
+		get { return uniqueID; }
+	}
+
+	//the set's are for the server
+	//"Private, internal, and protected members do not get serialized.  
+	//If the accessor is not specific, it is private by default (and will not get serialized)."
+	
+	public int EvaluatorID {
+		get { return evaluatorID; }
+		set { evaluatorID = value; }
+	}
+
+	public string IP {
+		get { return ip; }
+		set { ip = value; }
+	}
+
+	public string Date {
+		get { return date; }
+		set { date = value; }
+	}
+
+}

Modified: trunk/src/sqlite/main.cs
==============================================================================
--- trunk/src/sqlite/main.cs	(original)
+++ trunk/src/sqlite/main.cs	Fri Jan 16 18:30:39 2009
@@ -206,15 +206,6 @@
 		creatingBlankDatabase = true; 
 	}
 	
-	public static bool DisConnect() {
-		try {
-			dbcon.Close();
-		} catch {
-			return false;
-		}
-		return true;
-	}
-
 	public static void CreateFile()
 	{
 		Log.WriteLine("creating file...");
@@ -236,6 +227,7 @@
 		*/
 		dbcon.Close();
 	}
+	
 
 	public static bool CheckTables(bool defaultDBLocation)
 	{
@@ -759,10 +751,16 @@
 		}
 	}
 	
-	public static void CreateTables()
+	public static void CreateTables(bool server)
 	{
 		dbcon.Open();
 
+		if(server) {
+			SqliteServer sqliteServerObject = new SqliteServer();
+			sqliteServerObject.CreatePingTable();
+			sqliteServerObject.CreateEvaluatorTable();
+		}
+
 		creationTotal = 12;
 		creationRate = 1;
 		SqlitePerson sqlitePersonObject = new SqlitePerson();
@@ -877,11 +875,35 @@
 		if (reader.Read()) {
 			exists = true;
 		}
-		Log.WriteLine(string.Format("exists = {0}", exists.ToString()));
+		Log.WriteLine(string.Format("name exists = {0}", exists.ToString()));
 
 		dbcon.Close();
 		return exists;
 	}
+
+	/*	
+	public static bool Exists(string tableName, int findID)
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT * FROM " + tableName + 
+			" WHERE uniqueID == '" + findID + "'" ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+	
+		bool exists = new bool();
+		exists = false;
+		
+		if (reader.Read()) {
+			exists = true;
+		}
+		Log.WriteLine(string.Format("id exists = {0}", exists.ToString()));
+
+		dbcon.Close();
+		return exists;
+	}
+	*/
 	
 	/* 
 	 * temp data stuff
@@ -1121,4 +1143,36 @@
 			myReaderStr[i] = reader[i].ToString();
 		return myReaderStr;
 	}
+	
+	/* 
+	 * SERVER STUFF
+	 */
+	
+	public static string sqlFileServer = home + Path.DirectorySeparatorChar + "chronojump_server.db";
+	static string connectionStringServer = "version = 3; Data source = " + sqlFileServer;
+	
+	public static bool CheckFileServer(){
+		if (File.Exists(sqlFileServer))
+			return true;
+		else
+			return false;
+	}
+	
+	public static void ConnectServer()
+	{
+		dbcon = new SqliteConnection();
+		dbcon.ConnectionString = connectionStringServer;
+		dbcmd = dbcon.CreateCommand();
+	}
+	
+	public static bool DisConnect() {
+		try {
+			dbcon.Close();
+		} catch {
+			return false;
+		}
+		return true;
+	}
+
+
 }

Modified: trunk/src/sqlite/person.cs
==============================================================================
--- trunk/src/sqlite/person.cs	(original)
+++ trunk/src/sqlite/person.cs	Fri Jan 16 18:30:39 2009
@@ -108,6 +108,26 @@
 		return myReturn;
 	}
 		
+	//currently only used on server
+	public static ArrayList SelectAllPersons() 
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT * FROM person"; 
+		
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		ArrayList myArray = new ArrayList(1);
+
+		while(reader.Read()) 
+			myArray.Add ("(" + reader[0].ToString() + ") " + reader[1].ToString());
+
+		reader.Close();
+		dbcon.Close();
+
+		return myArray;
+	}
+		
 	public static string[] SelectAllPersonsRecuperable(string sortedBy, int except, int inSession, string searchFilterName) 
 	{
 		//sortedBy = name or uniqueID (= creation date)

Added: trunk/src/sqlite/server.cs
==============================================================================
--- (empty file)
+++ trunk/src/sqlite/server.cs	Fri Jan 16 18:30:39 2009
@@ -0,0 +1,493 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * ChronoJump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * ChronoJump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Xavier de Blas: 
+ * http://www.xdeblas.com, http://www.deporteyciencia.com (parleblas)
+ */
+
+using System;
+using System.Data;
+using System.IO;
+using System.Collections; //ArrayList
+//using Mono.Data.SqliteClient;
+//using System.Data.SqlClient;
+using Mono.Data.Sqlite;
+//using System.Data.SQLite;
+
+
+class SqliteServer : Sqlite
+{
+	public SqliteServer() {
+	}
+	
+	~SqliteServer() {}
+
+	public void CreatePingTable()
+	 {
+		dbcmd.CommandText = 
+			"CREATE TABLE " + Constants.ServerPingTable + " ( " +
+			"uniqueID INTEGER PRIMARY KEY, " +
+			"evaluatorID INT, " + //foreign key
+			"IP TEXT, " +
+			"date TEXT ) ";
+		dbcmd.ExecuteNonQuery();
+	 }
+
+	public void CreateEvaluatorTable()
+	 {
+		dbcmd.CommandText = 
+			"CREATE TABLE " + Constants.ServerEvaluatorTable + " ( " +
+			"uniqueID INTEGER PRIMARY KEY, " +
+			"code TEXT, " +
+			"name TEXT, " +
+			"email TEXT, " +
+			"dateborn TEXT, " +
+			"countryID INT, " + //foreign key
+			"confiable INT ) "; //bool
+		dbcmd.ExecuteNonQuery();
+	 }
+
+	//public static int InsertPing(ServerPing ping)
+	public static int InsertPing(bool dbconOpened, int evaluatorID, string ip, string date)
+	{
+		if(! dbconOpened)
+			dbcon.Open();
+
+		string uniqueID = "NULL";
+
+		string myString = "INSERT INTO " + Constants.ServerPingTable + 
+			" (uniqueID, evaluatorID, IP, date) VALUES (" + 
+			//uniqueID + ", " + ping.EvaluatorID + ", '" + ping.IP + "', '" + ping.Date + "')" ;
+			uniqueID + ", " + evaluatorID + ", '" + ip + "', '" + date + "')" ;
+		
+		dbcmd.CommandText = myString;
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		dbcmd.ExecuteNonQuery();
+		int myReturn = dbcon.LastInsertRowId;
+
+		if(! dbconOpened)
+			dbcon.Close();
+
+		return myReturn;
+	}
+
+
+	/*
+
+	//can be "Constants.PersonTable" or "Constants.ConvertTempTable"
+	//temp is used to modify table between different database versions if needed
+	//public static int Insert(bool dbconOpened, string tableName, string name, string sex, string dateBorn, int height, int weight, int sportID, bool sportUserDefined, int practice, string description)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, string name, string sex, string dateBorn, int height, int weight, int sportID, int speciallityID, int practice, string description, int race, int countryID, int serverUniqueID)
+	{
+		if(! dbconOpened)
+			dbcon.Open();
+
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
+		string myString = "INSERT INTO " + tableName + 
+			//" (uniqueID, name, sex, dateBorn, height, weight,  sportID, speciallityID, practice, description) VALUES (NULL, '" +
+			" (uniqueID, name, sex, dateBorn, height, weight,  sportID, speciallityID, practice, description, race, countryID, serverUniqueID) VALUES (" + uniqueID + ", '" +
+			name + "', '" + sex + "', '" + dateBorn + "', " + 
+			height + ", " + "-1" + ", " + //"-1" is weight because it's defined in personSesionWeight for allow change between sessions
+			sportID + ", " + speciallityID + ", " + practice + ", '" + description + "', " + 
+			race + ", " + countryID + ", " + serverUniqueID + ")" ;
+		
+		dbcmd.CommandText = myString;
+		dbcmd.ExecuteNonQuery();
+		int myReturn = dbcon.LastInsertRowId;
+
+		if(! dbconOpened)
+			dbcon.Close();
+
+		return myReturn;
+	}
+
+	public static string SelectJumperName(int uniqueID)
+	{
+		dbcon.Open();
+
+		dbcmd.CommandText = "SELECT name FROM " + Constants.PersonTable + " WHERE uniqueID == " + uniqueID;
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+		
+		string myReturn = "";
+		if(reader.Read()) {
+			myReturn = reader[0].ToString();
+		}
+		dbcon.Close();
+		return myReturn;
+	}
+		
+	//currently only used on server
+	public static ArrayList SelectAllPersons() 
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT * FROM person"; 
+		
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		ArrayList myArray = new ArrayList(1);
+
+		while(reader.Read()) 
+			myArray.Add ("(" + reader[0].ToString() + ") " + reader[1].ToString());
+
+		reader.Close();
+		dbcon.Close();
+
+		return myArray;
+	}
+		
+	public static string[] SelectAllPersonsRecuperable(string sortedBy, int except, int inSession, string searchFilterName) 
+	{
+		//sortedBy = name or uniqueID (= creation date)
+	
+
+		//1st select all the person.uniqueID of people who are in CurrentSession (or none if except == -1)
+		//2n select all names in database (or in one session if inSession != -1)
+		//3d filter all names (save all found in 2 that is not in 1)
+		//
+		//probably this can be made in only one time... future
+		//
+		//1
+		
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT person.uniqueID " +
+			" FROM person, personSessionWeight " +
+			" WHERE personSessionWeight.sessionID == " + except + 
+			" AND person.uniqueID == personSessionWeight.personID "; 
+		
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		ArrayList myArray = new ArrayList(2);
+
+		int count = new int();
+		count = 0;
+
+		while(reader.Read()) {
+			myArray.Add (reader[0].ToString());
+			count ++;
+		}
+
+		reader.Close();
+		dbcon.Close();
+		
+		//2
+		//sort no case sensitive when we sort by name
+		if(sortedBy == "name") { 
+			sortedBy = "lower(person.name)" ; 
+		} else { 
+			sortedBy = "person.uniqueID" ; 
+		}
+		
+		dbcon.Open();
+		if(inSession == -1) {
+			string nameLike = "";
+			if(searchFilterName != "")
+				nameLike = "LOWER(person.name) LIKE LOWER ('%" + searchFilterName + "%') AND ";
+
+			dbcmd.CommandText = 
+				"SELECT person.*, personSessionWeight.weight, sport.Name, speciallity.Name  " +
+				" FROM person, personSessionWeight, sport, speciallity " + 
+				" WHERE " + nameLike + " person.UniqueID == personSessionWeight.personID " +
+				" AND person.sportID == sport.UniqueID AND person.speciallityID == speciallity.UniqueID " +
+				" GROUP BY person.uniqueID" +
+				" ORDER BY " + sortedBy;
+		} else {
+			dbcmd.CommandText = 
+				"SELECT person.*, personSessionWeight.weight, sport.Name, speciallity.Name " +
+				" FROM person, personSessionWeight, sport, speciallity " + 
+				" WHERE personSessionWeight.sessionID == " + inSession + 
+				" AND person.uniqueID == personSessionWeight.personID " + 
+				" AND person.sportID == sport.UniqueID AND person.speciallityID == speciallity.UniqueID " +
+				" ORDER BY " + sortedBy;
+		}
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		SqliteDataReader reader2;
+		reader2 = dbcmd.ExecuteReader();
+
+		ArrayList myArray2 = new ArrayList(2);
+
+		int count2 = new int();
+		count2 = 0;
+		bool found;
+
+		//3
+		while(reader2.Read()) {
+			found = false;
+			foreach (string line in myArray) {
+				if(line == reader2[0].ToString()) {
+					found = true;
+					goto finishForeach;
+				}
+			}
+			
+finishForeach:
+			
+			if (!found) {
+				myArray2.Add (reader2[0].ToString() + ":" + reader2[1].ToString() + ":" +
+						reader2[2].ToString() + ":" + reader2[3].ToString() + ":" +
+						reader2[4].ToString() + ":" + 
+						reader2[13].ToString() + ":" + //weight (from personSessionWeight)
+						reader2[14].ToString() + ":" + //sportName
+						reader2[15].ToString() + ":" + //speciallityName
+						Util.FindLevelName(Convert.ToInt32(reader2[8])) + ":" + //levelName
+						reader2[9].ToString() //description
+						);
+					//add race, countryID, serverUniqueID
+				count2 ++;
+			}
+		}
+
+		reader2.Close();
+		dbcon.Close();
+
+		string [] myPersons = new string[count2];
+		count2 = 0;
+		foreach (string line in myArray2) {
+			myPersons [count2++] = line;
+		}
+
+		return myPersons;
+	}
+
+	public static ArrayList SelectAllPersonEvents(int personID) 
+	{
+		SqliteDataReader reader;
+		ArrayList arraySessions = new ArrayList(2);
+		ArrayList arrayJumps = new ArrayList(2);
+		ArrayList arrayJumpsRj = new ArrayList(2);
+		ArrayList arrayRuns = new ArrayList(2);
+		ArrayList arrayRunsInterval = new ArrayList(2);
+		ArrayList arrayRTs = new ArrayList(2);
+		ArrayList arrayPulses = new ArrayList(2);
+	
+		dbcon.Open();
+		
+		//session where this person is loaded
+		dbcmd.CommandText = "SELECT sessionID, session.Name, session.Place, session.Date " + 
+			" FROM personSessionWeight, session " + 
+			" WHERE personID = " + personID + " AND session.uniqueID == personSessionWeight.sessionID " +
+			" ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arraySessions.Add ( reader[0].ToString() + ":" + reader[1].ToString() + ":" +
+					reader[2].ToString() + ":" + reader[3].ToString() );
+		}
+		reader.Close();
+
+		
+		//jumps
+		dbcmd.CommandText = "SELECT sessionID, count(*) FROM jump WHERE personID = " + personID +
+			" GROUP BY sessionID ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arrayJumps.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+		}
+		reader.Close();
+		
+		//jumpsRj
+		dbcmd.CommandText = "SELECT sessionID, count(*) FROM jumpRj WHERE personID = " + personID +
+			" GROUP BY sessionID ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arrayJumpsRj.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+		}
+		reader.Close();
+		
+		//runs
+		dbcmd.CommandText = "SELECT sessionID, count(*) FROM run WHERE personID = " + personID +
+			" GROUP BY sessionID ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arrayRuns.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+		}
+		reader.Close();
+		
+		//runsInterval
+		dbcmd.CommandText = "SELECT sessionID, count(*) FROM runInterval WHERE personID = " + personID +
+			" GROUP BY sessionID ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arrayRunsInterval.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+		}
+		reader.Close();
+		
+		//reaction time
+		dbcmd.CommandText = "SELECT sessionID, count(*) FROM reactiontime WHERE personID = " + personID +
+			" GROUP BY sessionID ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arrayRTs.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+		}
+		reader.Close();
+	
+		//pulses
+		dbcmd.CommandText = "SELECT sessionID, count(*) FROM pulse WHERE personID = " + personID +
+			" GROUP BY sessionID ORDER BY sessionID";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
+		reader = dbcmd.ExecuteReader();
+		while(reader.Read()) {
+			arrayPulses.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+		}
+		reader.Close();
+	
+	
+		dbcon.Close();
+		
+	
+		ArrayList arrayAll = new ArrayList(2);
+		string tempJumps;
+		string tempJumpsRj;
+		string tempRuns;
+		string tempRunsInterval;
+		string tempRTs;
+		string tempPulses;
+		bool found; 	//using found because a person can be loaded in a session 
+				//but whithout having done any event yet
+
+		//foreach session where this jumper it's loaded, check which events has
+		foreach (string mySession in arraySessions) {
+			string [] myStrSession = mySession.Split(new char[] {':'});
+			tempJumps = "";
+			tempJumpsRj = "";
+			tempRuns = "";
+			tempRunsInterval = "";
+			tempRTs = "";
+			tempPulses = "";
+			found = false;
+			
+			foreach (string myJumps in arrayJumps) {
+				string [] myStr = myJumps.Split(new char[] {':'});
+				if(myStrSession[0] == myStr[0]) {
+					tempJumps = myStr[1];
+					found = true;
+					break;
+				}
+			}
+		
+			foreach (string myJumpsRj in arrayJumpsRj) {
+				string [] myStr = myJumpsRj.Split(new char[] {':'});
+				if(myStrSession[0] == myStr[0]) {
+					tempJumpsRj = myStr[1];
+					found = true;
+					break;
+				}
+			}
+			
+			foreach (string myRuns in arrayRuns) {
+				string [] myStr = myRuns.Split(new char[] {':'});
+				if(myStrSession[0] == myStr[0]) {
+					tempRuns = myStr[1];
+					found = true;
+					break;
+				}
+			}
+			
+			foreach (string myRunsInterval in arrayRunsInterval) {
+				string [] myStr = myRunsInterval.Split(new char[] {':'});
+				if(myStrSession[0] == myStr[0]) {
+					tempRunsInterval = myStr[1];
+					found = true;
+					break;
+				}
+			}
+			
+			foreach (string myRTs in arrayRTs) {
+				string [] myStr = myRTs.Split(new char[] {':'});
+				if(myStrSession[0] == myStr[0]) {
+					tempRTs = myStr[1];
+					found = true;
+					break;
+				}
+			}
+			
+			foreach (string myPulses in arrayPulses) {
+				string [] myStr = myPulses.Split(new char[] {':'});
+				if(myStrSession[0] == myStr[0]) {
+					tempPulses = myStr[1];
+					found = true;
+					break;
+				}
+			}
+			
+
+
+			//if has events, write it's data
+			if (found) {
+				arrayAll.Add (myStrSession[1] + ":" + myStrSession[2] + ":" + 	//session name, place
+						myStrSession[3] + ":" + tempJumps + ":" + 	//sessionDate, jumps
+						tempJumpsRj + ":" + tempRuns + ":" + 		//jumpsRj, Runs
+						tempRunsInterval + ":" + tempRTs + ":" + 	//runsInterval, Reaction times
+						tempPulses);					//pulses
+			}
+		}
+
+		return arrayAll;
+	}
+	
+	public static void Update(Person myPerson)
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "UPDATE " + Constants.PersonTable + 
+			" SET name = '" + myPerson.Name + 
+			"', sex = '" + myPerson.Sex +
+			"', dateborn = '" + myPerson.DateBorn +
+			"', height = " + myPerson.Height +
+			", weight = " + myPerson.Weight +
+			", sportID = " + myPerson.SportID +
+			", speciallityID = " + myPerson.SpeciallityID +
+			", practice = " + myPerson.Practice +
+			", description = '" + myPerson.Description +
+			"', race = " + myPerson.Race +
+			", countryID = " + myPerson.CountryID +
+			", serverUniqueID = " + myPerson.ServerUniqueID +
+			" WHERE uniqueID == '" + myPerson.UniqueID + "'" ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		dbcon.Close();
+	}
+
+	
+	public static void Delete()
+	{
+	}
+
+	*/
+}

Modified: trunk/src/util.cs
==============================================================================
--- trunk/src/util.cs	(original)
+++ trunk/src/util.cs	Fri Jan 16 18:30:39 2009
@@ -802,6 +802,14 @@
 		}
 	}
 			
+	public static string ArrayListToSingleString (ArrayList myArrayList) {
+		string myString = "";
+		foreach (string str in myArrayList) 
+			myString += str + "\n";
+
+		return myString;
+	}
+			
 	public static ArrayList AddToArrayListIfNotExist(ArrayList myArrayList, string str) {
 	 	bool found = false;
 		foreach (string str2 in myArrayList)



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