/// <summary> /// 查询操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSearch_Click(object sender, EventArgs e) { string sql2 = ""; sql2 = SQL; if (cboHosptalInfo.Items.Count <= 0) { App.MsgWaring("请输入病人住院号或该住院号不正确!"); return; } pinfo temp = (pinfo)cboHosptalInfo.SelectedItem; sql2 = sql2 + " where t.patient_id=" + temp.Patient_id + " "; if (cmbOperator.Text != "请选择") { sql2 = sql2 + " and t.operator_id=" + cmbOperator.SelectedValue.ToString() + " "; } if (cboOpertContent.Text.Trim() != "请选择") { sql2 = sql2 + " and t.content like '%" + cboOpertContent.Text + "%' "; } sql2 = sql2 + " order by t.tid,t.content,t.operator_id,t.oper_time"; ucGridviewX1.DataBd(sql2, "序号", "", ""); ucGridviewX1.fg.AutoResizeColumns(); }
private void cboHosptalInfo_SelectedIndexChanged(object sender, EventArgs e) { if (cboHosptalInfo.Items.Count > 0) { pinfo temp = (pinfo)cboHosptalInfo.SelectedItem; IniOperters(temp.Patient_id); } }
/// <summary> /// 初始化病人住院信息 /// </summary> private void IniHospitalInfo() { cboHosptalInfo.Items.Clear(); string sql = "select t.patient_name as 病人姓名,t.in_time as 入院时间,(select a.happen_time from t_inhospital_action a where a.patient_id=t.id and a.next_id=0 and a.action_type='出区' and a.action_state=3) as 出院时间,t.section_name as 科室,t.id as 主键 from t_in_patient t where t.pid='" + txtPid.Text + "'"; DataSet dsHInfo = App.GetDataSet(sql); if (dsHInfo != null) { for (int i = 0; i < dsHInfo.Tables[0].Rows.Count; i++) { pinfo temp = new pinfo(); int num = i + 1; temp.Inhospitalinfo = num.ToString() + "." + "姓名:" + dsHInfo.Tables[0].Rows[i]["病人姓名"].ToString() + ",入院时间:" + dsHInfo.Tables[0].Rows[i]["入院时间"].ToString() + ",出院时间:" + dsHInfo.Tables[0].Rows[i]["出院时间"].ToString() + ",科室:" + dsHInfo.Tables[0].Rows[i]["科室"].ToString() + ",主键:" + dsHInfo.Tables[0].Rows[i]["主键"].ToString(); temp.Patient_id = dsHInfo.Tables[0].Rows[i]["主键"].ToString(); cboHosptalInfo.Items.Add(temp); } if (cboHosptalInfo.Items.Count > 0) { cboHosptalInfo.DisplayMember = "Inhospitalinfo"; cboHosptalInfo.ValueMember = "Patient_id"; cboHosptalInfo.SelectedIndex = 0; } } }