private void cmbArea_SelectedIndexChanged(object sender, EventArgs e) { cmbHospital.Items.Clear(); ComboItem comboHospitalItem = new ComboItem(); comboHospitalItem.Text = "请选择"; cmbHospital.Items.Add(comboHospitalItem); if (cmbArea.SelectedIndex > 0) { m_spanRegister = m_register.GetAllocationTime(cmbArea.Text); m_register.SetAreaIndex(cmbArea.SelectedIndex - 1); HospitalBack hospital = m_register.GetHospital(); if (hospital != null) { foreach (HospitalInfo current in hospital.data.hos) { ComboItem item = new ComboItem(); item.Text = current.aliasName; cmbHospital.Items.Add(item); } } } cmbHospital.SelectedIndex = 0; }
public override HospitalBack GetHospital() { m_hosBack = null; try { if (m_areaBack != null && m_areaBack.data != null) { m_httpItem.URL = HOS_LIST_URL + m_areaBack.data.areaList[m_indexArea].areaCode; m_httpItem.ResultType = ResultType.String; m_httpItem.Method = "GET"; m_httpItem.ContentType = "text/html"; m_httpItem.Postdata = string.Empty; m_hosBack = JsonConvert.DeserializeObject <HospitalBack>(m_httpHelper.GetHtml(m_httpItem).Html); } else { m_lastError = "获取医院信息失败:地区信息为空"; } } catch (Exception err) { m_lastError = "获取医院信息失败:" + err.Message; Logger.WriteError("获取医院信息失败", err); } return(m_hosBack); }