Example #1
0
        public override int HandleCommand(CommandContext context, ISyncResult result)
        {
            //return base.HandleCommand(context, result);

            lock (lockObj)
            {
                Console.WriteLine("HandleCommand");

                PatientRemoteObject rObject = SerializeObj.Desrialize <PatientRemoteObject>(context.sSerializeObject);

                Console.WriteLine("InvokeTag:\t" + rObject.InvokeTag);

                switch (rObject.InvokeTag)
                {
                case "NewPatient":
                    _patientManager.NewPatient(rObject.Paramters.First() as Patient);
                    result.SetSerializedObject(SerializeObj.Serialize(true));
                    break;

                case "DeletePatient":
                    _patientManager.DeletePatient((ulong)(rObject.Paramters.First()));
                    result.SetSerializedObject(SerializeObj.Serialize(true));
                    break;

                case "ModifyPatient":
                    _patientManager.ModifyPatient(rObject.Paramters.First() as Patient);
                    result.SetSerializedObject(SerializeObj.Serialize(true));
                    break;

                case "GetPatients":
                    IList <Patient> patientList = _patientManager.GetPatients();
                    result.SetSerializedObject(SerializeObj.Serialize <IList <Patient> >(patientList));
                    break;

                default:
                    break;
                }
            }

            return(0);
        }
Example #2
0
 public IList <Patient> GetPatients()
 {
     byte[] buffer = SendSyncToPatientManager("GetPatients");
     return(SerializeObj.Desrialize <IList <Patient> >(buffer));
 }
Example #3
0
 public bool ModifyPatient(Patient patient)
 {
     byte[] buffer = SendSyncToPatientManager("ModifyPatient", patient);
     return(SerializeObj.Desrialize <bool>(buffer));
 }
Example #4
0
 public bool DeletePatient(ulong patientID)
 {
     byte[] buffer = SendSyncToPatientManager("DeletePatient", patientID);
     return(SerializeObj.Desrialize <bool>(buffer));
 }