//显示检查记录列表 private async void ShowStudyList(StudyListType studyType, string doctorName = "") { ClearShowStudy(); this.lsbStudys.Items.Clear(); try { //查询记录 MyStudyList.StudyList = await MyStudyWebClient.GetStudyListByType(studyType, doctorName); if (MyStudyList.StudyList.Count == 0) { //MessageBox.Show(this, "没有检查记录", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information); ShowInfo($"ShowStudyList, 没有检查记录"); return; } } catch (Exception ex) { //MessageBox.Show(this, ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); ShowInfo($"ShowStudyList, 错误{Environment.NewLine}{ex}"); return; } foreach (Study study in MyStudyList.StudyList) { this.lsbStudys.Items.Add(GetStudyInfo(study)); } }
//查询记录 public async Task <List <Study> > GetStudyListByType(StudyListType studyType, string doctorName) { string requestStr = "api/Studies?"; if (studyType == StudyListType.ForDiagnose) { //待诊断记录 requestStr += $"$filter=Diagnose eq ''"; } else { //我诊断的记录 if (!string.IsNullOrWhiteSpace(doctorName)) { requestStr += $"$filter=DoctorName eq '{doctorName}'"; } } requestStr += "&$orderby=ID asc"; //执行查询记录 var studyList = await ExecGetStudyList(requestStr); return(studyList); }