public static void AdminMenu() { while (true) { Console.WriteLine("~ Admin Menu Options ~"); Console.WriteLine("\t\tAdmin listing also displays disabled entries"); Console.WriteLine("\t0 - Exit Admin Menu"); Console.WriteLine("\t1 - List All Transactions"); Console.WriteLine("\t2 - List All Patients"); Console.WriteLine("\t3 - List ALl Prescriptions"); Console.WriteLine("\t4 - List All Refills"); Console.WriteLine("\t5 - Fill Patient Refill"); Console.WriteLine("\t6 - Disable Patient"); Console.WriteLine("\t7 - Delete Patient"); Console.WriteLine("\t8 - Disable Prescription"); Console.WriteLine("\t9 - Delete Prescription"); Console.WriteLine("\t10 - Delete Refill"); switch (ConsoleIntProcessing("Enter Menu Option: ")) { case 0: return; case 1: //TODO: Admin Menu - Create List All Transaction var transaction = Processing.ListAllTransactions(); if (transaction.Count() > 0) { Console.WriteLine($"ID | Patient ID | Logged Action | Log Date Time"); foreach (var trans in transaction) { Console.WriteLine($"{trans.TransactionID} | {trans.TransactionPatientID} | {trans.TransactionAction} | {trans.TransactionEntryDateTime}"); } } break; case 2: //DONE: Admin Menu - Create List All Patients var patientsList = Processing.ListAllPatients(); if (patientsList.Count() > 0) { ListPatientOutput(patientsList); } else { Console.WriteLine("[!] No Patients to List"); } break; case 3: //DONE: Admin Menu - Create List All Precriptions var rxList = Processing.ListPrescriptions(); if (rxList.Count() > 0) { Console.WriteLine("\nListing All Entered Prescriptions"); ListPrescriptionOutput(rxList); } else { Console.WriteLine("[!] No Prescriptions to List"); } break; case 4: //DONE: Admin Menu - Create List All Refills var refillList = Processing.ListRefillsAll(); if (refillList.Count() > 0) { Console.WriteLine("\nListing All Entered Refills"); } else { Console.WriteLine("[!] No Refills to List"); } break; case 5: //HIGH: Admin Menu - Create Fill Patient Refill //List refills with filled = false //Select refill based on ID //Set filled to true //Decrement prescription refillRemaining countm var adminRefillList = Processing.AdminListRefillNeedFilled(); if (adminRefillList.Count() > 0) { Console.WriteLine("ID | Patient ID | RX ID | Refill Entry Date"); foreach (var item in adminRefillList) { Console.WriteLine($"{item.RefillID} | {item.RefillPatientID} | {item.RefillRxID} | {item.RefillEntryDate.ToString("d")}"); } int selection = ConsoleIntProcessing("Enter Refill ID: "); } else { Console.WriteLine("[!] No Refills to Fill"); } break; case 6: //TODO: Admin Menu - Create Disable Patient break; case 7: //TODO: Admin Menu - Create Delete Patient break; case 8: //TODO: Admin Menu - Create Disable Precription break; case 9: //TODO: Admin Menu - Create Delete Prescription break; case 10: //TODO: Admin Menu - Create Delete Refill break; } } }
public static void MainMenu() { while (true) { Console.WriteLine("~ Main Menu Options ~"); Console.WriteLine("\t0 - Exit Application"); Console.WriteLine("\t1 - Add Patient"); Console.WriteLine("\t2 - List Patient"); Console.WriteLine("\t3 - Select Patients"); Console.WriteLine("\t4 - "); Console.WriteLine("\t10 ~ Patient Admin Menu ~"); switch (ConsoleIntProcessing("Enter Menu Option: ")) { case 0: return; case 1: try { //Done: Menu - Add Patient with brithdate Console.WriteLine("~ Add Patient ~"); Console.Write("\tPatient First Name: "); string firstName = Console.ReadLine(); Console.Write("\tPatient Last Name: "); string lastName = Console.ReadLine(); string email = ConsoleEmailProcessing("Enter Email: "); DateTime birthDate = ConsoleDateProcessing("\tPatient Birth Date: ", "Birth"); Processing.AddPatient(firstName, lastName, email, birthDate); Console.WriteLine("Patient Added to Database"); } catch (FormatException) { } break; case 2: //DONE: Menu - List Patients Console.WriteLine(); ListPatientOutput(Processing.ListAllPatients()); break; case 3: //DONE: Menu - Select Patients if (Processing.db.Patients.Count() > 0) { Console.WriteLine(); ListPatientOutput(Processing.ListAllPatients()); } Patient selectedPatient = Processing.SelectPatient(ConsoleIntProcessing("Select Patient ID: ")); PatientMenu(selectedPatient); break; case 4: //LOW: Menu - break; case 10: //TODO: Menu - Admin Menu AdminMenu(); break; } Console.WriteLine(); } }