//funtion to get complete details by id, with return type Nurse Business object
        public NurseBO GetNurseDetails_DAL(NurseBO nurseBO)
        {
            try
            {
                using (HospitalManagementSystemDataContext objHmsDataContext = new HospitalManagementSystemDataContext(Utils.ConnectionString))
                {
                    if (objHmsDataContext.Connection.State == System.Data.ConnectionState.Closed)
                    {
                        objHmsDataContext.Connection.Open();
                    }

                    Nurse nurseDetails = objHmsDataContext.Nurses.SingleOrDefault(nurse => ((nurse.Nurse_ID == nurseBO.pid || nurse.Email_ID == nurseBO.emailID) && (nurse.Password == nurseBO.pwd)));

                    return(ConvertNurseToBO(nurseDetails));
                }
            }
            catch (Exception e)
            {
                NurseBO emptyBO = null;

                return(emptyBO);
            }
        }
 public void addNurse(Nurse nurse)
 {
     db.Nurses.Add(nurse);
     db.SaveChanges();
 }
 public List <Room> getMyRooms(Nurse n)
 {
     return(db.Rooms.Where(x => x.nurse_id == n.nurse_id).ToList());
 }
Esempio n. 4
0
 public void remove(Nurse nrs)
 {
     hmsda.remove(nrs);
 }
Esempio n. 5
0
 public void updateNurse(Nurse nurs)
 {
     hmsda.updateNurse(nurs);
 }
Esempio n. 6
0
 public void addNurse(Nurse nurse)
 {
     hmsda.addNurse(nurse);
 }
Esempio n. 7
0
 public List <Room> getMyRooms(Nurse n)
 {
     return(hmsda.getMyRooms(n));
 }
Esempio n. 8
0
 public List <IndoorPatient> getMyPatient(Nurse n)
 {
     return(hmsda.getMyPatient(n));
 }
        //Method to convert NurseBO to Nurse
        public Nurse ConvertBoTONurse(Nurse objNurse, NurseBO nurseBO)
        {
            if (nurseBO.pid != 0)
            {
                objNurse.Nurse_ID = nurseBO.pid;
            }

            if (!string.IsNullOrEmpty(nurseBO.firstName))
            {
                objNurse.First_Name = nurseBO.firstName;
            }

            if (!string.IsNullOrEmpty(nurseBO.lastName))
            {
                objNurse.Last_Name = nurseBO.lastName;
            }

            if (!string.IsNullOrEmpty(nurseBO.lastName))
            {
                objNurse.Email_ID = nurseBO.emailID;
            }

            if (!string.IsNullOrEmpty(nurseBO.pwd))
            {
                objNurse.Password = nurseBO.pwd;
            }

            if (nurseBO.dateOfBirth != DateTime.MinValue)
            {
                objNurse.DateOfBirth = nurseBO.dateOfBirth;
            }

            if (!string.IsNullOrEmpty(nurseBO.phone))
            {
                objNurse.Phone = nurseBO.phone;
            }

            if (!string.IsNullOrEmpty(nurseBO.gender))
            {
                objNurse.Gender = nurseBO.gender;
            }

            if (!string.IsNullOrEmpty(nurseBO.address))
            {
                objNurse.Address = nurseBO.address;
            }

            if (!string.IsNullOrEmpty(nurseBO.securityQn))
            {
                objNurse.Security_Question = nurseBO.securityQn;
            }

            if (!string.IsNullOrEmpty(nurseBO.securityAns))
            {
                objNurse.Security_Answer = nurseBO.securityAns;
            }

            {
                objNurse.IsActive = nurseBO.isActive;
            }

            return(objNurse);
        }