|
|
@@ -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);
|