Beispiel #1
0
        public IEnumerable <PatientBO> UpdatePatient_DAL(PatientBO updatePatientDetails)
        {
            PatientDAL patientDAL = new PatientDAL();
            var        result     = patientDAL.UpdatePatientDetails_DAL(updatePatientDetails);

            if (result != "")
            {
                return(GetAllPatients_DAL());
            }
            //IEnumerable<PatientBO> emptyPatientsBO = ;
            return(null);
        }
Beispiel #2
0
        public IEnumerable <DoctorBO> GetAllDoctors_DAL()
        {
            try
            {
                IEnumerable <DoctorBO> allDoctorsBO = null;
                PatientDAL             patientDal   = new PatientDAL();
                using (HospitalManagementSystemDataContext ObjHmsDataContext = new HospitalManagementSystemDataContext(Utils.ConnectionString))
                {
                    if (ObjHmsDataContext.Connection.State == System.Data.ConnectionState.Closed)
                    {
                        ObjHmsDataContext.Connection.Open();
                    }

                    allDoctorsBO = ObjHmsDataContext.Doctors.Select(docts => new DoctorBO
                    {
                        pid           = docts.Doctor_ID,
                        firstName     = docts.First_Name,
                        lastName      = docts.Last_Name,
                        emailID       = docts.Email_ID,
                        gender        = docts.Gender,
                        dateOfBirth   = docts.DateOfBirth,
                        address       = docts.Address,
                        phone         = docts.Phone,
                        isActive      = docts.IsActive,
                        drDepartment  = (DoctorBO.DrDepartment)(Enum.Parse(typeof(DoctorBO.DrDepartment), docts.Department)),
                        drDesignation = (DoctorBO.DrDesignation)(Enum.Parse(typeof(DoctorBO.DrDesignation), docts.Designation)),
                    }).ToArray();
                    return(allDoctorsBO);
                }
            }
            catch
            {
                IEnumerable <DoctorBO> allDoctorsBO = null;
                return(allDoctorsBO);
            }
        }