Exemplo n.º 1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        protected override long m_lngSubAddNew()
        {
            if (m_objBaseCurrentPatient == null)
            {
                clsPublicFunction.ShowInformationMessageBox("病人为空,请选择病人!");
                return(0);
            }
            if (this.m_txtChargeDoc.Text.Trim() == "" || this.m_txtChargeDoc.Tag == null)
            {
                clsPublicFunction.ShowInformationMessageBox("主治医生为空,或者不是本科室员工!");
                this.m_txtChargeDoc.Focus();
                return(0);
            }

            if (this.m_txtManageDoc.Text.Trim() == "" || this.m_txtManageDoc.Tag == null)
            {
                clsPublicFunction.ShowInformationMessageBox("管床医生为空,或者不是本科室医生!");
                this.m_txtManageDoc.Focus();
                return(0);
            }
            //获取服务器时间
            clsPublicDomain m_objPDomain = new clsPublicDomain();

            clsBedCardValue objBedCardValue = new clsBedCardValue();

            objBedCardValue.m_strInPatientID   = m_objBaseCurrentPatient.m_StrInPatientID;
            objBedCardValue.m_strInPatientDate = m_objBaseCurrentPatient.m_DtmLastInDate.ToString("yyyy-MM-dd HH:mm:ss");
            objBedCardValue.m_strOpenDate      = m_objPDomain.m_strGetServerTime();
            if (this.m_txtChargeDoc.Tag != null)
            {
                objBedCardValue.m_strDoc_InCharge = ((clsEmrEmployeeBase_VO)(this.m_txtChargeDoc.Tag)).m_strEMPID_CHR;
            }
            else
            {
                objBedCardValue.m_strDoc_InCharge = string.Empty;
            }
            if (this.m_txtManageDoc.Tag != null)
            {
                objBedCardValue.m_strDoc_ManageBed = ((clsEmrEmployeeBase_VO)(this.m_txtManageDoc.Tag)).m_strEMPID_CHR;
            }
            else
            {
                objBedCardValue.m_strDoc_ManageBed = string.Empty;
            }
            objBedCardValue.m_intState = this.m_cboStatus.SelectedIndex;
            long lngRes = 0;

            try
            {
                lngRes = m_objBedCardDomain.m_lngSaveBedCardValue(objBedCardValue);
                if (lngRes > 0)
                {
                    clsPublicFunction.ShowInformationMessageBox("保存成功!");
                }
            }
            catch (Exception e)
            {
//				clsPublicFunction.ShowInformationMessageBox("保存失败!");
            }
            finally
            {
                if (lngRes <= 0)
                {
                    clsPublicFunction.ShowInformationMessageBox("保存失败!");
                }
            }
            return(lngRes);
        }
Exemplo n.º 2
0
        protected long m_lngAddNewRecord()
        {
            //检查当前病人变量是否为null
            if (m_objCurrentPatient == null)
            {
                return((long)enmOperationResult.Parameter_Error);
            }

            if (m_ObjCurrentEmrPatientSession == null)
            {
    #if !Debug
                clsPublicFunction.ShowInformationMessageBox("请选择病人入院日期。");
    #endif
                return(-7);
            }

            //获取服务器时间
            clsPublicDomain m_objPDomain = new clsPublicDomain();

            //从界面获取记录信息
            clsAYQBabyAssessmentContent objContent = m_objGetContentFromGUI();

            string strDiseaseID = new clsTemplateDomain().m_strGetAssociateIDBySetID(m_strGetTemplateSetID(), (int)enmAssociate.Disease);

            //界面输入值出错
            if (objContent == null)
            {
                return((long)enmOperationResult.Parameter_Error);
            }

            //设置 clsInPatientCaseHistoryContent 的信息(使用服务器时间设置m_dtmOpenDate和m_dtmModifyDate)
            objContent.m_bytIfConfirm     = 0;
            objContent.m_bytStatus        = 0;
            objContent.m_dtmInPatientDate = m_objCurrentPatient.m_DtmSelectedInDate;
            objContent.m_dtmModifyDate    = DateTime.Parse(m_objPDomain.m_strGetServerTime());
            objContent.m_dtmOpenDate      = DateTime.Parse(m_objPDomain.m_strGetServerTime());
            //objContent.m_strCreateUserID =MDIParent.strOperatorID;
            objContent.m_strInPatientID  = m_objCurrentPatient.m_StrInPatientID;
            objContent.m_strModifyUserID = objContent.m_strModifyUserID;
            objContent.m_dtmCreateDate   = DateTime.Parse(this.m_dtpCreateDate.Text);

            //保存记录
            clsPreModifyInfo p_objModifyInfo = null;

            long lngRes = m_objDomain.m_lngAddNewRecord(objContent, objPicValueArr, strDiseaseID, out p_objModifyInfo);

            //根据结果做不同的处理
            switch ((enmOperationResult)lngRes)
            {
            case enmOperationResult.DB_Succeed:
                m_objCurrentRecordContent = objContent;
                m_dtmCreatedDate          = objContent.m_dtmOpenDate;
                m_mthHandleAddRecordSucceed();
                this.m_dtpCreateDate.Enabled = false;
                break;

            case enmOperationResult.Record_Already_Exist:
                m_mthShowRecordTimeDouble();
                return(lngRes);
            }
            //返回结果
            return(lngRes);
        }