//Set power from client #region public Boolean SetPowerFromClient(dynamic jsonObject) { if (!IsDoctor) { NoPermission("doctor/setPower"); return(false); } else { string patientId = jsonObject.data.patientID; Session client = Program.GetSessionWithUsername(patientId); if (client == null) { Send(JsonConvert.SerializeObject(Commands.SetPowerError("No client active with given username."))); return(false); } else { dynamic power = new { id = "client/SetPower", data = new { power = jsonObject.data.power } }; client.Send(JsonConvert.SerializeObject(power)); return(true); } } }