ソースを参照

Nieuwe patient aanmaken

RD125632 10 年 前
コミット
835c8f0063

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

@@ -21,7 +21,6 @@ namespace FietsClient
 
         public List<string> onlinePatients { get; set; } = new List<string>();
         public Dictionary<string, Forms.DoctorSessionUC> doctorSessions { get; set; } = new Dictionary<string, Forms.DoctorSessionUC>();
-        public List<User> activePatientObject; 
 
         private DoctorModel()
         {
@@ -52,7 +51,7 @@ namespace FietsClient
 
         public void CheckOnlineUsersUpdated()
         {
-            tcpConnection.SendGet(8);
+            tcpConnection.SendGetActivePatients();
             if (onlinePatients.Count != doctorSessions.Count || true)
             {
                 // ruim eerst alle doctorSessions op die niet van toepassing zijn

+ 10 - 2
Proftaak Remote Healthcare/FietsClientV2/FietsClient.csproj

@@ -48,9 +48,8 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+    <Reference Include="Newtonsoft.Json">
       <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
-      <Private>True</Private>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
@@ -92,6 +91,12 @@
     <Compile Include="Forms\DoctorForm.Designer.cs">
       <DependentUpon>DoctorForm.cs</DependentUpon>
     </Compile>
+    <Compile Include="Forms\NewPatientForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Forms\NewPatientForm.Designer.cs">
+      <DependentUpon>NewPatientForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="JSONObjecten\Session.cs" />
     <Compile Include="JSONObjecten\Measurement.cs" />
     <Compile Include="Forms\PatientForm.cs">
@@ -119,6 +124,9 @@
     <EmbeddedResource Include="Forms\DoctorForm.resx">
       <DependentUpon>DoctorForm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Forms\NewPatientForm.resx">
+      <DependentUpon>NewPatientForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Forms\PatientForm.resx">
       <DependentUpon>PatientForm.cs</DependentUpon>
     </EmbeddedResource>

+ 42 - 49
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.Designer.cs

@@ -33,9 +33,6 @@
             this.selectSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.sESSIONSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.selectArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.startNewSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.pauzeSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.stopSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.chatBox = new System.Windows.Forms.TextBox();
             this.messageBox = new System.Windows.Forms.TextBox();
             this.chatArea = new System.Windows.Forms.GroupBox();
@@ -43,6 +40,7 @@
             this.doctorTabControl = new System.Windows.Forms.TabControl();
             this.tabPageSummary = new System.Windows.Forms.TabPage();
             this.doctorSummaryUC1 = new FietsClient.Forms.DoctorSummaryUC();
+            this.nieuwePatientToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.menuStrip1.SuspendLayout();
             this.chatArea.SuspendLayout();
             this.doctorTabControl.SuspendLayout();
@@ -56,7 +54,8 @@
             this.archiefToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(1084, 24);
+            this.menuStrip1.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
+            this.menuStrip1.Size = new System.Drawing.Size(1445, 28);
             this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             // 
@@ -64,66 +63,48 @@
             // 
             this.archiefToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.selectSessionToolStripMenuItem,
-            this.selectArchiveToolStripMenuItem,
-            this.startNewSessionToolStripMenuItem,
-            this.pauzeSessionToolStripMenuItem,
-            this.stopSessionToolStripMenuItem});
+            this.selectArchiveToolStripMenuItem});
             this.archiefToolStripMenuItem.Name = "archiefToolStripMenuItem";
-            this.archiefToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
+            this.archiefToolStripMenuItem.Size = new System.Drawing.Size(66, 24);
             this.archiefToolStripMenuItem.Text = "Patient";
             // 
             // selectSessionToolStripMenuItem
             // 
             this.selectSessionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.sESSIONSToolStripMenuItem});
+            this.sESSIONSToolStripMenuItem,
+            this.nieuwePatientToolStripMenuItem});
             this.selectSessionToolStripMenuItem.Name = "selectSessionToolStripMenuItem";
-            this.selectSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.selectSessionToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
             this.selectSessionToolStripMenuItem.Text = "Select patient";
             // 
             // sESSIONSToolStripMenuItem
             // 
             this.sESSIONSToolStripMenuItem.Name = "sESSIONSToolStripMenuItem";
-            this.sESSIONSToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
+            this.sESSIONSToolStripMenuItem.Size = new System.Drawing.Size(183, 26);
             this.sESSIONSToolStripMenuItem.Text = "Patients";
             // 
             // selectArchiveToolStripMenuItem
             // 
             this.selectArchiveToolStripMenuItem.Name = "selectArchiveToolStripMenuItem";
-            this.selectArchiveToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.selectArchiveToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
             this.selectArchiveToolStripMenuItem.Text = "Select archive";
             // 
-            // startNewSessionToolStripMenuItem
-            // 
-            this.startNewSessionToolStripMenuItem.Name = "startNewSessionToolStripMenuItem";
-            this.startNewSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
-            this.startNewSessionToolStripMenuItem.Text = "Start new session";
-            // 
-            // pauzeSessionToolStripMenuItem
-            // 
-            this.pauzeSessionToolStripMenuItem.Name = "pauzeSessionToolStripMenuItem";
-            this.pauzeSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
-            this.pauzeSessionToolStripMenuItem.Text = "Pauze session";
-            // 
-            // stopSessionToolStripMenuItem
-            // 
-            this.stopSessionToolStripMenuItem.Name = "stopSessionToolStripMenuItem";
-            this.stopSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
-            this.stopSessionToolStripMenuItem.Text = "Stop session";
-            // 
             // chatBox
             // 
-            this.chatBox.Location = new System.Drawing.Point(0, 13);
+            this.chatBox.Location = new System.Drawing.Point(0, 16);
+            this.chatBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.chatBox.Multiline = true;
             this.chatBox.Name = "chatBox";
             this.chatBox.ReadOnly = true;
-            this.chatBox.Size = new System.Drawing.Size(228, 560);
+            this.chatBox.Size = new System.Drawing.Size(303, 688);
             this.chatBox.TabIndex = 3;
             // 
             // messageBox
             // 
-            this.messageBox.Location = new System.Drawing.Point(0, 579);
+            this.messageBox.Location = new System.Drawing.Point(0, 713);
+            this.messageBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.messageBox.Name = "messageBox";
-            this.messageBox.Size = new System.Drawing.Size(228, 20);
+            this.messageBox.Size = new System.Drawing.Size(303, 22);
             this.messageBox.TabIndex = 6;
             this.messageBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.messageBox_KeyPress);
             // 
@@ -132,18 +113,21 @@
             this.chatArea.Controls.Add(this.messageButton);
             this.chatArea.Controls.Add(this.chatBox);
             this.chatArea.Controls.Add(this.messageBox);
-            this.chatArea.Location = new System.Drawing.Point(849, 50);
+            this.chatArea.Location = new System.Drawing.Point(1132, 62);
+            this.chatArea.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.chatArea.Name = "chatArea";
-            this.chatArea.Size = new System.Drawing.Size(228, 641);
+            this.chatArea.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.chatArea.Size = new System.Drawing.Size(304, 789);
             this.chatArea.TabIndex = 5;
             this.chatArea.TabStop = false;
             this.chatArea.Text = "Chat:";
             // 
             // messageButton
             // 
-            this.messageButton.Location = new System.Drawing.Point(0, 605);
+            this.messageButton.Location = new System.Drawing.Point(0, 745);
+            this.messageButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.messageButton.Name = "messageButton";
-            this.messageButton.Size = new System.Drawing.Size(228, 30);
+            this.messageButton.Size = new System.Drawing.Size(304, 37);
             this.messageButton.TabIndex = 7;
             this.messageButton.Text = "send";
             this.messageButton.UseVisualStyleBackColor = true;
@@ -152,19 +136,21 @@
             // doctorTabControl
             // 
             this.doctorTabControl.Controls.Add(this.tabPageSummary);
-            this.doctorTabControl.Location = new System.Drawing.Point(13, 28);
+            this.doctorTabControl.Location = new System.Drawing.Point(17, 34);
+            this.doctorTabControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.doctorTabControl.Name = "doctorTabControl";
             this.doctorTabControl.SelectedIndex = 0;
-            this.doctorTabControl.Size = new System.Drawing.Size(830, 666);
+            this.doctorTabControl.Size = new System.Drawing.Size(1107, 820);
             this.doctorTabControl.TabIndex = 6;
             // 
             // tabPageSummary
             // 
             this.tabPageSummary.BackColor = System.Drawing.Color.Transparent;
             this.tabPageSummary.Controls.Add(this.doctorSummaryUC1);
-            this.tabPageSummary.Location = new System.Drawing.Point(4, 22);
+            this.tabPageSummary.Location = new System.Drawing.Point(4, 25);
+            this.tabPageSummary.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.tabPageSummary.Name = "tabPageSummary";
-            this.tabPageSummary.Size = new System.Drawing.Size(822, 640);
+            this.tabPageSummary.Size = new System.Drawing.Size(1099, 791);
             this.tabPageSummary.TabIndex = 0;
             this.tabPageSummary.Text = "Summary";
             // 
@@ -172,20 +158,29 @@
             // 
             this.doctorSummaryUC1.BackColor = System.Drawing.SystemColors.Control;
             this.doctorSummaryUC1.Location = new System.Drawing.Point(0, 0);
+            this.doctorSummaryUC1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
             this.doctorSummaryUC1.Name = "doctorSummaryUC1";
-            this.doctorSummaryUC1.Size = new System.Drawing.Size(822, 640);
+            this.doctorSummaryUC1.Size = new System.Drawing.Size(1096, 788);
             this.doctorSummaryUC1.TabIndex = 0;
             // 
+            // nieuwePatientToolStripMenuItem
+            // 
+            this.nieuwePatientToolStripMenuItem.Name = "nieuwePatientToolStripMenuItem";
+            this.nieuwePatientToolStripMenuItem.Size = new System.Drawing.Size(183, 26);
+            this.nieuwePatientToolStripMenuItem.Text = "Nieuwe Patient";
+            this.nieuwePatientToolStripMenuItem.Click += new System.EventHandler(this.nieuwePatientToolStripMenuItem_Click);
+            // 
             // DoctorForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
-            this.ClientSize = new System.Drawing.Size(1084, 701);
+            this.ClientSize = new System.Drawing.Size(1445, 863);
             this.Controls.Add(this.doctorTabControl);
             this.Controls.Add(this.chatArea);
             this.Controls.Add(this.menuStrip1);
             this.MainMenuStrip = this.menuStrip1;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "DoctorForm";
             this.Text = "Doctor";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DoctorForm_FormClosing);
@@ -211,13 +206,11 @@
         private System.Windows.Forms.TextBox messageBox;
         private System.Windows.Forms.GroupBox chatArea;
         private System.Windows.Forms.ToolStripMenuItem selectArchiveToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem startNewSessionToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem pauzeSessionToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem stopSessionToolStripMenuItem;
         private System.Windows.Forms.Button messageButton;
         private System.Windows.Forms.TabControl doctorTabControl;
         private System.Windows.Forms.TabPage tabPageSummary;
         private Forms.DoctorSummaryUC doctorSummaryUC1;
+        private System.Windows.Forms.ToolStripMenuItem nieuwePatientToolStripMenuItem;
     }
 }
 

+ 7 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using FietsClient.Forms;
 
 namespace FietsClient
 {
@@ -96,5 +97,11 @@ namespace FietsClient
             doctorModel.tcpConnection.disconnect();
             Application.Exit();
         }
+
+        private void nieuwePatientToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            var newPatient = new NewPatientForm(doctorModel.tcpConnection);
+            newPatient.Show();
+        }
     }
 }

+ 175 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/NewPatientForm.Designer.cs

@@ -0,0 +1,175 @@
+namespace FietsClient.Forms
+{
+    partial class NewPatientForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.button1 = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.textBox4 = new System.Windows.Forms.TextBox();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.passBox = new System.Windows.Forms.TextBox();
+            this.SuspendLayout();
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(173, 303);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(181, 33);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "Aanmaken";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(102, 49);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(113, 17);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "Gebruikersnaam";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(102, 161);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(54, 17);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "Leeftijd";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(102, 209);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(64, 17);
+            this.label3.TabIndex = 3;
+            this.label3.Text = "Geslacht";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(102, 261);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(58, 17);
+            this.label4.TabIndex = 4;
+            this.label4.Text = "Gewicht";
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(255, 49);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(145, 22);
+            this.textBox1.TabIndex = 5;
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(255, 158);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(145, 22);
+            this.textBox2.TabIndex = 6;
+            // 
+            // textBox4
+            // 
+            this.textBox4.Location = new System.Drawing.Point(255, 258);
+            this.textBox4.Name = "textBox4";
+            this.textBox4.Size = new System.Drawing.Size(145, 22);
+            this.textBox4.TabIndex = 8;
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "Man",
+            "Vrouw"});
+            this.comboBox1.Location = new System.Drawing.Point(255, 206);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(145, 24);
+            this.comboBox1.TabIndex = 9;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(102, 102);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(86, 17);
+            this.label5.TabIndex = 10;
+            this.label5.Text = "Wachtwoord";
+            // 
+            // passBox
+            // 
+            this.passBox.Location = new System.Drawing.Point(255, 102);
+            this.passBox.Name = "passBox";
+            this.passBox.Size = new System.Drawing.Size(145, 22);
+            this.passBox.TabIndex = 11;
+            // 
+            // NewPatientForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(551, 362);
+            this.Controls.Add(this.passBox);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.comboBox1);
+            this.Controls.Add(this.textBox4);
+            this.Controls.Add(this.textBox2);
+            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.button1);
+            this.Name = "NewPatientForm";
+            this.Text = "NewPatientForm";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.TextBox textBox4;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.TextBox passBox;
+    }
+}

+ 48 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/NewPatientForm.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FietsClient.Forms
+{
+    public partial class NewPatientForm : Form
+    {
+        private TcpConnection connection;
+        public NewPatientForm(TcpConnection tcpConnections)
+        {
+            InitializeComponent();
+            connection = tcpConnections;
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            int age;
+            int weight;
+            if (!int.TryParse(textBox2.Text, out age) || !int.TryParse(textBox4.Text, out weight))
+            {
+                MessageBox.Show("Leeftijd en Gewicht moeten numeriek zijn.");
+            }
+            else
+            {
+                bool gender;
+                if (comboBox1.SelectedText == "Man")
+                {
+                    gender = true;
+                }
+                else
+                {
+                    gender = false;
+                }
+
+                User user = new User(textBox1.Text, passBox.Text, age, gender,
+                    weight, false);
+                connection.SendNewPatient(user);
+            }
+        }
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/NewPatientForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
Proftaak Remote Healthcare/FietsClientV2/JSONObjecten/User.cs

@@ -3,8 +3,8 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using FietsClient.JSONObjecten;
 using Newtonsoft.Json;
+using FietsClient.JSONObjecten;
 
 namespace FietsClient
 {

+ 10 - 3
Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

@@ -149,9 +149,6 @@ namespace FietsClient
                                 DoctorModel.doctorModel.onlinePatients = new List<String>();
                             }
                             
-                            break;
-                        case "9":
-                            DoctorModel.doctorModel.activePatientObject = JsonConvert.DeserializeObject<List<User>>(response_parts[1]);
                             break;
                     }
                 }
@@ -177,6 +174,12 @@ namespace FietsClient
             SendString("3|" + userID + lib.JsonConverter.SerializeSession(currentData.GetSessions().Last()) + "|");
         }
 
+        public void SendNewPatient(User user)
+        {
+            // send command ( cmdID | username )
+            SendString("4|" + user.id + "|" + user.password + "|" + user.age + "|" + user.gender + "|" + user.weight + "|");
+        }
+
         public void SendNewMeasurement()
         {
             // send command ( cmdID | username )
@@ -196,6 +199,10 @@ namespace FietsClient
                     SendString(protocol);
             }
         }
+        public void SendGetActivePatients()
+        {
+            SendString("8|" + userID + "|");
+        }
 
         public void SendDistance(int distance)
         {

+ 4 - 0
Proftaak Remote Healthcare/FietsClientV2/lib/JsonConverter.cs

@@ -9,6 +9,10 @@ namespace FietsClient.lib
         {
             return JsonConvert.SerializeObject(s);
         }
+        public static string SerializeUser(User user)
+        {
+            return JsonConvert.SerializeObject(user);
+        }
 
         public static string SerializeLastMeasurement(Measurement measurement)
         {

+ 6 - 6
Proftaak Remote Healthcare/Server/AppGlobal.cs

@@ -28,6 +28,11 @@ namespace Server
             Console.WriteLine(JsonConverter.GetUserSessions(users.ElementAt(1)));
         }
 
+        public void NewUser(User user)
+        {
+            users.Add(new User(user.id, user.password, user.age, user.gender, user.weight));
+        }
+
         private void TestMethode()
         {
             users.Add(new User("no", "no", 0, false, 0));
@@ -69,12 +74,7 @@ namespace Server
         {
             return users;
         }
-
-        public List<User> GetActivePatientObjects()
-        {
-            return activePatient;
-        }
-
+        
         public List<string> GetActivePatients()
         {
             List<string> patients = new List<string>();

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

@@ -85,10 +85,9 @@ namespace Server
                                 _global.AddSession(response_parts[1], int.Parse(response_parts[2]), response_parts[3]);
                             }
                             break;
-                        case "4":   //Check nieuwe meetsessie
-
-
-
+                        case "4":  // Nieuwe patient
+                            User user = new User(response_parts[1], response_parts[2], Int32.Parse(response_parts[3]), Boolean.Parse(response_parts[4]), Int32.Parse(response_parts[5]));
+                            _global.NewUser(user);
                             break;
                         case "5":   //data pushen naar meetsessie
 
@@ -135,15 +134,6 @@ namespace Server
                                 }
                             }
                             break;
-                        case "9": //alle Patients sturen naar Doctorclient
-                            if (response_parts[1] != null)
-                            {
-                                if (response_parts[1] == "doctor" || true) //TODO: doctor check
-                                {
-                                    sendString("9|" + JsonConverter.GetPatients(_global.GetActivePatientObjects()) + "|");
-                                }
-                            }
-                            break;
                     }
                 }
             }

+ 0 - 5
Proftaak Remote Healthcare/Server/FileIO/JsonConverter.cs

@@ -21,11 +21,6 @@ namespace Server.FileIO
            return JsonConvert.SerializeObject(u);
         }
 
-        public static string GetPatients(List<User> u)
-        {
-            return JsonConvert.SerializeObject(u);
-        }
-
         public static string GetUserSessions(User patient)
         {
             return JsonConvert.SerializeObject(patient.GetSessions());

+ 5 - 0
Proftaak Remote Healthcare/Server/JSONObjecten/User.cs

@@ -21,6 +21,11 @@ namespace Server
 
         public bool isDoctor { get; private set; }
 
+        public User()
+        {
+            
+        }
+
         //Create Patient
         public User(string id, string password, int age, bool gender, int weight)
         {