예제 #1
0
        /// <summary>
        /// 设置发票打印内容
        /// </summary>
        /// <param name="regInfo">挂号信息</param>
        /// <param name="invoice">发票主表信息</param>
        /// <param name="alInvoiceDetail">发票明细信息</param>
        /// <param name="alFeeItemList">费用明细信息</param>
        /// <param name="isPreview">是否预览模式</param>
        /// <returns></returns>
        public int SetPrintValue(Neusoft.HISFC.Models.Registration.Register regInfo,
                                 Neusoft.HISFC.Models.Fee.Outpatient.Balance invoice,
                                 ArrayList alInvoiceDetail,
                                 ArrayList alFeeItemList,
                                 bool isPreview)
        {
            //this.isPreView = false  ;
            try
            {
                this.regInfoOther = regInfo.Clone();
                invoiceOther      = invoice.Clone();
                this.Register     = regInfo;
                this.Controls.Clear();
                //如果费用明细为空,则返回
                if (alFeeItemList.Count <= 0)
                {
                    return(-1);
                }
                #region 克隆一个费用明细信息列表,因为后面操作需要对列表元素有删除操作.
                ArrayList alInvoiceDetailClone = new ArrayList();
                foreach (Neusoft.HISFC.Models.Fee.Outpatient.BalanceList det in alInvoiceDetail)
                {
                    alInvoiceDetailClone.Add(det.Clone());
                }
                #endregion
                if (this.InvoiceType == "MZ01")
                {
                    c = new ucMZFP();
                    while (c.Controls.Count > 0)
                    {
                        this.Controls.Add(c.Controls[0]);
                    }
                    this.Size = c.Size;
                    this.InitReceipt();
                    SetMZFPPrintValue(regInfo,
                                      invoice,
                                      alInvoiceDetailClone,
                                      alFeeItemList,
                                      isPreview);
                }

                //控制根据打印和预览显示选项
                if (isPreview)
                {
                    SetToPreviewMode();
                }
                else
                {
                    SetToPrintMode();
                }
            }
            catch (Exception ex)
            {
                return(-1);
            }
            return(0);
        }
예제 #2
0
        /// <summary>
        /// 保存划价信息
        /// </summary>
        private void SaveCharge()
        {
            DialogResult result;

            result = MessageBox.Show("是否确定要划价?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, System.Windows.Forms.MessageBoxDefaultButton.Button2);

            if (result == DialogResult.No)
            {
                return;
            }

            if (this.currentBalance != null)
            {
                if (hsInvoice.Contains(this.currentBalance))
                {
                    DialogResult r = MessageBox.Show("该发票费用信息已经划价保存过,是否重新划价?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                    if (r == DialogResult.Cancel)
                    {
                        return;
                    }
                }
            }
            else
            {
                return;
            }

            if (this.comFeeItemLists == null || this.comFeeItemLists.Count <= 0)
            {
                MessageBox.Show("费用明细为空!");

                return;
            }

            ArrayList tempFeeItemLists = new ArrayList();

            foreach (FeeItemList f in this.comFeeItemLists)
            {
                tempFeeItemLists.Add(f.Clone());
            }

            string clinicCode = ((FeeItemList)this.comFeeItemLists[0]).Patient.ID;

            Neusoft.HISFC.Models.Registration.Register temPatientInfo = registerIntegrate.GetByClinic(clinicCode);
            if (temPatientInfo == null)
            {
                MessageBox.Show("获得挂号信息失败!" + this.registerIntegrate.Err);

                return;
            }

            temPatientInfo.Pact = this.patientInfo.Pact;

            this.patientInfo = temPatientInfo.Clone();

            foreach (FeeItemList item in tempFeeItemLists)
            {
                item.FT.TotCost = item.FT.PayCost + item.FT.OwnCost + item.FT.PubCost;

                item.FT.PayCost           = 0m;
                item.FT.PubCost           = 0m;
                item.FT.OwnCost           = item.FT.TotCost;
                item.PayType              = Neusoft.HISFC.Models.Base.PayTypes.Charged;
                item.CancelType           = Neusoft.HISFC.Models.Base.CancelTypes.Valid;
                item.RecipeSequence       = "";
                item.RecipeNO             = "";
                item.SequenceNO           = -1;
                item.Invoice.ID           = "";
                item.InvoiceCombNO        = null;
                item.Order.ID             = "";
                item.ConfirmedQty         = 0;
                item.IsConfirmed          = false;
                item.PayType              = Neusoft.HISFC.Models.Base.PayTypes.Charged;
                item.NoBackQty            = item.Item.Qty;
                item.ConfirmedInjectCount = 0;
                item.ConfirmOper          = new Neusoft.HISFC.Models.Base.OperEnvironment();

                item.ChargeOper.ID = this.outpatientManager.Operator.ID;

                item.FeeOper.OperTime = System.DateTime.MinValue;
            }

            bool     iReturn = false;
            DateTime dtNow   = this.outpatientManager.GetDateTimeFromSysDateTime();
            string   errText = "";

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            this.feeIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            iReturn = this.feeIntegrate.SetChargeInfo(this.patientInfo, tempFeeItemLists, dtNow, ref errText);

            if (iReturn == false)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("划价出错" + errText);

                return;
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                MessageBox.Show("划价成功!");

                if (this.currentBalance != null)
                {
                    Balance invo = this.currentBalance;

                    hsInvoice.Add(invo, null);
                }
            }
        }