public void GetOrder(List <Tuple <int, string> > department, int userOption, List <patientAppointment> Patient_name) { patientAppointment patientdetails = new patientAppointment(); foreach (Tuple <int, string> tuple in department) //loop inside the Tuple { if (tuple.Item1 == userOption) { patientdetails.Checkup_Name = tuple.Item2; // order.Price = tuple.Item3; } } Console.WriteLine("Enter the date of appointment:"); do { //Prompt and obtain user input //get Date of Birth Console.Write("Date of Appointment: (dd/mm/yyyy): "); patientdetails.Date_Timing = Console.ReadLine(); //validate date input if empty and if satisfies formatting conditions if (!string.IsNullOrEmpty(patientdetails.Date_Timing) && DateCheck(patientdetails.Date_Timing)) { //end loop break; } //Ask the user to repeatedly enter the value until a valid value has been entered } while (true); patientdetails.Correct_time = patientdetails.Date_Timing; Patient_name.Add(patientdetails); }
public void Cardiology_list(List <patientAppointment> Patient_name) { int userOption; string whileOption; patientAppointment patientdetails = new patientAppointment(); var Cardiology = new List <Tuple <int, string> >() { new Tuple <int, string>(1, "Appointment with Dr.Rajesh "), new Tuple <int, string>(2, "Appointment with Dr.Mugil "), new Tuple <int, string>(3, "Appointment with Dr.Kadhir "), new Tuple <int, string>(4, "Appointment with Dr.Karthik "), new Tuple <int, string>(5, "Blood Test Check "), new Tuple <int, string>(6, "Chest X-Ray "), new Tuple <int, string>(7, "MRI scanning "), }; do { Console.WriteLine("\t\t Cardiology check:"); Console.WriteLine(); Console.WriteLine($"{"SNo.",10}\t{"Check Ups",10}"); foreach (Tuple <int, string> department in Cardiology) { Console.WriteLine($"{department.Item1,10}\t{department.Item2,10}"); } Console.WriteLine(); Console.WriteLine("Enter your option"); var choiceasString = Console.ReadLine(); while (!int.TryParse(choiceasString, out userOption)) { Console.WriteLine("This is not a number!"); choiceasString = Console.ReadLine(); } while ((userOption > 7) || (userOption <= 0)) { Console.WriteLine("Enter a number less than 7 and greater than 0!"); choiceasString = Console.ReadLine(); while (!int.TryParse(choiceasString, out userOption)) { Console.WriteLine("This is not a number!"); choiceasString = Console.ReadLine(); } } patientdetails.GetOrder(Cardiology, userOption, Patient_name); patientdetails.Display(Patient_name); whileOption = "y"; } while (whileOption == "Y" || whileOption == "y"); }
public void Generalcheckup_list(List <patientAppointment> Patient_name) { int userOption; string whileOption; patientAppointment patientdetails = new patientAppointment(); var Generalcheckup = new List <Tuple <int, string> >() { new Tuple <int, string>(1, "Check up with Dr.Sheela "), new Tuple <int, string>(2, "Check up with Dr.Priya "), new Tuple <int, string>(3, "Blood Test "), new Tuple <int, string>(4, "Eye Check up "), new Tuple <int, string>(5, "Tooth check up "), new Tuple <int, string>(6, "Master check up "), new Tuple <int, string>(7, "CHeck up with Dr.Akil "), }; do { Console.WriteLine("\t\t General check up:"); Console.WriteLine(); Console.WriteLine($"{"SNo.",10}\t{"Check Ups",10}"); foreach (Tuple <int, string> department in Generalcheckup) { Console.WriteLine($"{department.Item1,10}\t{department.Item2,10}"); } Console.WriteLine(); Console.WriteLine("Enter your option"); var choiceasString = Console.ReadLine(); while (!int.TryParse(choiceasString, out userOption)) { Console.WriteLine("This is not a number!"); choiceasString = Console.ReadLine(); } while ((userOption > 7) || (userOption <= 0)) { Console.WriteLine("Enter a number less than 7 and greater than 0!"); choiceasString = Console.ReadLine(); while (!int.TryParse(choiceasString, out userOption)) { Console.WriteLine("This is not a number!"); choiceasString = Console.ReadLine(); } } patientdetails.GetOrder(Generalcheckup, userOption, Patient_name); patientdetails.Display(Patient_name); whileOption = "y"; } while (whileOption == "Y" || whileOption == "y"); }
public void Dermatology_list(List <patientAppointment> Patient_name) { int userOption = 0; string whileOption; patientAppointment patientdetails = new patientAppointment(); var Dermatology = new List <Tuple <int, string> >() { new Tuple <int, string>(1, "Appointment with Dr.Kalyani "), new Tuple <int, string>(2, "Appointmnet with Dr.Fathima "), new Tuple <int, string>(3, "Appointment with Dr.Prem "), new Tuple <int, string>(4, "MRI scanning "), new Tuple <int, string>(5, "CT Scan "), new Tuple <int, string>(6, "Xray for Brain "), new Tuple <int, string>(7, "Angiography "), }; do { Console.WriteLine("\t\t Deramtology Check:"); Console.WriteLine(); Console.WriteLine($"{"SNo.",10}\t{"Check ups:",10}"); foreach (Tuple <int, string> department in Dermatology) { Console.WriteLine($"{department.Item1,10}\t{department.Item2,10}"); } Console.WriteLine(); Console.WriteLine("Enter your option"); var choiceasString = Console.ReadLine(); while (!int.TryParse(choiceasString, out userOption)) { Console.WriteLine("This is not a number!"); choiceasString = Console.ReadLine(); } while ((userOption > 7) || (userOption <= 0)) { Console.WriteLine("Enter a number less than 7 and greater than 0!"); choiceasString = Console.ReadLine(); while (!int.TryParse(choiceasString, out userOption)) { Console.WriteLine("This is not a number!"); choiceasString = Console.ReadLine(); } } patientdetails.GetOrder(Dermatology, userOption, Patient_name); patientdetails.Display(Patient_name); whileOption = "y"; } while (whileOption == "Y" || whileOption == "y"); }
public static void Delete(List <patientAppointment> Patient_name) { bool ConfirmResult = true; int UpdateOption = 0; string Getupdateoption; patientAppointment pt = new patientAppointment(); Console.WriteLine("Which Item you want to Delete"); do { Getupdateoption = Console.ReadLine(); while (!int.TryParse(Getupdateoption, out UpdateOption)) { Console.WriteLine("This is not a number!"); Getupdateoption = Console.ReadLine(); } ConfirmResult = false; Patient_name.RemoveAll(idel => idel.SNo == UpdateOption); } while (ConfirmResult == true); Console.WriteLine("Updated Appointment details:"); pt.Display(Patient_name); }
public static void Update(List <patientAppointment> Patient_name) { bool ConfirmResult = true; int UpdateOption = 0; string Getupdateoption; string UpdateQuantity = " "; bool result = true; patientAppointment pt = new patientAppointment(); Console.WriteLine("Which Item you want to update"); do { Getupdateoption = Console.ReadLine(); while (!int.TryParse(Getupdateoption, out UpdateOption)) { Console.WriteLine("This is not a number!"); Getupdateoption = Console.ReadLine(); } foreach (patientAppointment i in Patient_name) { if (UpdateOption == i.SNo) { ConfirmResult = false; Console.WriteLine("Enter the appointment date you want to change"); //Getting the update quantity do { //Prompt and obtain user input //get Date of Birth Console.Write("Date of Appointment: (dd/mm/yyyy): "); UpdateQuantity = Console.ReadLine(); //i.Correct_time = UpdateQuantity; //validate date input if empty and if satisfies formatting conditions if (!string.IsNullOrEmpty(UpdateQuantity) && dateCheck(UpdateQuantity)) { //end loop result = false; i.Correct_time = UpdateQuantity; } //Ask the user to repeatedly enter the value until a valid value has been entered } while (result == true); // Checking its a proper number i.Correct_time = UpdateQuantity; } } if (ConfirmResult == true) { Console.WriteLine("Item doesnt Exist"); Console.WriteLine("Which Item you want to update"); ConfirmResult = true; } } while (ConfirmResult == true); Console.WriteLine("Updated Appointment details"); pt.Display(Patient_name); }