/*将SectionSchedule对应的Entity翻译为数据契约*/ void TranslateSectionScheduleEntityToSectionScheduleContractData( SectionScheduleEntity sectionScheduleEntity, SectionSchedule sectionSchedule) { sectionSchedule.ErrorMessage = sectionScheduleEntity.ErrorMessage; sectionSchedule.Count = sectionScheduleEntity.Count; sectionSchedule.Detail = new SectionScheduleItem[sectionSchedule.Count]; for (int i = 0; i < sectionSchedule.Count; i++) { sectionSchedule.Detail[i] = new SectionScheduleItem(); sectionSchedule.Detail[i].DoctorID = sectionScheduleEntity.Detail[i].DoctorID; sectionSchedule.Detail[i].Date = sectionScheduleEntity.Detail[i].Date; sectionSchedule.Detail[i].Appointed = sectionScheduleEntity.Detail[i].Appointed; sectionSchedule.Detail[i].Capacity = sectionScheduleEntity.Detail[i].Capacity; } }
/*查询科室最近一周预约的时间安排*/ public SectionSchedule GetSectionSchedule(string sectionID) { SectionScheduleEntity sectionScheduleEntity = null; if (sectionID == null) { sectionScheduleEntity = new SectionScheduleEntity(); sectionScheduleEntity.ErrorMessage = "411 Empty SectionID! @Service"; } else { sectionScheduleEntity = userLogic.GetSectionSchedule(sectionID); } SectionSchedule sectionSchedule = new SectionSchedule(); TranslateSectionScheduleEntityToSectionScheduleContractData(sectionScheduleEntity, sectionSchedule); return sectionSchedule; }