Forráskód Böngészése

added list send command

Mauro de Lyon 10 éve
szülő
commit
a9f2b83e43

+ 14 - 1
Proftaak Remote Healthcare/ServerV2/AppGlobal.cs

@@ -167,7 +167,7 @@ namespace ServerV2
                         }
                         break;
                     case "9": //alles doorsturen voor de dokter
-                        //insert code to send list
+                        Communication.SendMessage(client, FileIO.JsonConverter.GetUsers(users));
                         break;
                     default:
                         break;
@@ -176,6 +176,19 @@ namespace ServerV2
         }
 
     }
+
+    class Client
+    {
+        public TcpClient tcpClient;
+        public string username;
+
+        public Client(TcpClient tcpClient, string username)
+        {
+            this.tcpClient = tcpClient;
+            this.username = username;
+        }
+
+    }
 }
 
 

+ 0 - 24
Proftaak Remote Healthcare/ServerV2/Client.cs

@@ -1,24 +0,0 @@
-using ServerV2.JSONObjecten;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Sockets;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ServerV2
-{
-    class Client
-    {
-        public TcpClient tcpClient;
-        public string username;
-
-        public Client(TcpClient tcpClient, string username)
-        {
-            this.tcpClient = tcpClient;
-            this.username = username;
-        }
-
-    }
-}

+ 5 - 0
Proftaak Remote Healthcare/ServerV2/Libraries/JsonConverter.cs

@@ -36,5 +36,10 @@ namespace ServerV2.FileIO
             return JsonConvert.SerializeObject(currentSession.GetMeasurement());
         }
 
+        public static string GetUsers(List<User> user)
+        {
+            return JsonConvert.SerializeObject(user);
+        }
+
     }
 }

+ 0 - 1
Proftaak Remote Healthcare/ServerV2/ServerV2.csproj

@@ -48,7 +48,6 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="AppGlobal.cs" />
-    <Compile Include="Client.cs" />
     <Compile Include="JSONObjecten\Measurement.cs" />
     <Compile Include="JSONObjecten\Session.cs" />
     <Compile Include="JSONObjecten\User.cs" />