/*获取特定科室信息:提交SectionID,返回该科室的信息*/ public SectionInfoEntity GetSectionInfo(string sectionID) { DrPEDatabaseEntities DEntities = new DrPEDatabaseEntities(); /*查询SectionID域匹配的Section记录*/ var section = (from s in DEntities.Sections where s.SectionID == sectionID select s).FirstOrDefault(); SectionInfoEntity sectionInfoEntity = null; if (section != null) { sectionInfoEntity = new SectionInfoEntity(); sectionInfoEntity.HospitalID = section.HospitalID; sectionInfoEntity.SectionID = section.SectionID; sectionInfoEntity.Place = section.Place; sectionInfoEntity.Name = section.Name; sectionInfoEntity.Phone = section.Phone; sectionInfoEntity.Fax = section.Fax; } return sectionInfoEntity; }
/*将SectionInfo对应的Entity翻译为数据契约*/ private void TranslateSectionInfoEntityToSectionInfoContractData( SectionInfoEntity sectionInfoEntity, SectionInfo sectionInfo) { sectionInfo.ErrorMessage = sectionInfoEntity.ErrorMessage; sectionInfo.HospitalID = sectionInfoEntity.HospitalID; sectionInfo.SectionID = sectionInfoEntity.SectionID; sectionInfo.Place = sectionInfoEntity.Place; sectionInfo.Name = sectionInfoEntity.Name; sectionInfo.Phone = sectionInfoEntity.Phone; sectionInfo.Fax = sectionInfoEntity.Fax; }
/*获取特定科室信息:提交SectionID,返回该科室的信息*/ public SectionInfoEntity GetSectionInfo(string sectionID) { SectionInfoEntity sectionInfoEntity = openAccessDAO.GetSectionInfo(sectionID); if (sectionInfoEntity == null) { sectionInfoEntity = new SectionInfoEntity(); sectionInfoEntity.ErrorMessage = "142 No Section of " + sectionID + "! @Logic"; } return sectionInfoEntity; }
/*获取特定科室信息:提交SectionID,返回该科室的信息*/ public SectionInfo GetSectionInfo(string sectionID) { SectionInfoEntity sectionInfoEntity = null; if (sectionID == null) { sectionInfoEntity = new SectionInfoEntity(); sectionInfoEntity.ErrorMessage = "112 Empty sectionID! @Service"; } else { sectionInfoEntity = openAccessLogic.GetSectionInfo(sectionID); } SectionInfo sectionInfo = new SectionInfo(); TranslateSectionInfoEntityToSectionInfoContractData(sectionInfoEntity, sectionInfo); return sectionInfo; }