private static void ViewHistory() { try { string searchPatientId; Console.WriteLine("Enter Patient ID to Search:"); searchPatientId = Console.ReadLine(); InpatientAppointment searchPatient = BLL.SearchInPatientBL(searchPatientId); if (searchPatient != null) { Console.WriteLine("____________________________________________________________________________"); Console.WriteLine("Patient Id\t\t Appointment Id\t\t Doctor Id"); Console.WriteLine("{0}\t\t{1}\t\t{2}\t\t{3}\t\t{4}\n\n", searchPatient.PatientId, searchPatient.AppointmentId, searchPatient.DoctorId); Console.WriteLine("Date Of Visitation\t\t Discharge Date\t\t Room Amount"); Console.WriteLine("{0}\t\t{1}\t\t{2}\t\t{3}\n\n", searchPatient.DateOfVisitation, searchPatient.DischargeDAte, searchPatient.RoomAmount); Console.WriteLine("____________________________________________________________________________"); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public static InpatientAppointment SearchInPatientBL(string searchPatientId) { InpatientAppointment searchPatient = null; try { searchPatient = DAL.SearchInPatientDAL(searchPatientId); } catch (Exception ex) { throw ex; } return(searchPatient); }
public static InpatientAppointment SearchInPatientDAL(string searchPatientId) { InpatientAppointment searchPatient = null; try { searchPatient = new InpatientAppointment(); searchPatient = (inpatientList.Find(p => p.PatientId == searchPatientId)); } catch (SystemException ex) { throw new Exception(ex.Message); } return(searchPatient); }
public static bool AddInpatient(InpatientAppointment appointmentadd) { bool added = false; try { DAL inpatientDAL = new DAL(); added = inpatientDAL.AddInpatientDAL(appointmentadd); } catch (Exception) { throw; } return(added); }
public bool AddInpatientDAL(InpatientAppointment add) { bool Added = false; try { inpatientList.Add(add); Added = true; InpatientSetSerialization(); } catch (SystemException ex) { throw new Exception(ex.Message); } return(Added); }
private static void Inpatient() { try { InpatientAppointment app = new InpatientAppointment(); Patient p = new Patient(); Console.WriteLine("Patient Id :"); string id = Console.ReadLine(); p = BLL.SearchPatientBL(id); if (p != null) { app.PatientId = id; Console.WriteLine("Appointment ID :"); app.AppointmentId = Console.ReadLine(); Console.WriteLine("Doctor Id :"); app.DoctorId = (Console.ReadLine()); Console.WriteLine("Visitation Date :"); app.DateOfVisitation = Console.ReadLine(); Console.WriteLine("Admission DAte :"); app.AdmissionDate = Console.ReadLine(); Console.WriteLine("Discharge Date"); app.DischargeDAte = Console.ReadLine(); Console.WriteLine("Room Amount"); app.RoomAmount = int.Parse(Console.ReadLine()); bool Added = BLL.AddInpatient(app); if (Added) { Console.WriteLine("Appointment Added"); } else { Console.WriteLine("Appointment not Added"); } } else { Console.WriteLine("first enter patient details before in a system.. "); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }