Bart Reedijk před 10 roky
rodič
revize
69a2da829d

+ 3 - 2
Proftaak Remote Healthcare/FietsClientV2/DoctorModel.cs

@@ -55,11 +55,12 @@ namespace FietsClient
             if (onlinePatients.Count != doctorSessions.Count || true)
             {
                 // ruim eerst alle doctorSessions op die niet van toepassing zijn
-                foreach (string str in doctorSessions.Keys)
+                List<string> temp = doctorSessions.Keys.ToList();
+                foreach (string str in temp)
                 {
                     if (!(onlinePatients.Any(s => str.Contains(s))))
                     {
-                        doctorform.RemoveSessionFromTabcontrol(str);
+                        doctorform.Invoke(new Action(() => doctorform.RemoveSessionFromTabcontrol(str)));
                         doctorform.Invoke(new Action(() => doctorSessions.Remove(str)));
                     }
                     //onlinePatients.Find(username => username.Equals(str));

+ 2 - 2
Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.cs

@@ -30,8 +30,8 @@ namespace FietsClient
             _connection.IncomingChatmessageEvent += new TcpConnection.ChatmassegeDelegate(printMessage);
 
             //TIJDELIJK STUK CODE OM MESSAGE TE TESTEN
-            _connection.SendString("6|TOM|TOM|Je bent een homo");
-            Console.WriteLine("Bericht versturen");
+            //_connection.SendString("6|TOM|TOM|Je bent een homo");
+            //Console.WriteLine("Bericht versturen");
             //EINDE TESTCODE
         }
 

+ 2 - 5
Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

@@ -141,7 +141,7 @@ namespace FietsClient
                             if (response_parts[1].TrimEnd('\0') != "-1")
                             {
                                 DoctorModel.doctorModel.onlinePatients = response_parts[1].TrimEnd('\0').Split('\t').ToList();
-                            } else if (response_parts[1] == "-1")
+                            } else if (response_parts[1].TrimEnd('\0') == "-1")
                             {
                                 DoctorModel.doctorModel.onlinePatients = new List<String>();
                             }
@@ -183,14 +183,11 @@ namespace FietsClient
 
             if (currentData != null)
             {
-                if (currentData.GetUserID() == receiverID)
-                {
                     String message = data[0];
 
                     // send command ( cmdID | username sender | username receiverID | message )
-                    string protocol = "6 | " + this.userID + " | " + receiverID + " | " + message;
+                    string protocol = "6|" + this.userID + "|" + receiverID + "|" + message;
                     SendString(protocol);
-                }
             }
         }
         public void SendGetActivePatients()