Exemplo n.º 1
0
        public void LeaveHospital()
        {
            if (!IsPassInputValidate())
            {
                return;
            }
            clsT_Opr_Bih_Leave_VO objPatientVO;

            ValueToVoForLeave(out objPatientVO);

            try
            {
                DateTime outDate;
                outDate = Convert.ToDateTime(this.m_objViewer.m_dtpOutDate.Text);
                System.TimeSpan diff1 = outDate.Subtract(DateTime.Now);
                if (diff1.Days < 0)
                {
                    MessageBox.Show("出院日期不能早于今天", "提示");
                    this.m_objViewer.m_dtpOutDate.Focus();
                    return;
                }

                long            lngReg    = -1;
                clsDclBihLeaHos domainObj = new clsDclBihLeaHos();
                lngReg = domainObj.LeaveHospital(objPatientVO);

                if (lngReg > 0)
                {
                    string msg = "操作成功!"
                                 + this.m_objViewer.m_lblPatientName.Text + "将于"
                                 + this.m_objViewer.m_dtpOutDate.Text
                                 + "出院。";
                    MessageBox.Show(msg, "出院", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    m_objViewer.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("出院失败!", "出院", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    m_objViewer.DialogResult = DialogResult.No;
                }
            }
            catch (Exception e)
            {
                m_objViewer.DialogResult = DialogResult.No;
                MessageBox.Show(m_objViewer, e.Message, "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (m_objViewer.DialogResult == DialogResult.OK && this.m_objViewer.m_ckbPrint.Checked)
            {
                // 打印出院通知单
                frmPrintLeaveNotice printLeaveNotice = new frmPrintLeaveNotice(this.m_objViewer.m_bedManageVO, objPatientVO);

                printLeaveNotice.ShowDialog();
            }
        }