/*获取该科室的Tips*/ public AllVerandaEntity GetSectionVeranda(string sectionID) { DrPEDatabaseEntities DEntities = new DrPEDatabaseEntities(); var verandas = from ve in DEntities.VerandaLonelies where ve.SectionID == sectionID orderby ve.ID descending select ve; int cnt = 0; int verandaCount = verandas.Count(); AllVerandaEntity allVerandaEntity = null; if (verandaCount > 0) { allVerandaEntity = new AllVerandaEntity(); allVerandaEntity.Count = verandaCount; allVerandaEntity.verandaEntity = new VerandaEntity[verandaCount]; foreach (var ve in verandas) { allVerandaEntity.verandaEntity[cnt] = new VerandaEntity(); allVerandaEntity.verandaEntity[cnt].Title = ve.Title; allVerandaEntity.verandaEntity[cnt].Image = ve.Image; allVerandaEntity.verandaEntity[cnt].Text = ve.Text; cnt++; } } return allVerandaEntity; }
/*获取该科室的Tips */ public AllVerandaEntity GetSectionVeranda(string sectionID) { AllVerandaEntity allVerandaEntity = openAccessDAO.GetSectionVeranda(sectionID); if (allVerandaEntity == null) { allVerandaEntity = new AllVerandaEntity(); allVerandaEntity.ErrorMessage = "None Articles! @Logic"; } return allVerandaEntity; }
/*获取该科室的Tips */ public AllVeranda GetSectionVeranda(string sectionID) { AllVerandaEntity allVerandaEntity = null; if (sectionID == null) { allVerandaEntity = new AllVerandaEntity(); allVerandaEntity.ErrorMessage = "Empty SectionID! @Service"; } else { allVerandaEntity = openAccessLogic.GetSectionVeranda(sectionID); } AllVeranda allVeranda = new AllVeranda(); TranslateAllVerandaEntityToAllVerandaContractData(allVerandaEntity, allVeranda); return allVeranda; }
private void TranslateAllVerandaEntityToAllVerandaContractData( AllVerandaEntity allVerandaEntity, AllVeranda allVeranda) { int cnt = 0; allVeranda.ErrorMessage = allVerandaEntity.ErrorMessage; allVeranda.Count = allVerandaEntity.Count; if (allVeranda.Count > 0) { allVeranda.veranda = new Veranda[allVeranda.Count]; for (cnt = 0; cnt < allVeranda.Count; cnt++) { allVeranda.veranda[cnt] = new Veranda(); allVeranda.veranda[cnt].Title = allVerandaEntity.verandaEntity[cnt].Title; allVeranda.veranda[cnt].Image = allVerandaEntity.verandaEntity[cnt].Image; allVeranda.veranda[cnt].Text = allVerandaEntity.verandaEntity[cnt].Text; } } }