public void GetClinc(string hospitalId, string deptId) { try { if (treePeriod.EditValue != null && treePeriod.EditValue.ToString().Length > 0) { List <ClinicInfoEntity> clinicInfo = new List <ClinicInfoEntity>(); String url = AppContext.AppConfig.serverUrl + "cms/clinic/findClinicList?hospitalId=" + hospitalId + "&deptId=" + deptId + "&workDate=" + DateTime.Now.ToString("yyyy-MM-dd") + "&period=" + treePeriod.EditValue; String data = HttpClass.httpPost(url); JObject objT = JObject.Parse(data); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { clinicInfo = new List <ClinicInfoEntity>(); clinicInfo = objT["result"].ToObject <List <ClinicInfoEntity> >(); ClinicInfoEntity dept = new ClinicInfoEntity(); dept.id = ""; dept.name = "选择诊室"; clinicInfo.Insert(0, dept); treeClinc.Properties.DataSource = clinicInfo; treeClinc.Properties.DisplayMember = "name"; treeClinc.Properties.ValueMember = "id"; } else { MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } } } catch (Exception ex) { Log4net.LogHelper.Error("临时停诊获取诊室错误信息:" + ex.Message); } }
public void GetClinicList(string hospitalId, string deptId) { try { clinicInfo = new List <ClinicInfoEntity>(); String url = AppContext.AppConfig.serverUrl + "cms/clinic/list?hospital.id=" + hospitalId + "&dept.id=" + deptId; String data = HttpClass.httpPost(url); JObject objT = JObject.Parse(data); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { clinicInfo = new List <ClinicInfoEntity>(); clinicInfo = objT["result"]["list"].ToObject <List <ClinicInfoEntity> >(); ClinicInfoEntity dept = new ClinicInfoEntity(); dept.id = ""; dept.name = "选择诊室"; clinicInfo.Insert(0, dept); repositoryItemLookUpEdit3.DataSource = clinicInfo; repositoryItemLookUpEdit3.DisplayMember = "name"; repositoryItemLookUpEdit3.ValueMember = "id"; repositoryItemLookUpEdit3.ShowHeader = false; repositoryItemLookUpEdit3.ShowFooter = false; } else { MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm); } } catch (Exception ex) { MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm); Log4net.LogHelper.Error("获取诊室列表错误信息:" + ex.Message); } }
private void ClinicSettingForm_Load(object sender, EventArgs e) { dcClinc.DataType = typeof(ClinicInfoEntity); if (clinicInfoEntity != null) { dcClinc.SetValue(clinicInfoEntity); } else { clinicInfoEntity = new ClinicInfoEntity(); } }
private void repositoryItemLookUpEdit3_Click(object sender, EventArgs e) { try { List <ClinicInfoEntity> clinicInfos = new List <ClinicInfoEntity>(); int selectRow = gridView1.GetSelectedRows()[0]; string period = this.gridView1.GetRowCellValue(selectRow, "period").ToString();//时段 if (period == TimeSlot) { return; } TimeSlot = period; string workDate = this.gridView1.GetRowCellValue(selectRow, "workDate").ToString(); //时间 string doctorId = lookUpEdit1.EditValue.ToString(); //医生ID string deptId = treeListLookUpEdit2.EditValue.ToString(); //科室ID String url = AppContext.AppConfig.serverUrl + "cms/clinic/findClinicList?hospitalId=" + AppContext.Session.hospitalId + "&deptId=" + deptId + "&period=" + period + "&workDate=" + workDate; String data = HttpClass.httpPost(url); JObject objT = JObject.Parse(data); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { clinicInfos = new List <ClinicInfoEntity>(); clinicInfos = objT["result"].ToObject <List <ClinicInfoEntity> >(); ClinicInfoEntity dept = new ClinicInfoEntity(); dept.id = ""; dept.name = "选择诊室"; clinicInfos.Insert(0, dept); repositoryItemLookUpEdit3.DataSource = clinicInfos; repositoryItemLookUpEdit3.DisplayMember = "name"; repositoryItemLookUpEdit3.ValueMember = "id"; repositoryItemLookUpEdit3.ShowHeader = false; repositoryItemLookUpEdit3.ShowFooter = false; } else { MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm); } } catch (Exception ex) { MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm); Log4net.LogHelper.Error("获取诊室列表错误信息:" + ex.Message); } }
/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { try { groupBox3.Enabled = true; dcClinc.ClearValue(); // radioGroup2.SelectedIndex = 0; var selectedRow = new ClinicInfoEntity(); selectedRow.deptId = treeMenuControl1.EditValue; selectedRow.isUse = "0"; selectedRow.isOccupy = "0"; dcClinc.SetValue(selectedRow); } catch (Exception ex) { //radioGroup2.SelectedIndex = 0; var selectedRow = new ClinicInfoEntity(); selectedRow.deptId = deptId; selectedRow.isUse = "0"; dcClinc.SetValue(selectedRow); Log4net.LogHelper.Error("诊室新增错误信息:" + ex.Message); } }