Exemplo n.º 1
0
        /// <summary>
        /// 保存信息
        /// </summary>
        public void SavePreLeaveInfo()
        {
            if (p_objRrecord == null)
            {
                return;
            }

            DateTime newDate = this.m_objViewer.m_dtpNewDate.Value;

            if (newDate < Convert.ToDateTime(this.m_objViewer.m_ucPatientInfo.BihPatient_VO.InHospitalDate))
            {
                MessageBox.Show("出院日期不能早于入院日期!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.m_objViewer.m_dtpNewDate.Focus();
                return;
            }

            if (newDate > DateTime.Now)
            {
                MessageBox.Show("出院日期不能大于大于当前时间!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.m_objViewer.m_dtpNewDate.Focus();
                return;
            }

            if (this.m_objViewer.m_txtRemark.Text == null || this.m_objViewer.m_txtRemark.Text.Trim() == "")
            {
                MessageBox.Show("备注信息不能为空!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.m_objViewer.m_txtRemark.Focus();
                return;
            }

            bool hasCharge = false;

            m_objManage.IfHasCharge(this.m_objViewer.m_ucPatientInfo.BihPatient_VO.RegisterID,
                                    newDate.ToString(),
                                    p_objRrecord.m_strOUTHOSPITAL_DAT,
                                    out hasCharge);
            if (hasCharge)
            {
                if (MessageBox.Show("该日期段已产生费用,是否修改预出院日期?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                {
                    this.m_objViewer.m_dtpNewDate.Focus();
                    return;
                }
            }

            p_objRrecord.m_strOPERATORID_CHR = this.m_objViewer.LoginInfo.m_strEmpID;
            p_objRrecord.m_strDES_VCHR       = this.m_objViewer.m_txtRemark.Text.Trim();
            long lngRes = m_objManage.ModifyLeaveDate(newDate, p_objRrecord);

            if (lngRes > 0)
            {
                if (hasCharge)
                {
                    MessageBox.Show("出院日期成功修改为:" + newDate.ToShortDateString() + "; 请及时冲减病人费用!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("出院日期成功修改为:" + newDate.ToShortDateString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                SaveEditLog();

                ResetView();
            }
            else
            {
                MessageBox.Show("保存失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }