/*搜索疾病信息:提交关键词,返回含有该关键词的所有疾病的信息*/
        public AllDiseaseInfoEntity FindDiseaseByName(string keyword) {

            DrPEDatabaseEntities DEntities = new DrPEDatabaseEntities();
            keyword = keyword.ToLower();

            /*查询所有的疾病记录*/
            var diseases = from d in DEntities.Diseases
                           where d.Name.ToLower().Contains(keyword)
                           orderby d.DiseaseID
                           select d;

            int cnt = 0;
            int diseaseCount = diseases.Count();

            AllDiseaseInfoEntity allDiseaseInfoEntity = null;
            if (diseaseCount > 0) {
                allDiseaseInfoEntity                    = new AllDiseaseInfoEntity();
                allDiseaseInfoEntity.Count              = diseaseCount;
                allDiseaseInfoEntity.diseaseInfoEntity  = new DiseaseInfoEntity[diseaseCount];

                foreach (var d in diseases) {
                    allDiseaseInfoEntity.diseaseInfoEntity[cnt] = new DiseaseInfoEntity();

                    allDiseaseInfoEntity.diseaseInfoEntity[cnt].DiseaseID   = d.DiseaseID;
                    allDiseaseInfoEntity.diseaseInfoEntity[cnt].Name        = d.Name;
                    allDiseaseInfoEntity.diseaseInfoEntity[cnt].Description = d.Description;
                    allDiseaseInfoEntity.diseaseInfoEntity[cnt].Notice      = d.Notice;

                    cnt++;
                }
            }

            return allDiseaseInfoEntity;
        }
        /*取回所有疾病编号和名称*/
        public AllDiseaseInfoEntity RetrieveDiseaseList() {

            DrPEDatabaseEntities DEntities = new DrPEDatabaseEntities();

            /*查询所有的疾病记录*/
            var diseases = from d in DEntities.Diseases
                           orderby d.DiseaseID
                           select d;

            int cnt = 0;
            int diseaseCount = diseases.Count();

            AllDiseaseInfoEntity allDiseaseInfoEntity = null;
            if (diseaseCount > 0) {
                allDiseaseInfoEntity                    = new AllDiseaseInfoEntity();
                allDiseaseInfoEntity.Count              = diseaseCount;
                allDiseaseInfoEntity.diseaseInfoEntity  = new DiseaseInfoEntity[diseaseCount];

                foreach (var d in diseases) {
                    allDiseaseInfoEntity.diseaseInfoEntity[cnt] = new DiseaseInfoEntity();

                    allDiseaseInfoEntity.diseaseInfoEntity[cnt].DiseaseID   = d.DiseaseID;
                    allDiseaseInfoEntity.diseaseInfoEntity[cnt].Name        = d.Name;

                    cnt++;
                }
            }

            return allDiseaseInfoEntity;
        }
        /*搜索疾病信息:提交关键词,返回含有该关键词的所有疾病的信息*/
        public AllDiseaseInfoEntity FindDiseaseByName(string keyword) {
            AllDiseaseInfoEntity allDiseaseInfoEntity = openAccessDAO.FindDiseaseByName(keyword);

            if (allDiseaseInfoEntity == null) {
                allDiseaseInfoEntity = new AllDiseaseInfoEntity();
                allDiseaseInfoEntity.ErrorMessage = "154 No Disease of " + keyword + "! @Logic";
            }

            return allDiseaseInfoEntity;
        }
        /*取回所有疾病编号和名称*/
        public AllDiseaseInfoEntity RetrieveDiseaseList() {
            AllDiseaseInfoEntity allDiseaseInfoEntity = openAccessDAO.RetrieveDiseaseList();

            if (allDiseaseInfoEntity == null) {
                allDiseaseInfoEntity = new AllDiseaseInfoEntity();
                allDiseaseInfoEntity.ErrorMessage = "162 No Disease Records! @Logic";
            }

            return allDiseaseInfoEntity;
        }
        /*将AllDiseaseInfo对应的Entity翻译为数据契约,调用TranslateDiseaseInfoEntityToDiseaseInfoContractData()*/
        private void TranslateAllDiseaseInfoEntityToAllDiseaseInfoContractData(
            AllDiseaseInfoEntity allDiseaseInfoEntity,
            AllDiseaseInfo allDiseaseInfo) {

            int cnt = 0;

            allDiseaseInfo.ErrorMessage = allDiseaseInfoEntity.ErrorMessage;
            allDiseaseInfo.Count = allDiseaseInfoEntity.Count;

            if (allDiseaseInfo.Count > 0) {
                allDiseaseInfo.diseaseInfo = new DiseaseInfo[allDiseaseInfo.Count];
                for (cnt = 0; cnt < allDiseaseInfo.Count; cnt++) {
                    allDiseaseInfo.diseaseInfo[cnt] = new DiseaseInfo();
                    TranslateDiseaseInfoEntityToDiseaseInfoContractData(
                        allDiseaseInfoEntity.diseaseInfoEntity[cnt],
                        allDiseaseInfo.diseaseInfo[cnt]);
                }
            }
        }
        /*搜索疾病信息:提交关键词,返回含有该关键词的所有疾病的信息*/
        public AllDiseaseInfo FindDiseaseByName(string keyword) {
            AllDiseaseInfoEntity allDiseaseInfoEntity = null;

            if (keyword == null) {
                allDiseaseInfoEntity = new AllDiseaseInfoEntity();
                allDiseaseInfoEntity.ErrorMessage = "124 Empty Keyword of Disease Name! @Service";
            }
            else {
                allDiseaseInfoEntity = openAccessLogic.FindDiseaseByName(keyword);
            }
            AllDiseaseInfo allDiseaseInfo = new AllDiseaseInfo();
            TranslateAllDiseaseInfoEntityToAllDiseaseInfoContractData(allDiseaseInfoEntity, allDiseaseInfo);

            return allDiseaseInfo;
        }