Beispiel #1
0
        static void GetScheduledConsultations(StreamWriter logFile)
        {
            HospitalSimulatorProxy proxy = null;

            try
            {
                proxy = new HospitalSimulatorProxy();
                var consulations = proxy.ScheduledConsultations();
                WriteLine("Consulations ...", logFile);
                foreach (var c in consulations)
                {
                    WriteLine(string.Format("Scheduled {0}: with '{1}' at '{2}' on '{3}'",
                                            c.Patient, c.Doctor, c.TreatmentRoom, c.ConsulationDate), logFile);
                }
                WriteLine(string.Empty, logFile);
            }
            finally
            {
                try
                {
                    proxy.Close();
                }
                catch (Exception e)
                {
                    WriteLine(string.Format("Erroe [{0}] Executing 'GetScheduledConsultations'", e), logFile);
                    proxy.Abort();
                }
            }
        }
Beispiel #2
0
        static void GetRegisteredPatients(StreamWriter logFile)
        {
            HospitalSimulatorProxy proxy = null;

            try
            {
                proxy = new HospitalSimulatorProxy();
                var patients = proxy.RegisteredPatients();
                WriteLine("Registered Patient List...", logFile);

                foreach (var p in patients)
                {
                    WriteLine(string.Format("{0}", p), logFile);
                }
                Console.WriteLine();
            }
            finally
            {
                try
                {
                    proxy.Close();
                }
                catch (Exception e)
                {
                    WriteLine(string.Format("Erroe [{0}] Executing 'GetRegisteredPatients'", e), logFile);
                    proxy.Abort();
                }
            }
        }
Beispiel #3
0
        static void RegisterPatient(Patient p)
        {
            HospitalSimulatorProxy proxy = null;

            try
            {
                proxy = new HospitalSimulatorProxy();
                proxy.RegisterPatient(p);
            }
            finally
            {
                try
                {
                    proxy.Close();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error [{0}] Executing 'RegisterPatient'", e);
                    proxy.Abort();
                }
            }
        }
Beispiel #4
0
        static Tuple <bool, Consultation> IsRegistrationSuccessful(string patientName)
        {
            HospitalSimulatorProxy proxy = null;

            try
            {
                proxy = new HospitalSimulatorProxy();
                return(proxy.IsRegistrationSuccessful(patientName));
            }
            finally
            {
                try
                {
                    proxy.Close();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error [{0}] Executing 'RegisterPatientRequest'", e);
                    proxy.Abort();
                }
            }
        }