Exemple #1
0
 public void UnFollowAPatientSession(string username)
 {
     try
     {
         Session clientToListenTo = Program.GetSessionWithUsername(username);
         if (clientToListenTo != null)
         {
             if (clientToListenTo.DoctorsToSendDataTo.Contains(this))
             {
                 clientToListenTo.DoctorsToSendDataTo.Remove(this);
                 dynamic answer = new
                 {
                     id   = "doctor/UnfollowPatient",
                     data = new
                     {
                         status = "ok"
                     }
                 };
                 Send(JsonConvert.SerializeObject(answer));
             }
         }
         else
         {
             Send(JsonConvert.SerializeObject(Commands.UnFollowPatientError("Patient not found")));
         }
     }
     catch (Exception e)
     {
         Send(JsonConvert.SerializeObject(Commands.FollowPatientError(e.Message)));
     }
 }