Ejemplo n.º 1
0
        private void txtMarkNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                accountCard = new AccountCard();
                int resultValue = accountManager.GetCardByRule(this.txtMarkNo.Text.Trim(), ref accountCard);
                if (resultValue < 0)
                {
                    MessageBox.Show(accountManager.Err);
                    this.txtMarkNo.Focus();
                    this.txtMarkNo.SelectAll();
                    this.cmbMarkType.Tag = string.Empty;
                    return;
                }

                if (resultValue == 1)
                {
                    MessageBox.Show("该卡已被使用,请换卡!");
                    this.txtMarkNo.Focus();
                    this.txtMarkNo.SelectAll();
                    this.cmbMarkType.Tag = string.Empty;
                    return;
                }
                this.txtMarkNo.Text  = accountCard.MarkNO;
                this.cmbMarkType.Tag = accountCard.MarkType.ID;
                if (MessageBox.Show("是否保存数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    this.Save();
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 清空数据
 /// </summary>
 private void ClearData()
 {
     this.ucRegPatientInfo1.Clear();
     this.txtMarkNo.Text   = string.Empty;
     this.cmbMarkType.Text = string.Empty;
     this.cmbMarkType.Tag  = string.Empty;
     this.ucRegPatientInfo1.Focus();
     accountCard = null;
     this.ckIsTreatment.Checked = false;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns></returns>
        public new AccountCard Clone()
        {
            AccountCard accountCard = base.Clone() as AccountCard;

            accountCard.MarkType = this.MarkType.Clone() as Neusoft.FrameWork.Models.NeuObject;
            foreach (AccountCardRecord cardRecord in this.AccountCardRecord)
            {
                accountCard.AccountCardRecord.Add(cardRecord);
            }
            return(accountCard);
        }
        private void txtMarkNO_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }
            string markNO = this.txtMarkNO.Text.Trim();

            this.Clear();
            if (string.IsNullOrEmpty(markNO))
            {
                MessageBox.Show("请输入就诊卡号!");
                this.txtMarkNO.Focus();
                return;
            }
            Neusoft.HISFC.Models.Account.AccountCard accountCard = new Neusoft.HISFC.Models.Account.AccountCard();
            if (feeIntegrate.ValidMarkNO(markNO, ref accountCard) <= 0)
            {
                MessageBox.Show(feeIntegrate.Err);
                this.txtMarkNO.Text = string.Empty;
                this.txtMarkNO.Focus();
                return;
            }

            Neusoft.HISFC.Models.Account.Account account = accountManager.GetAccountByCardNo(accountCard.Patient.PID.CardNO);
            if (account == null)
            {
                AccountEmpower accountEmpower = new AccountEmpower();
                if (accountManager.QueryAccountEmpowerByEmpwoerCardNO(accountCard.Patient.PID.CardNO, ref accountEmpower) < 0)
                {
                    MessageBox.Show("该患者不能存在账户或有效的授权信息!" + accountManager.Err);
                    this.Clear();
                    return;
                }
                else
                {
                    SetInfo(accountCard, accountEmpower);
                }
            }
            else
            {
                SetInfo(accountCard, account);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 查找门诊卡号
        /// </summary>
        /// <returns>true 成功 false失败</returns>
        private bool GetCardNO(ref string cardNO)
        {
            string markNo = this.txtMardNO.Text.Trim();

            HISFC.Models.Account.AccountCard accountCard = new Neusoft.HISFC.Models.Account.AccountCard();
            int resultValue = accountManager.GetCardByRule(markNo, ref accountCard);

            if (resultValue <= 0)
            {
                MessageBox.Show(accountManager.Err);
                return(false);
            }
            this.txtMardNO.Text  = accountCard.MarkNO;
            this.cmbCardType.Tag = accountCard.MarkType.ID;
            if (accountCard.Patient != null)
            {
                cardNO = accountCard.Patient.PID.CardNO;
            }
            return(true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 保存数据
        /// </summary>
        protected virtual void Save()
        {
            if (!this.Valid())
            {
                return;
            }

            #region 设置事物
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            this.accountManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            #endregion

            #region  保存患者信息
            int resultValue = 0;
            if (this.ucRegPatientInfo1.CardNO == string.Empty)
            {
                this.ucRegPatientInfo1.McardNO = txtMarkNo.Text;
                resultValue = this.ucRegPatientInfo1.Save();
                if (resultValue <= 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    return;
                }
            }
            #endregion

            #region 作废正在使用的就诊卡
            if (StopPatientCard() < 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return;
            }
            #endregion

            #region 发卡

            #region 获取卡实体
            accountCard = new Neusoft.HISFC.Models.Account.AccountCard();
            //accountCard.Patient.PID.CardNO = this.ucRegPatientInfo1.CardNO;
            accountCard.Patient  = this.ucRegPatientInfo1.GetPatientInfomation();
            accountCard.MarkNO   = this.txtMarkNo.Text.Trim();
            accountCard.MarkType = this.cmbMarkType.SelectedItem as FrameWork.Models.NeuObject;
            accountCard.IsValid  = true;
            #endregion
            //处理发卡操作
            string error = string.Empty;
            resultValue = this.BulidCard(accountCard);
            if (resultValue == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(error, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            #endregion

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            //打印标签
            PrintLable();
            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("保存数据成功!"), Neusoft.FrameWork.Management.Language.Msg("提示"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.ClearData();
        }