public static List<DoctorName> GetName() { var specializationlist = new string[] { "Consultant Gen/Laproscopic Surgeon", "General Physician", "Obstetrician & Gynecologist", "Pediatrician", "Consultant Physician", "Ortho", "ENT Surgeon", "Physiotherapist" }; DoctorName doctorname ; List<DoctorName> doctornamelist = new List<DoctorName>(); using (HMSDBEntities context = new HMSDBEntities()) { var doctorlist = context.Doctors.Include("EmployeeDetail").Where(d => specializationlist.Contains(d.Specialization.Name)).AsQueryable(); foreach (var item in doctorlist) { doctorname = new DoctorName(); doctorname.ID = item.ID; doctorname.Name = item.EmployeeDetail.FirstName + " " + item.EmployeeDetail.LastName; doctornamelist.Add(doctorname); } } return doctornamelist; }
public static List<DoctorName> GetLabDoctor() { var specializationlist = new string[] { "Pathologist", "Bio Chemistry" }; DoctorName doctorname; List<DoctorName> doctornamelist = new List<DoctorName>(); using (HMSDBEntities context = new HMSDBEntities()) { var doctorlist = context.Doctors.Include("EmployeeDetail").Where(d => specializationlist.Contains(d.Specialization.Name)).AsQueryable(); foreach (var item in doctorlist) { doctorname = new DoctorName(); doctorname.ID = item.ID; doctorname.Name = item.EmployeeDetail.FirstName + " " + item.EmployeeDetail.LastName; doctornamelist.Add(doctorname); } } return doctornamelist; }