コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public static InpatientAppointment SearchInPatientBL(string searchPatientId)
        {
            InpatientAppointment searchPatient = null;

            try
            {
                searchPatient = DAL.SearchInPatientDAL(searchPatientId);
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(searchPatient);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public static bool AddInpatient(InpatientAppointment appointmentadd)
        {
            bool added = false;

            try
            {
                DAL inpatientDAL = new DAL();
                added = inpatientDAL.AddInpatientDAL(appointmentadd);
            }
            catch (Exception)
            {
                throw;
            }

            return(added);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
            }
        }