DoctorSessionUC.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace FietsClient.Forms
  11. {
  12. public partial class DoctorSessionUC : UserControl
  13. {
  14. public string patientID { get; private set; }
  15. public DoctorSessionUC(string patientID)
  16. {
  17. InitializeComponent();
  18. this.patientID = patientID;
  19. }
  20. private void setDistanceButton_Click(object sender, EventArgs e)
  21. {
  22. int distance;
  23. Int32.TryParse(setDistanceBox.Text, out distance);
  24. DoctorModel.doctorModel.tcpConnection.SendDistance(distance);
  25. }
  26. private void setTimeButton_Click(object sender, EventArgs e)
  27. {
  28. int minutes, seconds;
  29. Int32.TryParse(setTimeMinutesBox.Text, out minutes);
  30. Int32.TryParse(setTimeSecondsBox.Text, out seconds);
  31. DoctorModel.doctorModel.tcpConnection.SendTime(minutes, seconds);
  32. }
  33. private void setPowerButton_Click(object sender, EventArgs e)
  34. {
  35. int power;
  36. Int32.TryParse(setPowerBox.Text, out power);
  37. DoctorModel.doctorModel.tcpConnection.SendPower(power);
  38. }
  39. private void button1_Click(object sender, EventArgs e)
  40. {
  41. DoctorModel.doctorModel.tcpConnection.SendStartStopSession(true, patientID);
  42. }
  43. private void button2_Click(object sender, EventArgs e)
  44. {
  45. DoctorModel.doctorModel.tcpConnection.SendStartStopSession(false, patientID);
  46. }
  47. }
  48. }