private static void HandleMemberFoundOutput(List <MemberDiagnosisAndCategory> memberList) { var MemberInformationOutput = _indentation + "Member ID.............................. {0}" + Environment.NewLine + _indentation + "First Name............................. {1}" + Environment.NewLine + _indentation + "Last Name.............................. {2}" + Environment.NewLine + _indentation + "Most Severe Diagnosis ID............... {3}" + Environment.NewLine + _indentation + "Most Severe Diagnosis Description...... {4}" + Environment.NewLine + _indentation + "Category ID............................ {5}" + Environment.NewLine + _indentation + "Category Description................... {6}" + Environment.NewLine + _indentation + "Category Score......................... {7}" + Environment.NewLine + _indentation + "Is Most Severe Category................ {8}" + Environment.NewLine; foreach (var memberInfo in memberList) { ScreenOutput.WriteLine(string.Empty); var output = string.Format(MemberInformationOutput, memberInfo.Member_ID.ToString(), memberInfo.First_Name, memberInfo.Last_Name, memberInfo.Most_Severe_Diagnosis_ID.ToString(), memberInfo.Most_Severe_Diagnosis_Description, memberInfo.Category_ID.ToString(), memberInfo.Category_Description, memberInfo.Category_Score.ToString(), memberInfo.Is_Most_Severe_Category); ScreenOutput.WriteLine(output, ConsoleColor.Cyan); } }
private static void ProcessUserInput() { do { ScreenOutput.Write("Memeber ID: "); var id = Console.ReadLine(); if (int.TryParse(id, out int memberId)) { LookupMemberInformation(memberId); } else { HandleMemberNotFoundOutput(); } }while (true); //Just let user manually close app }
private static string GetConnectionString() { string connectionString = string.Empty; try { connectionString = new Pulse8TestDBEntities().Database.Connection.ConnectionString; } catch (Exception ex) { ScreenOutput.WriteLine("Could not retrieve database ConnectionString, Please check your App.Config file.", ConsoleColor.Red); ScreenOutput.WriteLine(string.Empty); ScreenOutput.WriteLine("Error: " + ex.Message, ConsoleColor.Red); } return(connectionString); }
private static void HandleMemberNotFoundOutput() { ScreenOutput.WriteLine(string.Empty); ScreenOutput.WriteLine(_indentation + "Member not Found", ConsoleColor.Red); ScreenOutput.WriteLine(string.Empty); }