/// <summary> /// 分配床位确认 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConfirmAssign_Click(object sender, EventArgs e) { try { if (patName == null || queryTextBox1.Text == "") { MessageBox.Show("您还未录入主管医生或未选择病人信息,请录入完整后再进行操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.queryTextBox1.Focus(); return; } else { if (op_bed.IsOut(patID)) { MessageBox.Show("该病人已结算,不能分配床位,请刷新病人"); return; } bedinfo.BED_NO = bedNO; bedinfo.PATLIST_ID = patID; bedinfo.BED_SEX = patSEX; bedinfo.DEPT_ID = deptid; bedinfo.ZY_DOC = int.Parse(queryTextBox1.MemberValue.ToString()); } DialogResult dr = MessageBox.Show("您确定将【" + bedNO + "】号床分配给病人【" + patName + "】吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { bool existresult = op_bed.getexitresult(patID); if (existresult == false) { bool assignResult = op_bed.bedAssign(bedinfo, deptid); if (assignResult == true) { MessageBox.Show("分配床位成功", "提示"); this.queryTextBox1.Clear(); dataGridViewEx1.AutoGenerateColumns = false; dataGridViewEx1.DataSource = op_bed.getPatNotAssignBed(Convert.ToInt32(deptid)); mainDoc = 0; patName = null; this.Close(); } else { MessageBox.Show("床位分配失败,该床位已有病人存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("该病人已分配床位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { return; } } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// 病人床位确认分配 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConfirmAssign_Click(object sender, EventArgs e) { try { if (dataGridViewEx1.Rows.Count > 0 && dataGridViewEx2.Rows.Count > 0) { bedinfo.BED_NO = bedNO; bedinfo.PATLIST_ID = patID; bedinfo.BED_SEX = patSEX; bedinfo.DEPT_ID = Convert.ToInt32(currentDept.DeptID); } else { MessageBox.Show("病人或床位为空,床位分配操作即将退出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (bedinfo.ZY_DOC == 0) { MessageBox.Show("您还未选择主管医生", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.queryTextBox1.Focus(); return; } bool existresult = op_bed.getexitresult(patID); if (existresult == false) { bool assignResult = op_bed.bedAssign(bedinfo, _currentDept.DeptID); if (assignResult == true) { MessageBox.Show("分配床位成功", "提示", MessageBoxButtons.OK); this.queryTextBox1.Clear(); dataGridViewEx1.DataSource = op_bed.getPatNotAssignBed(Convert.ToInt32(currentDept.DeptID)); dataGridViewEx2.DataSource = op_bed.getBedNotAssign(Convert.ToInt32(currentDept.DeptID)); cmbnobed.DataSource = op_bed.getBedNotAssign(Convert.ToInt32(currentDept.DeptID));//3月22日新加的,分配床位后及时分配更改未分床的状态 bedinfo.ZZ_DOC = 0; bedinfo.ZY_DOC = 0; loadpatbed(); } else { MessageBox.Show("床位分配失败,该床位已有病人存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("该病人已分配床位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { throw new Exception(ex.Message); } finally { } }