/// <summary> /// 窗体加载 /// </summary> /// <param name="sender">触发事件的控件</param> /// <param name="e">事件所需参数</param> private void FrmPayMentInfo_Load(object sender, EventArgs e) { // 获取WorkID int workid = (InvokeController("this") as AbstractController).WorkId; // 支付控件数 int iPayControls = CostPayManager.InitUCPayModeControl(workid, flpPayCtrl, mCostPatTypeID, 1); if (iPayControls > 0) { //根据支付方式控件多少,自动设置界面高度 Height = groupPanel2.Location.Y + 120 + Math.Max(2, iPayControls) * 40 + 15; groupPanel2.Height = Math.Max(2, iPayControls) * 40 + 32 + 15; } //实列化委托,各项金额实时显示 SetFeeValueDelegate setFeeValue = new SetFeeValueDelegate(SetLabelText); //实列化对象,支付方式金额计算 PaymentAutoCalculate autoCalculate = new PaymentAutoCalculate(mCurPatListID, mCostPatTypeID, null, InvokeController); // 自动计算支付金额 CostPayManager.StartExecPay(mTotalFee, mDepositFee, autoCalculate, setFeeValue, false); if (CostHead.CostType == 3) { CostPayManager.ArrearageCost(); } }
/// <summary> /// 窗体Load事件 /// </summary> /// <param name="sender">sender</param> /// <param name="e">e</param> private void FrmPayMentInfo_Load(object sender, EventArgs e) { balanceSuccess = false; run = true; int workid = (InvokeController("this") as AbstractController).WorkId; int iPayControls = CostPayManager.InitUCPayModeControl(workid, flpPayCtrl, costpattypeid, 0); lblMediaInfo.Text = string.Empty; if (iPayControls > 0) { //根据支付方式控件多少,自动设置界面高度 Height = groupPanel2.Location.Y + 120 + Math.Max(2, iPayControls) * 40 + 15; groupPanel2.Height = Math.Max(2, iPayControls) * 40 + 32 + 15; } SetFeeValueDelegate setfeeValue = new SetFeeValueDelegate(SetLabelText); //实列化委托,各项金额实时显示 PaymentAutoCalculate autocal = new PaymentAutoCalculate(curpatlistid, costpattypeid, costfeeids, InvokeController); //实列化对象,支付方式金额计算 CostPayManager.StartExecPay(totalfee, 0, autocal, setfeeValue, false); if (IsMediaPat) { //医保病人不需要打费用清单 chkFeePrint.Checked = false; } else { chkFeePrint.Checked = true; } }
//窗体加载 private void FrmSettlementPanel_Load(object sender, EventArgs e) { SetFeeValueDelegate setfeeValue = new SetFeeValueDelegate(SetLabelText); int iPayControls = CostPayManager.InitUCPayModeControl(1, flpPayCtrl, 106, 0); if (iPayControls > 0) { Height = groupPanel2.Location.Y + 120 + Math.Max(2, iPayControls) * 48 + 15; groupPanel2.Height = Math.Max(2, iPayControls) * 48 + 32 + 15; } CostPayManager.StartExecPay(150, 0, null, setfeeValue, true); }
/// <summary> /// 第二步:创建控件后开始计算支付金额 /// </summary> /// <param name="totalFee">总金额</param> /// <param name="zyDepositFee">预交金总额</param> /// <param name="_paymentCalculate">支付方式计算</param> /// <param name="_setFeeValue">显示支付金额</param> /// <param name="_defaultCash">现金项默认</param> public static void StartExecPay(decimal totalFee, decimal zyDepositFee, AsynPaymentCalculate _paymentCalculate, SetFeeValueDelegate _setFeeValue, bool _defaultCash) { CostFee.InitFee(totalFee, zyDepositFee, m_UCPayModes); UCPayMode2 change_uPayMode = m_UCPayModes.Find(x => x._config.PayMethodID == -1); change_uPayMode.PayValue = CostFee.ChangeFee;//显示找零金额 paymentCalculate = _paymentCalculate; setFeeValue = _setFeeValue; if (setFeeValue != null) { //给界面显示金额 setFeeValue(CostFee); } defaultCash = _defaultCash; if (m_PayConfigs != null) { m_PayThreads = null;//清空线程 //SetCashValue(CostFee.ChangeFee); for (int i = 0; i < m_PayConfigs.Count; i++) { PayMethod_Config m_PayConfig = m_PayConfigs[i]; //m_PayConfig.ProcStep = PAY_PROCSTEP.ppsHandFinsed;//开始 PAY_THREAD paythread = new PAY_THREAD(); //paythread.iPatType = m_PayConfig.PatientType; //paythread.iPatLstID = patListID; //paythread.FeeIDs = feeIDs; //paythread.PayType = iPatType; //paythread.SoCityNum = ""; paythread.PayMethodID = m_PayConfig.PayMethodID; paythread.InputFrom = m_PayConfig.InputFrom; //paythread.ProcStep = m_PayConfig.ProcStep; paythread.Handle = m_PayConfig.Handle; paythread.paymentCalculate = paymentCalculate; //启动后台线程开始支付 bool bSucceed = false; bSucceed = StartPay(ref paythread, m_PayConfig); if (bSucceed == false) { //执行支付失败 //m_PayConfig.ProcStep = PAY_PROCSTEP.ppsHandFinsed; } } } }
//窗体加载 private void FrmSettlementPanel_Load(object sender, EventArgs e) { int iPayControls = CostPayManager.InitUCPayModeControl(1, flpPayCtrl, 106, 0); if (iPayControls > 0) { //根据支付方式控件多少,自动设置界面高度 Height = groupPanel2.Location.Y + 120 + Math.Max(2, iPayControls) * 40 + 15; groupPanel2.Height = Math.Max(2, iPayControls) * 40 + 32 + 15; } SetFeeValueDelegate setfeeValue = new SetFeeValueDelegate(SetLabelText); //实列化委托,各项金额实时显示 PaymentAutoCalculate autocal = new PaymentAutoCalculate(35, 106, new int[] { 1, 2, 3 }, InvokeController); //实列化对象,支付方式金额计算 CostPayManager.StartExecPay(Convert.ToDecimal(152.14), 0, autocal, setfeeValue, false); }