/// <summary> /// 查询 /// </summary> void Query() { try { if (this.dtmBegin.Text.Trim() == "" || this.dtmEnd.Text.Trim() == "") { MessageBox.Show("请输入查询开始时间和结束时间", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DateTime beginTime = Convert.ToDateTime(this.dtmBegin.Text + " 00:00:00"); DateTime endTime = Convert.ToDateTime(this.dtmEnd.Text + " 23:59:59"); if (beginTime > endTime) { MessageBox.Show("开始时间不能大于结束时间", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this.Cursor = Cursors.WaitCursor; string areaId = (this.bizType == 1 ? "" : this.LoginInfo.m_strInpatientAreaID); using (clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject()) { DataSource = svc.GetPretestMed(beginTime.ToString("yyyy-MM-dd HH:mm:ss"), endTime.ToString("yyyy-MM-dd HH:mm:ss"), areaId); this.dgvData.DataSource = DataSource; this.SetRowBackColor(); } DataSourceDept.Clear(); this.cboDept.Items.Clear(); List <string> lstDeptId = new List <string>(); if (DataSource != null && DataSource.Count > 0) { DataSourceDept.Add(new EntityDept() { deptId = "00", deptName = "全 院" }); EntityDept vo = null; foreach (EntityPretestMed item in DataSource) { vo = new EntityDept(); vo.deptId = item.deptId; vo.deptName = item.deptName; if (lstDeptId.IndexOf(vo.deptId) < 0) { lstDeptId.Add(vo.deptId); DataSourceDept.Add(vo); } } } foreach (EntityDept item in DataSourceDept) { this.cboDept.Items.Add(item.deptName); } } catch (Exception ex) { MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// 查询 /// </summary> void Query() { try { if (this.dtmBegin.Text.Trim() == "" || this.dtmEnd.Text.Trim() == "") { MessageBox.Show("请输入查询开始时间和结束时间", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DateTime beginTime = Convert.ToDateTime(this.dtmBegin.Text + " 00:00:00"); DateTime endTime = Convert.ToDateTime(this.dtmEnd.Text + " 23:59:59"); if (beginTime > endTime) { MessageBox.Show("开始时间不能大于结束时间", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string isHs = string.Empty; string isSf = string.Empty; string dateType = this.cboDateType.SelectedIndex.ToString(); this.Cursor = Cursors.WaitCursor; string areaId = (this.bizType == 1 ? "" : this.LoginInfo.m_strInpatientAreaID); string orderStatus = this.cboOrderStatus.Text.Trim(); switch (orderStatus) { case "审核停止": orderStatus = " and b.status_int in (3, 6) "; break; case "未停止": orderStatus = " and b.status_int not in (3, 6) "; break; default: orderStatus = ""; break; } if (this.chkHsYes.Checked) { isHs = "1"; } else if (this.chkHsNo.Checked) { isHs = "0"; } else { isHs = ""; } if (this.chkSfYes.Checked) { isSf = "1"; } else if (this.chkSfNo.Checked) { isSf = "0"; } else { isSf = ""; } using (clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject()) { DataSource = svc.GetPretestMed(beginTime.ToString("yyyy-MM-dd HH:mm:ss"), endTime.ToString("yyyy-MM-dd HH:mm:ss"), areaId, orderStatus, isHs, isSf, dateType); this.dgvData.DataSource = DataSource; this.SetRowBackColor(); } DataSourceDept.Clear(); this.cboDept.Items.Clear(); List <string> lstDeptId = new List <string>(); if (DataSource != null && DataSource.Count > 0) { DataSourceDept.Add(new EntityDept() { deptId = "00", deptName = "全 院" }); EntityDept vo = null; foreach (EntityPretestMed item in DataSource) { vo = new EntityDept(); vo.deptId = item.deptId; vo.deptName = item.deptName; if (lstDeptId.IndexOf(vo.deptId) < 0) { lstDeptId.Add(vo.deptId); DataSourceDept.Add(vo); } } } foreach (EntityDept item in DataSourceDept) { this.cboDept.Items.Add(item.deptName); } } catch (Exception ex) { MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { this.Cursor = Cursors.Default; } }