/// <summary>
 /// Prints the number of patients moved to and from a hospital ward to console window
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 internal static void PrintPatientsMovedToConsole(object sender, KrankenhausMovedPatientsEventArgs e)
 {
     Console.WriteLine($"----------------");
     Console.WriteLine($"{e.LogTime.ToString("MM/dd/yyyy HH:mm:ss")}:");
     Console.WriteLine($"----------------");
     Console.WriteLine($"Number of patients admitted to ICU = { e.NumberOfPatientsFromQueueToICU + e.NumberOfPatientsFromSanatoriumToICU} whereof {e.NumberOfPatientsFromSanatoriumToICU} patient(s) from sanatorium and {e.NumberOfPatientsFromQueueToICU} patient(s) from the queue");
     Console.WriteLine($"Number of patients admitted to Sanatorium from the queue =  {e.NumberOfPatientsFromQueueToSanatorium}");
     Console.WriteLine($"Number of newly deceased patients =  {e.NumberOfDeceasedPatients}");
     Console.WriteLine($"Number of newly recovered patients =  {e.NumberOfRecoveredPatients}");
 }
예제 #2
0
        /// <summary>
        /// Logs the number of patients moved to and from a hospital ward to a textfile location in the program catalogue.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal static void LogPatientsMovedToConsole(object sender, KrankenhausMovedPatientsEventArgs e)
        {
            string path = $"DetailedLogOfSimulations.txt";

            using (StreamWriter streamWriter = new StreamWriter(path, true))
            {
                streamWriter.WriteLine($"----------------");
                streamWriter.WriteLine($"{e.LogTime.ToString("MM/dd/yyyy HH:mm:ss")}:");
                streamWriter.WriteLine($"----------------");
                streamWriter.WriteLine($"Number of patients admitted to ICU = { e.NumberOfPatientsFromQueueToICU + e.NumberOfPatientsFromSanatoriumToICU} whereof {e.NumberOfPatientsFromSanatoriumToICU} patient(s) from sanatorium and {e.NumberOfPatientsFromQueueToICU} patient(s) from the queue");
                streamWriter.WriteLine($"Number of patients admitted to Sanatorium from the queue =  {e.NumberOfPatientsFromQueueToSanatorium}");
                streamWriter.WriteLine($"Number of newly deceased patients =  {e.NumberOfDeceasedPatients}");
                streamWriter.WriteLine($"Number of newly recovered patients =  {e.NumberOfRecoveredPatients}");
            }
        }