ソースを参照

Merge remote-tracking branch 'origin/feature/prepare' into feature/prepare

Conflicts:
	Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs
Mauro de Lyon 10 年 前
コミット
f79d371aa2

+ 0 - 1
Proftaak Remote Healthcare/FietsClientV2/Forms/Login.Designer.cs

@@ -211,7 +211,6 @@
         private System.Windows.Forms.Panel menuBar;
         private System.Windows.Forms.Button exit;
         private System.Windows.Forms.Label errorLBL;
-        private System.Windows.Forms.Label connectionLBL;
         private System.Windows.Forms.Button reconnectBTN;
         private System.Windows.Forms.Label connLBL;
     }

+ 3 - 3
Proftaak Remote Healthcare/FietsClientV2/Forms/Login.cs

@@ -27,13 +27,13 @@ namespace FietsClient
             InitializeComponent();
         }
 
-        public Login(String message)
+        public Login(string message)
         {
             InitializeComponent();
             errorLBL.Text = message;
         }
 
-        public void setError(String message)
+        public void setError(string message)
         {
             errorLBL.Text = message;
         }
@@ -50,7 +50,7 @@ namespace FietsClient
             }
             else
             {
-                connection.sendLogin(UsernameBox.Text, PasswordBox.Text);
+                connection.SendLogin(UsernameBox.Text, PasswordBox.Text);
                 PasswordBox.Text = "";
             }
         }

+ 2 - 2
Proftaak Remote Healthcare/FietsClientV2/PatientModel.cs

@@ -13,14 +13,14 @@ namespace FietsClient
     {
 
         private static PatientModel _patientModel;
-        public PatientForm patientform { private get; set; }
+        public PatientForm patientform { get; set; }
 
         public static PatientModel patientModel { get { return _patientModel ?? (_patientModel = new PatientModel()); } }
 
         private DataHandler dataHandler;
         private Thread workerThread;
 
-        private String powerLog;
+        private string powerLog;
 
         private PatientModel()
         {

+ 2 - 1
Proftaak Remote Healthcare/FietsClientV2/Program.cs

@@ -14,7 +14,8 @@ namespace FietsClient
         {
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Login(new TcpConnection()));
+            TcpConnection tcpConnection = new TcpConnection();
+            Application.Run(new Login(tcpConnection));
         }
     }
 }

+ 15 - 16
Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

@@ -27,9 +27,10 @@ namespace FietsClient
 
         public void connect()
         {
+
             try
             {
-                client.Connect("192.168.178.17", 1288);
+                client.Connect("145.48.226.156", 1288);
 
                 // create streams
                 serverStream = client.GetStream();
@@ -62,15 +63,15 @@ namespace FietsClient
                             {
                                 if (response_parts[1] == "1" && response_parts[2] == "1")
                                 {
-                                    Form.ActiveForm.Dispose();
-                                    new DoctorForm().Show();
+                                    DoctorForm doctorForm = new DoctorForm();
+                                    doctorForm.Show();
                                     currentData = new CurrentData(userID);
                                 }
                                 else if (response_parts[2] == "0" && response_parts[1] == "1")
                                 {
-                                    Form.ActiveForm.Dispose();
+                                    PatientForm patienForm = new PatientForm();
+                                    patienForm.Show();
                                     currentData = new CurrentData(userID);
-                                    new PatientForm().Show();
                                 }
                                 else
                                     new Login("Geen gebruiker gevonden");
@@ -87,34 +88,32 @@ namespace FietsClient
             }
         }
 
-        public void sendLogin(string username, string password)
+        public void SendLogin(string username, string password)
         {
             // send command ( cmdID | username | password )
             this.userID = username;
-            sendString("0|" + username + "|" + password);
-
+            SendString("0|" + username + "|" + password + "|");
         }
 
-        public void sendGet(int GetWhat)
+        public void SendGet(int GetWhat)
         {
             // send command ( cmdID | username )
-            sendString(GetWhat + "|" + userID);
-
+            SendString(GetWhat + "|" + userID);
         }
 
-        public void sendNewSession()
+        public void SendNewSession()
         {
             // send command ( cmdID | username )
-            sendString("3|" + userID + lib.JsonConverter.SerializeSession(currentData.GetSessions().Last()));
+            SendString("3|" + userID + lib.JsonConverter.SerializeSession(currentData.GetSessions().Last()));
         }
 
-        public void sendNewMeasurement()
+        public void SendNewMeasurement()
         {
             // send command ( cmdID | username )
-            sendString("5|" + userID + lib.JsonConverter.SerializeLastMeasurement(currentData.GetSessions().Last().GetLastMeasurement()));
+            SendString("5|" + userID + lib.JsonConverter.SerializeLastMeasurement(currentData.GetSessions().Last().GetLastMeasurement()));
         }
 
-        public void sendString(string s)
+        public void SendString(string s)
         {
             byte[] b = Encoding.ASCII.GetBytes(s);
             serverStream.Write(b, 0, b.Length);

+ 0 - 1
Proftaak Remote Healthcare/Proftaak Remote Healthcare.sln

@@ -27,7 +27,6 @@ Global
 		{06C35F7A-BA2D-4F7D-8F8E-39636027707B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection

+ 3 - 3
Proftaak Remote Healthcare/Server/Client.cs

@@ -42,7 +42,7 @@ namespace Server
                     switch (response_parts[0])
                     {
                         case "0":   //login
-                            if (response_parts.Length == 3)
+                            if (response_parts.Length == 4)
                             {
                                 int admin, id;
                                 _global.CheckLogin(response_parts[1], response_parts[2], out admin, out id);
@@ -50,11 +50,11 @@ namespace Server
                                 {
                                     if(_global.GetUsers().First(item => item.id == response_parts[1]).isDoctor)
                                     {
-                                        sendString("0|1|1");   // Doctor
+                                        sendString("0|1|1|");   // Doctor
                                     }
                                     else
                                     {
-                                        sendString("0|1|0");   //Patient
+                                        sendString("0|1|0|");   //Patient
                                     }  
                                 }
                                 else