private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money) { try { CardAuthorizationData eCardAuthorizationData = new CardAuthorizationData(); CardAuthorizationFacade eCardAuthorizationFacade = new CardAuthorizationFacade(); eCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(SkyComm.cardInfoStruct.CardNo); string identity = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_IDENTITYCARD].ToString(); CardSavingFacade cardSavingFacade = new CardSavingFacade(); DataSet cardSavingData = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID); cardSavingData.Tables[0].Columns.Add("身份证", typeof(string)); if (cardSavingData.Tables[0].Rows.Count > 0) { cardSavingData.Tables[0].Rows[0]["身份证"] = identity; cardSavingData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml"); if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx")) { SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印."); return; } PrintManager print = new PrintManager(); print.InitReport(ReportName); print.AddParam("医院名称", SysOperatorInfo.CustomerName); print.AddParam("收据号", strTRANSACTION_ID); print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString()); print.AddParam("卡余额", SkyComm.cardBlance); print.AddParam("充值金额", Money); print.AddParam("操作员", SysOperatorInfo.OperatorCode); print.AddParam("操作员姓名", SysOperatorInfo.OperatorName); print.AddData(cardSavingData.Tables[0], "report"); PrintManager.CanDesign = true; print.Print(); print.Dispose(); Thread.Sleep(100); } } catch (Exception lex) { // if (lex.Message.IndexOf("灾难性") > 0) // { // SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!"); // } // else // { // SkynetMessage.MsgInfo(lex.Message); // } } }
private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money) { try { CardSavingFacade cardSavingFacade = new CardSavingFacade(); DataSet cardSavingData = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID); if (cardSavingData.Tables[0].Rows.Count > 0) { cardSavingData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml"); if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx")) { SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印."); return; } //Common_XH theCamera_XH = new Common_XH(); //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁); PrintManager print = new PrintManager(); print.InitReport(ReportName); print.AddParam("医院名称", SysOperatorInfo.CustomerName); print.AddParam("收据号", strTRANSACTION_ID); print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString()); print.AddParam("卡余额", SkyComm.cardBlance); print.AddParam("充值金额", Money); print.AddParam("操作员", SysOperatorInfo.OperatorCode); print.AddParam("操作员姓名", SysOperatorInfo.OperatorName); print.AddData(cardSavingData.Tables[0], "report"); PrintManager.CanDesign = true; print.Print(); print.Dispose(); Thread.Sleep(100); } } catch (Exception lex) { if (lex.Message.IndexOf("灾难性") > 0) { SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!"); } else { SkynetMessage.MsgInfo(lex.Message); } } }
private void FrmStoredInquire_Load(object sender, EventArgs e) { ucTime1.Sec = 60; ucTime1.timer1.Start(); eHistoryListCardAuthorizationData = new CardSavingData(); eCardSavingFacade = new CardSavingFacade(); this.eHistoryListCardAuthorizationData = (CardSavingData)eCardSavingFacade.FindCardMoneyByCardID(SkyComm.cardInfoStruct.CardNo); if (eHistoryListCardAuthorizationData.Tables["T_CARD_SAVING"].Rows.Count > 0) { this.gdcMain.DataSource = this.eHistoryListCardAuthorizationData.Tables["T_CARD_SAVING"]; } else { this.gdcMain.DataSource = null; } }
private void QueryData() { _mSquareAccountsPresenter.GetBeginTime(); label2.Text = "起始时间:" + SquareAccountsPresenter.MBeginTime; label4.Text = "终止时间:" + SquareAccountsPresenter.MEndTime; DataSet dataPre = _mSquareAccountsPresenter.GetPreData(SysOperatorInfo.OperatorID, Convert.ToDateTime(SquareAccountsPresenter.MBeginTime), Convert.ToDateTime(SquareAccountsPresenter.MEndTime), 1, true); //gridControl1.DataSource = dataPre.Tables[0]; int mAmount = _mSquareAccountsPresenter.getTotalBankCardTransactions(SysOperatorInfo.OperatorID, Convert.ToDateTime(SquareAccountsPresenter.MBeginTime), Convert.ToDateTime(SquareAccountsPresenter.MEndTime)); label7.Text = mAmount.ToString(); backgroundWorker1.RunWorkerAsync(); AutoInMoneyRecordFacade theAutoInMoneyRecordFacade = new AutoInMoneyRecordFacade(); DataSet dsInmoney = theAutoInMoneyRecordFacade.GetInMoneyInfoByOperatorID(AutoHostConfig.Machineno, SysOperatorInfo.OperatorID, DateTime.Today); lblInMoney.Text = dsInmoney.Tables[0].Compute("SUM(INMONEY)", "").ToString(); gdcInmoney.DataSource = dsInmoney.Tables[0]; CardSavingFacade theCardSavingFacade = new CardSavingFacade(); DataSet dsCardSaving = theCardSavingFacade.GetAddMoneyRecord(DateTime.Today, SysOperatorInfo.OperatorID, "现金"); //foreach (DataRow row in dsInmoney.Tables[0].Rows) //{ // int intlenght = row["CARDNO"].ToString().Length; // if (intlenght > 10) // { // row["CARDNO1"] = row["CARDNO"].ToString().Substring(0, 6) + "*".PadLeft(intlenght - 10) + row["CARDNO"].ToString().Substring(intlenght - 4, 4); // } //} //gdcAddMoney.DataSource = dsCardSaving.Tables[0]; lblCardSaving.Text = dsCardSaving.Tables[0].Compute("SUM(ADDMONEY)", "").ToString(); }
public void svaeCard(string type, decimal money, string payMethod, string hisSerialNo) { CardSavingFacade mCardSavingFacade = new CardSavingFacade(); if (SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { throw new Exception("没有找到要充值的卡信息,请拿微信交易单号去窗口办理充值!"); } CardAuthorizationData mCardAuthorizationData = new CardAuthorizationData(); CardAuthorizationFacade mCardAuthorizationFacade = new CardAuthorizationFacade(); mCardAuthorizationData = (CardAuthorizationData)mCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(SkyComm.cardInfoStruct.CardNo); mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之前"); ////Add money if (type.Equals("办卡")) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money; //此处需调接口 } //业务类型 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = payMethod; //单位 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //银行流水号--T_CARD_SAVING.BANKTRANSNO统一保存T_BANKHISEXCHANGE_TRANS的主键HISSEQNO mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKTRANSNO] = hisSerialNo; //充值数据来源 mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = "自助机"; mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(mCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { throw new Exception("该时间段已经结帐,不能办理预交金业务,请拿微信交易单号去窗口办理充值!"); } DataSet cardSavingData = new DataSet(); cardSavingData = mCardSavingFacade.insertEntity(mCardAuthorizationData); if (cardSavingData == null || cardSavingData.Tables[0].Rows.Count == 0) { throw new Exception("卡充值失败,请拿微信交易单号去窗口办理充值!"); } PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), money.ToString()); }
private void lblCashStored_Click(object sender, EventArgs e) { btnEnd.Enabled = false; WaitDialogForm form = new WaitDialogForm("正在存钞中,请稍候...", "正在组织数据,请稍候......", new Size(240, 60)); try { MoneyServer.NotAllowCashin(); //拍照,纸币器 switch (AutoHostConfig.ReadCardType) { case "XUHUI": AutoServiceSDK.SdkService.Common_XH camera = new AutoServiceSDK.SdkService.Common_XH(); camera.TakeCameraEnd(); camera.DoorLightClose(LightTypeenum.纸币器); break; default: break; } timer2.Stop(); timer1.Stop(); #region 休眠3秒以后重新获取纸币金额 Thread.Sleep(5000); Skynet.LoggingService.LogService.GlobalInfoMessage("在结束预存之后休眠2秒重新获取存钞明细"); int InMoney = MoneyServer.GetInMoney(AutoHostConfig.Machineno, SysOperatorInfo.OperatorID); Skynet.LoggingService.LogService.GlobalInfoMessage("在结束预存之后重新获取存钞明细金额:" + InMoney); if (InMoney > 0) { //投入数量 int intOld = Convert.ToInt32(lblAmount.Text) + 1; lblAmount.Text = intOld.ToString(); //投入金额 RechargeMoney += Convert.ToDecimal(InMoney); RechargeMoney = DecimalRound.Round(RechargeMoney, 2); lblMoney.Text = RechargeMoney.ToString(); } #endregion if (RechargeMoney == 0) { btnClose_Click(null, null); return; } lblNoPaymentCharge.Enabled = true; ucTime1.timer1.Stop(); if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所要充值的卡信息!"); frm.ShowDialog(); return; } eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; ////Add money Skynet.LoggingService.LogService.GlobalInfoMessage("现金发卡保存数据设置押金之前"); if (CallType == 2) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney; } Skynet.LoggingService.LogService.GlobalInfoMessage("现金发卡保存数据设置押金之后"); //业务类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = SkyComm.AddMoneyCashMode; //单位 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //充值数据来源 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = AutoHostConfig.BankName; eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { SkyComm.ShowMessageInfo("该时间段已经结帐,不能办理预交金业务,请重试!"); return; } DataSet cardSavingData = eCardSavingFacade.insertEntity(eCardAuthorizationData); SkyComm.GetCardBalance(); Skynet.LoggingService.LogService.GlobalInfoMessage("充值成功,调用类型:" + CallType); Savingsucceed = 1; if (CallType != 2) { //打印充值凭证 PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), RechargeMoney.ToString()); } } catch (Exception ex) { SkyComm.ShowMessageInfo("存钞失败:" + ex.Message); Skynet.LoggingService.LogService.GlobalInfoMessage("存钞失败:" + ex.Message); } finally { MoneyServer.ClosePort(); form.Close(); form.Dispose(); btnEnd.Enabled = true; } Skynet.LoggingService.LogService.GlobalInfoMessage("充值成功,调用类型:" + CallType); if (CallType == 0) { FrmRechargeSuccessful frmRecharge = new FrmRechargeSuccessful(); frmRecharge.RechargeMoney = RechargeMoney; frmRecharge.ShowDialog(this); frmRecharge.Dispose(); SkyComm.CloseWin(this); } else if (CallType == 2) { SkyComm.CloseWin(this); } else { SkyComm.ShowMessageInfo("您成功充值" + RechargeMoney + "元!卡中余额" + SkyComm.cardBlance.ToString() + ""); SkyComm.CloseWin(this); } //GetMoeny(); }
/// <summary> /// 获取卡余额 /// </summary> private void GetMoeny() { //获取诊疗号 string diagnoseId = SkyComm.DiagnoseID; //预交金 if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } string yje = string.Empty; if (SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString() != "2") { yje = eCardSavingFacade.FindBalanceMoneyByDiagnoseID(diagnoseId).ToString("0.00"); } else { yje = eCardSavingFacade.FindBalanceMoneyByDiagnoseID_New(diagnoseId, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["ACCOUNT_ID"].ToString()).ToString("0.00"); } //门诊未结 //string wj = eCardAuthorizationFacade.FindClinicNoCheckoutMoney(diagnoseId).ToString("0.00"); //门诊未缴费 #region 查询未缴费的金额 QuerySolutionFacade query = new QuerySolutionFacade(); Hashtable ht = new Hashtable(); string wj = "0.00"; string strsql = " SELECT COALESCE(SUM(TOTALMONEY),0) TOTALMONEY FROM (" + " select SUM(C.TOTALMONEY) TOTALMONEY" + " from CLINICPHYSICIANRECIPE C" + " where C.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 and OPERATETIME >= :YPDATE " + " AND C.RECIPETYPE IN ('药品费','中草药','医材')" + " union all " + " SELECT SUM(D_SUMMARY_INFO.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT * S_MEDORD_DETAIL.AMOUNT) AS TOTALMONEY" + " FROM CLINICPHYSICIANRECIPE,D_SUMMARY_INFO,S_MEDORD_DETAIL,S_MEDORD_MAIN " + " WHERE CLINICPHYSICIANRECIPE.RECIPECONTENT = S_MEDORD_DETAIL.MEDORDID AND S_MEDORD_DETAIL.ITEMID = D_SUMMARY_INFO.ITEMID AND" + " CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 AND" + " CLINICPHYSICIANRECIPE.RECIPETYPE <> '附加' AND CLINICPHYSICIANRECIPE.RECIPECONTENT = S_MEDORD_MAIN.MEDORDID " + " AND OPERATETIME >=:JZFDATE AND (ISCHANGEPRICE<> 1 OR ISCHANGEPRICE IS NULL)" + " union all " + " SELECT SUM(CLINICPHYSICIANRECIPE.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT) AS TOTALMONEY" + " FROM CLINICPHYSICIANRECIPE " + " WHERE CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 AND" + " CLINICPHYSICIANRECIPE.RECIPETYPE <> '附加' " + " AND OPERATETIME >=:JZFDATE AND ISCHANGEPRICE = 1" + " union all " + " select SUM(CLINICPHYSICIANRECIPE.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT) TOTALMONEY" + " from CLINICPHYSICIANRECIPE " + " where RECIPESTATE = 0 AND CLINICPHYSICIANRECIPE.RECIPETYPE = '附加' " + " AND CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID and OPERATETIME >=:JZFDATE ) AA "; string ypDate = SystemInfo.SystemConfigs["药品处方有效期"].DefaultValue; string jzfDate = SystemInfo.SystemConfigs["检治费处方有效期"].DefaultValue; CommonFacade commonFacade = new CommonFacade(); DateTime dtCurrent = commonFacade.GetServerDateTime(); ht.Add(":DIAGNOSEID", diagnoseId); ht.Add(":YPDATE", dtCurrent.Date.AddDays(Convert.ToInt32(ypDate) * -1)); ht.Add(":JZFDATE", dtCurrent.Date.AddDays(Convert.ToInt32(jzfDate) * -1)); try { lblNoPaymentCharge.Visible = false; decimal decNoCharge = 0; DataSet ds = query.ExeQuery(strsql, ht); if (ds.Tables[0].Rows.Count > 0) { decNoCharge = DecimalRound.Round(Convert.ToDecimal(ds.Tables[0].Rows[0]["TOTALMONEY"]), 2); } wj = decNoCharge.ToString(); lblwjf.Text = decNoCharge.ToString(); if (decNoCharge != 0) { lblNoPaymentCharge.Visible = true; } else { lblNoPaymentCharge.Visible = false; } } catch (Exception ex) { SkynetMessage.MsgInfo("获取未交费信息出错:" + ex.Message); } #endregion lblwjf.Text = wj + "元"; //余额 lblye.Text = SkyComm.cardBlance.ToString(); }
private void lblOK_Click(object sender, EventArgs e) { if (!checkInput()) { return; } if (SendCard.CheckCard() == "1") { SkyComm.ShowMessageInfo("该自助机没有卡,请在其他自助机上继续发卡!"); return; } this.lblOK.Enabled = false; this.btnReturn.Enabled = false; this.btnExit.Enabled = false; panel2.Enabled = false; _telphone = this.txtTel.Text.Trim(); _childName = this.txtName.Text.Trim(); _childSex = this.rbtnBoy.Checked ? "男" : "女"; _childBirthDay = this.txtYear.Text.Trim() + "-" + this.txtMonth.Text.Trim() + "-" + this.txtDay.Text.Trim(); string CardNo = string.Empty; string strDiagnoseid = string.Empty; CardAuthorizationFacade eCardAuthorizationFacade = new CardAuthorizationFacade(); using (WaitDialogForm form = new WaitDialogForm("正在发卡中,请稍候...", "正在组织发卡数据,请稍候......", new Size(240, 60))) { #region 办理就诊卡 if (eLCardAuthorizationData != null) { eLCardAuthorizationData.Tables[0].Rows.Clear(); } SetCardInfo(IdInfo, _telphone); eLCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.insertEntity(eLCardAuthorizationData); strDiagnoseid = eLCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_DIAGNOSEID].ToString(); CardNo = eLCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID].ToString(); //写卡,如果失败则重试 bool isSuccess = false; form.Caption = "正在写卡中,请稍候..."; try { for (int i = 0; i < 3; i++) { //第一次写卡 if (SendCard.WriteCard(CardNo) == false) { //第一次写卡失败,再进行第二次写卡 if (SendCard.WriteCard(CardNo) == false) { //第二次写卡失败以后将卡回收 SendCard.ReturnCard(); } else { isSuccess = true; break; } } else { isSuccess = true; break; } } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("发卡失败:" + ex.Message); SkyComm.ShowMessageInfo("发卡失败:" + ex.Message); isSuccess = false; this.btnReturn.Enabled = true; this.btnExit.Enabled = true; this.lblOK.Enabled = true; panel2.Enabled = true; } //写卡失败 if (isSuccess == false) { //撤消已发卡的信息 eCardAuthorizationFacade.deleteEntityAndCardSaving(eLCardAuthorizationData); eLCardAuthorizationData = new CardAuthorizationData(); strDiagnoseid = string.Empty; SkynetMessage.MsgInfo("写卡失败,请在其他自助机上重试!"); this.lblOK.Enabled = true; this.btnReturn.Enabled = true; this.btnExit.Enabled = true; panel2.Enabled = true; //第二次写卡失败以后将卡回收 SendCard.ReturnCard(); return; } #endregion form.Close(); } #region 充值 try { SkyComm.eCardAuthorizationData = eLCardAuthorizationData; SkyComm.DiagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); SkyComm.cardInfoStruct.CardNo = CardNo; SkyComm.cardBlance = 0; CardSavingFacade cf = new CardSavingFacade(); SkyComm.cardallmoney = 0; int Savingsucceed = 0; decimal RechargeMoney = 0; string strModeType = "现金"; try { //充值,弹出界面选择是现金充值还是银行卡预存 if (!string.IsNullOrEmpty(AutoHostConfig.PosInterfaceType)) { FrmCardSavingMain frm = new FrmCardSavingMain(); frm.CallType = 2; frm.ShowDialog(); Savingsucceed = frm.Savingsucceed; RechargeMoney = frm.RechargeMoney; strModeType = frm.MODETYPE; frm.Dispose(); } else { //拍照 switch (AutoHostConfig.ReadCardType) { case "XUHUI": AutoServiceSDK.SdkService.Common_XH camera = new AutoServiceSDK.SdkService.Common_XH(); camera.TakeCamera(SkyComm.cardInfoStruct.CardNo, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString(), AutoHostConfig.Machineno); break; default: break; } FrmCardSavingCash frm = new FrmCardSavingCash(); frm.CallType = 2; frm.ShowDialog(); Savingsucceed = frm.Savingsucceed; RechargeMoney = frm.RechargeMoney; frm.Dispose(); } if (Savingsucceed == 1) { eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = strModeType; if (!eLCardAuthorizationData.Tables[0].Columns.Contains("OPERATORNAME")) { eLCardAuthorizationData.Tables[0].Columns.Add("OPERATORNAME"); eLCardAuthorizationData.Tables[0].Rows[0]["OPERATORNAME"] = SysOperatorInfo.OperatorName; } eCardAuthorizationFacade.updateEntity(eLCardAuthorizationData); eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney; //打印发卡凭证 PrintSendCardReport(eLCardAuthorizationData); } } catch (Exception ex2) { Skynet.LoggingService.LogService.GlobalInfoMessage("发卡充值失败:" + ex2.Message); } finally { } if (Savingsucceed == 1) { SendCard.OutputCard(); try { Common_XH theCamera_XH = new Common_XH(); theCamera_XH.DoorLightOpen(LightTypeenum.出卡槽, LightOpenTypeenum.闪烁); theCamera_XH.DoorLightOpen(LightTypeenum.发卡器, LightOpenTypeenum.闪烁); theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁); } catch (Exception exception) { } SkyComm.ShowMessageInfo("发卡成功,请取走您的就诊卡!"); } else { //回收卡信息并且注册卡 //撤消已发卡的信息 Skynet.LoggingService.LogService.GlobalInfoMessage("充值失败,撤消发卡信息"); eCardAuthorizationFacade.deleteEntityAndCardSaving(eLCardAuthorizationData); eLCardAuthorizationData = new CardAuthorizationData(); strDiagnoseid = string.Empty; this.lblOK.Enabled = true; this.btnReturn.Enabled = true; this.btnExit.Enabled = true; panel2.Enabled = true; //发卡失败以后将卡进行回收 SendCard.ReturnCard(); return; } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("发卡失败:" + ex.Message + ",系统回收卡机中的卡"); //发卡失败以后将卡进行回收 SendCard.ReturnCard(); SkynetMessage.MsgInfo("发卡失败:" + ex.Message); return; } finally { this.lblOK.Enabled = true; this.btnReturn.Enabled = true; this.btnExit.Enabled = true; panel2.Enabled = true; SkyComm.cardInfoStruct = new CardInformationStruct(); SkyComm.eCardAuthorizationData.Tables[0].Clear(); SkyComm.DiagnoseID = string.Empty; SkyComm.cardBlance = 0; SkyComm.cardallmoney = 0; } #endregion SystemFramework.Voice.Voice voice = new SystemFramework.Voice.Voice(); voice.PlayText("请在就诊卡出口取走您的就诊卡!"); voice.EndJtts(); DialogResult = System.Windows.Forms.DialogResult.OK; }
/// <summary> /// 银行卡交易统计 /// </summary> /// <param name="operatorID"></param> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <returns></returns> public DataSet getTotalBankCardTransactions(string operatorID, DateTime startTime, DateTime endTime) { CardSavingFacade cardSavingFacade = new CardSavingFacade(); return(cardSavingFacade.getTotalBankCardTransactions(operatorID, startTime, endTime)); }
/// <summary> /// 发卡工本费 /// </summary> /// <param name="operatorID"></param> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <returns></returns> public DataSet mGetCardMakeMoney(string operatorID, DateTime startTime, DateTime endTime) { CardSavingFacade cardSavingFacade = new CardSavingFacade(); return(cardSavingFacade.GetCardMakeMoney(operatorID, startTime, endTime)); }
private void lblOK_Click(object sender, EventArgs e) { ucTime1.Sec = 60; ucTime1.timer1.Stop(); if (SendCard.CheckCard() == "1") { SkyComm.ShowMessageInfo("该自助机没有卡,请在其他自助机上进行补卡操作!"); ucTime1.timer1.Start(); return; } this.lblOK.Enabled = false; //this.btnReturn.Enabled = false; this.btnExit.Enabled = false; //DataSet dsNewInfo = new DataSet(); int checkCount = 0; DataRow drCard = ((DataView)this.gdvMain.DataSource).ToTable().NewRow(); for (int i = 0; i < this.gdvMain.RowCount; i++) { if (Convert.ToBoolean(gdvMain.GetDataRow(i)["PITCHON1"].ToString())) { drCard = gdvMain.GetDataRow(i); checkCount++; } } if (checkCount == 0) { SkyComm.ShowMessageInfo("请选择一条卡信息进行补卡操作!"); ucTime1.timer1.Start(); eLCardAuthorizationData = new CardAuthorizationData(); this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; return; } else if (checkCount > 1) { SkyComm.ShowMessageInfo("只能选择一条卡信息进行补卡操作!"); ucTime1.timer1.Start(); eLCardAuthorizationData = new CardAuthorizationData(); this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; return; } if (SkyComm.eCardAuthorizationData != null && SkyComm.eCardAuthorizationData.Tables.Count != 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows.Count != 0) { if (drCard["CARDID"].ToString() == SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString()) { SkyComm.ShowMessageInfo("不能对当前正在使用的就诊卡进行补卡操作!"); ucTime1.timer1.Start(); eLCardAuthorizationData = new CardAuthorizationData(); this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; return; } } FrmYesNoAlert frmAlert = new FrmYesNoAlert(); frmAlert.Title = "提示"; frmAlert.Msg = "是否确认对选择的卡信息进行补卡操作? 【卡号:" + drCard["CARDID"].ToString() + "】【姓名:" + drCard["PATIENTNAME"].ToString() + "】"; if (frmAlert.ShowDialog() == DialogResult.Cancel) { this.ucTime1.timer1.Start(); eLCardAuthorizationData = new CardAuthorizationData(); this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; return; } CardAuthorizationFacade eCardAuthorizationFacade = new CardAuthorizationFacade(); using (WaitDialogForm form = new WaitDialogForm("正在发卡中,请稍候...", "正在组织发卡数据,请稍候......", new Size(240, 60))) { #region 补卡 eLCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.CancleAndReissueCard(drCard["ACCOUNT_ID"].ToString(), drCard["CARDID"].ToString(), SysOperatorInfo.OperatorID, drCard["CIRCUIT_STATE"].ToString()); //写卡,如果失败则重试 bool isSuccess = false; form.Caption = "正在写卡中,请稍候..."; try { for (int i = 0; i < 3; i++) { //第一次写卡 if (SendCard.WriteCard(eLCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString()) == false) { //第一次写卡失败,再进行第二次写卡 if (SendCard.WriteCard(eLCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString()) == false) { //第二次写卡失败以后将卡回收 SendCard.ReturnCard(); } else { isSuccess = true; break; } } else { isSuccess = true; break; } } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("发卡失败:" + ex.Message); SkyComm.ShowMessageInfo("发卡失败:" + ex.Message); isSuccess = false; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; this.lblOK.Enabled = true; } //写卡失败 if (isSuccess == false) { //撤消已注销挂失并补卡的信息 //eCardAuthorizationFacade.deleteEntityAndCardSaving(eLCardAuthorizationData); eCardAuthorizationFacade.TranBackBussiness(drCard["ACCOUNT_ID"].ToString(), eLCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString(), drCard["CARDID"].ToString(), drCard["CIRCUIT_STATE"].ToString(), eLCardAuthorizationData); SkynetMessage.MsgInfo("写卡失败,请在其他自助机上重试!"); this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; this.ucTime1.timer1.Start(); //第二次写卡失败以后将卡回收 SendCard.ReturnCard(); return; } #endregion form.Close(); } #region 充值 try { SkyComm.eCardAuthorizationData = eLCardAuthorizationData;//暂注释 SkyComm.DiagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); SkyComm.cardInfoStruct.CardNo = eLCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString(); SkyComm.cardBlance = 0; CardSavingFacade cf = new CardSavingFacade(); SkyComm.cardallmoney = 0; int Savingsucceed = 0; decimal RechargeMoney = 0; string strModeType = "现金"; string projectType = SkyComm.getvalue("项目版本标识"); if (!string.IsNullOrEmpty(projectType) && projectType == "锡林郭勒盟医院") { //eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = strModeType; if (!eLCardAuthorizationData.Tables[0].Columns.Contains("OPERATORNAME")) { eLCardAuthorizationData.Tables[0].Columns.Add("OPERATORNAME"); eLCardAuthorizationData.Tables[0].Rows[0]["OPERATORNAME"] = SysOperatorInfo.OperatorName; } eCardAuthorizationFacade.updateEntity(eLCardAuthorizationData); //eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney; Savingsucceed = 1; //打印发卡凭证 PrintSendCardReport(eLCardAuthorizationData, drCard["PATIENTNAME"].ToString()); } else { try { //充值,弹出界面选择是现金充值还是银行卡预存 if (!string.IsNullOrEmpty(AutoHostConfig.PosInterfaceType)) { FrmCardSavingMain frm = new FrmCardSavingMain(); frm.CallType = 2; frm.ShowDialog(); Savingsucceed = frm.Savingsucceed; RechargeMoney = frm.RechargeMoney; strModeType = frm.MODETYPE; frm.Dispose(); } else { //拍照 switch (AutoHostConfig.ReadCardType) { case "XUHUI": case "XUHUIM1": AutoServiceSDK.SdkService.Common_XH camera = new AutoServiceSDK.SdkService.Common_XH(); camera.TakeCamera(SkyComm.cardInfoStruct.CardNo, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString(), AutoHostConfig.Machineno); break; default: break; } FrmCardSavingCash frm = new FrmCardSavingCash(); frm.CallType = 2; frm.ShowDialog(); Savingsucceed = frm.Savingsucceed; RechargeMoney = frm.RechargeMoney; frm.Dispose(); } if (Savingsucceed == 1) { eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = strModeType; if (!eLCardAuthorizationData.Tables[0].Columns.Contains("OPERATORNAME")) { eLCardAuthorizationData.Tables[0].Columns.Add("OPERATORNAME"); eLCardAuthorizationData.Tables[0].Rows[0]["OPERATORNAME"] = SysOperatorInfo.OperatorName; } eCardAuthorizationFacade.updateEntity(eLCardAuthorizationData); eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney; //打印发卡凭证 PrintSendCardReport(eLCardAuthorizationData, drCard["PATIENTNAME"].ToString()); } } catch (Exception ex2) { Skynet.LoggingService.LogService.GlobalInfoMessage("补卡充值失败:" + ex2.Message); } finally { //SkyComm.cardInfoStruct = new CardInformationStruct(); //SkyComm.eCardAuthorizationData.Tables[0].Clear(); //SkyComm.DiagnoseID = string.Empty; //SkyComm.cardBlance = 0; //SkyComm.cardallmoney = 0; } } if (Savingsucceed == 1) { SendCard.OutputCard(); SkyComm.ShowMessageInfo("补卡成功,请取走您的就诊卡!"); } else { //撤消已注销挂失并补卡的信息 Skynet.LoggingService.LogService.GlobalInfoMessage("充值失败,撤消发卡信息"); //eCardAuthorizationFacade.deleteEntityAndCardSaving(eLCardAuthorizationData); DataSet dsCardAuthorizationData = (DataSet)eLCardAuthorizationData; eCardAuthorizationFacade.TranBackBussiness(drCard["ACCOUNT_ID"].ToString(), eLCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString(), drCard["CARDID"].ToString(), drCard["CIRCUIT_STATE"].ToString(), eLCardAuthorizationData); eLCardAuthorizationData = new CardAuthorizationData(); this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; //发卡失败以后将卡进行回收 SendCard.ReturnCard(); ucTime1.timer1.Start(); return; } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("发卡失败:" + ex.Message + ",系统回收卡机中的卡"); //发卡失败以后将卡进行回收 SendCard.ReturnCard(); SkynetMessage.MsgInfo("发卡失败:" + ex.Message); ucTime1.timer1.Start(); return; } finally { SkyComm.cardInfoStruct = new CardInformationStruct(); SkyComm.eCardAuthorizationData.Tables[0].Clear(); SkyComm.DiagnoseID = string.Empty; SkyComm.cardBlance = 0; SkyComm.cardallmoney = 0; this.lblOK.Enabled = true; //this.btnReturn.Enabled = true; this.btnExit.Enabled = true; } #endregion SystemFramework.Voice.Voice voice = new SystemFramework.Voice.Voice(); voice.PlayText("请在就诊卡出口取走您的就诊卡!"); voice.EndJtts(); ucTime1.timer1.Start(); DialogResult = System.Windows.Forms.DialogResult.OK; }
private void Saving(decimal money) { if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所要充值的卡信息!"); frm.ShowDialog(); return; } eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之前"); ////Add money if (CallType == 2) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money; //此处需调接口 } Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之后"); //业务类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = SkyComm.AddMoneyPosMode; //单位 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //充值数据来源 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = AutoHostConfig.BankName; eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { SkyComm.ShowMessageInfo("该时间段已经结帐,不能办理预交金业务,请重试!"); return; } DataSet cardSavingData = new DataSet(); POSBase Posfac = IPOSFactory.CreateIPOS(AutoHostConfig.PosInterfaceType); if (Posfac == null) { SkyComm.ShowMessageInfo("银联POS接口配置不正确,请与管理员联系!"); return; } ValidateCode vc = new ValidateCode(); string HisSeqNo = string.Empty; HisSeqNo = DateTime.Now.ToString("yyMMddHHmmss") + SysOperatorInfo.OperatorID + vc.GenValidateCode(4); Hashtable BankTranht = new Hashtable(); BankTranht.Add("SEQNO", HisSeqNo); BankTranht.Add("MONEY", money); BankTranht.Add("OPERATORID", SysOperatorInfo.OperatorCode); BankTranht.Add("POSNO", AutoHostConfig.PosNo); BankTranht.Add("DIAGNOSEID", SkyComm.DiagnoseID); BankTranht.Add("CARDID", SkyComm.cardInfoStruct.CardNo); Posfac.Trans("1", BankTranht); if (BankTranht["CARDNO"] != null) { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKCARDNO] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKTRANSNO] = BankTranht["BANKSEQNO"].ToString(); } try { //if (SkynetMessage.MsgInfo("是否要充值成功?", true) == false) //{ // throw new Exception("操作操作测试放弃充值!"); //} cardSavingData = eCardSavingFacade.insertEntity(eCardAuthorizationData); Posfac.Trans("2", BankTranht); Savingsucceed = 1; } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS保存失败:" + ex.Message + "\r\n开始调用撤消方法"); SkynetMessage.MsgInfo("HIS充值失败,需要撤消银行交易,请按POS机提示操作!"); Posfac.Trans("-2", BankTranht); Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS失败,调用银行撤消完成!"); //SkynetMessage.MsgInfo("HIS充值失败:"+ex.Message); return; } SkyComm.GetCardBalance(); if (CallType != 2) { //打印充值凭证 PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), money.ToString()); if (CallType == 0) { FrmRechargeSuccessful frmRecharge = new FrmRechargeSuccessful(); frmRecharge.RechargeMoney = money; frmRecharge.ShowDialog(this); frmRecharge.Dispose(); SkyComm.CloseWin(this); } else { SkyComm.ShowMessageInfo("您成功充值" + money + "元!卡中余额" + SkyComm.cardBlance.ToString() + ""); SkyComm.CloseWin(this); } } else { DialogResult = System.Windows.Forms.DialogResult.OK; SkyComm.CloseWin(this); } //GetMoeny(); }
private void Saving(decimal money) { if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所需要的患者信息!"); frm.ShowDialog(); return; } DataSet cardSavingData = new DataSet(); POSBase Posfac = IPOSFactory.CreateIPOS(AutoHostConfig.PosInterfaceType); if (Posfac == null) { SkyComm.ShowMessageInfo("银联POS接口配置不正确,请与管理员联系!"); return; } ValidateCode vc = new ValidateCode(); string HisSeqNo = string.Empty; HisSeqNo = DateTime.Now.ToString("yyMMddHHmmss") + SysOperatorInfo.OperatorID + vc.GenValidateCode(4); #region 住院预交金充值 AdvanceRecordData AdvData = new AdvanceRecordData(); DataRow dr = AdvData.Tables[0].NewRow(); dr[AdvanceRecordData.H_ADVANCE_RECORD_ADVANCEID] = "新增"; dr[AdvanceRecordData.H_ADVANCE_RECORD_BUSINESSBANK] = HisSeqNo; dr[AdvanceRecordData.H_ADVANCE_RECORD_CANCELMARK] = 0; dr[AdvanceRecordData.H_ADVANCE_RECORD_CHEQUEID] = ""; dr[AdvanceRecordData.H_ADVANCE_RECORD_CURRENTINHOSMARK] = inHosData.Tables[0].Rows[0]["CURRENTINHOSMARK"].ToString();; dr[AdvanceRecordData.H_ADVANCE_RECORD_INHOSID] = inHosData.Tables[0].Rows[0]["INHOSID"].ToString(); dr[AdvanceRecordData.H_ADVANCE_RECORD_OFFICEID] = inHosData.Tables[0].Rows[0]["INHOSOFFICEID"].ToString();//this.txtZyks.Text; dr[AdvanceRecordData.H_ADVANCE_RECORD_OPERATEDATE] = new CommonFacade().GetServerDateTime(); dr[AdvanceRecordData.H_ADVANCE_RECORD_OPERATORID] = SysOperatorInfo.OperatorID; dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMODEID] = SkyComm.getvalue("住院预交金充值方式_银行卡").ToString(); dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMONEY] = RechargeMoney; dr[AdvanceRecordData.H_ADVANCE_RECORD_RECEIPTID] = string.Empty; AdvData.Tables[0].Rows.Add(dr); AdvanceRecordFacade theAdvanceRecordFacade = new AdvanceRecordFacade(); #endregion string advanceid = string.Empty; Hashtable BankTranht = new Hashtable(); BankTranht.Add("SEQNO", HisSeqNo); BankTranht.Add("MONEY", money); BankTranht.Add("OPERATORID", SysOperatorInfo.OperatorCode); BankTranht.Add("POSNO", AutoHostConfig.PosNo); BankTranht.Add("DIAGNOSEID", SkyComm.DiagnoseID); BankTranht.Add("CARDID", SkyComm.cardInfoStruct.CardNo); if (AutoHostConfig.PosInterfaceType.Equals("锡盟新利"))//锡盟新利 弹出错误提示 { try { Posfac.Trans("1", BankTranht); } catch (Exception ex) { SkyComm.ShowMessageInfo(ex.Message.ToString()); return; } } else { Posfac.Trans("1", BankTranht); } if (BankTranht["CARDNO"] != null) { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKCARDNO] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKTRANSNO] = BankTranht["BANKSEQNO"].ToString(); } try { advanceid = theAdvanceRecordFacade.insertEntity(AdvData, false); Posfac.Trans("2", BankTranht); Savingsucceed = 1; } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS保存失败:" + ex.Message + "\r\n开始调用撤消方法"); SkyComm.ShowMessageInfo("预交金充值失败,需要撤销银行交易,请按POS机提示操作,点击确定后,请重新插入银行卡!"); Posfac.Trans("-2", BankTranht); Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS失败,调用银行撤消完成!"); SkyComm.ShowMessageInfo("银行交易失败,充值金额已退回卡,请重新充值!"); //SkynetMessage.MsgInfo("HIS充值失败:"+ex.Message); return; } //SkyComm.GetCardBalance(); if (Savingsucceed == 1) { string receiptID = theAdvanceRecordFacade.GetReceiptIDByAdvanceID(advanceid); //打印充值凭证 PrintInfo("住院预交金充值凭证", receiptID, money.ToString(), advanceid, HisSeqNo); decimal old_YE = Convert.ToDecimal(inHosData.Tables[0].Rows[0]["BALANCEMONEY"].ToString()); SkyComm.ShowMessageInfo("您成功充值" + money + "元!卡中余额" + (old_YE + money).ToString("0.00##") + "元!"); string _isPrint = SkyComm.getvalue("锡盟预交款打印凭证"); //Case 31629 锡盟预交款打印凭证 _isPrint = string.IsNullOrEmpty(_isPrint) ? "0" : "1"; if (_isPrint.Equals("0")) { try { MoneyTransferPresenter moneyTransferPresenter = new MoneyTransferPresenter(); DataSet dataSet = moneyTransferPresenter.getBankInfo(SkyComm.DiagnoseID, HisSeqNo); dataSet.WriteXml(Application.StartupPath + @"\\ReportXml\\" + "银行pos凭证" + SkyComm.DiagnoseID + ".xml"); if (!File.Exists(Application.StartupPath + @"\\Reports\\" + "银行pos凭证" + ".frx")) { SkynetMessage.MsgInfo("银行pos凭证" + ".frx报表文件不存在,无法打印."); return; } //Common_XH theCamera_XH = new Common_XH(); //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁); PrintManager print = new PrintManager(); print.InitReport("银行pos凭证"); print.AddData(dataSet.Tables[0], "pos"); print.Print(); print.Dispose(); } catch (Exception e) { } } } SkyComm.CloseWin(this); }
public string GetPatiantInfo() { CardAuthorizationFacade theCardAuthorizationFacade = new CardAuthorizationFacade(); SkyComm.eCardAuthorizationData = (CardAuthorizationData)theCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(SkyComm.cardInfoStruct.CardNo); if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count == 0) { //SkyComm.ShowMessageInfo("卡号无效! 卡号:" + SkyComm.cardInfoStruct.CardNo); return("卡号无效!"); } string CardID = SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID].ToString(); if (!string.IsNullOrEmpty(CardID)) { if (Convert.ToInt32(SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CIRCUIT_STATE]) == 1) { SkyComm.ShowMessageInfo("此卡已挂失不能使用!"); return("此卡已挂失不能使用!"); } if (Convert.ToInt32(SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CIRCUIT_STATE]) == 2) { SkyComm.ShowMessageInfo("此卡已注销不能使用!"); return("此卡已注销不能使用!"); } DataSet dsType = new CardTypesFacade().FindByPrimaryKey(SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0]["TYPEID"].ToString()); if (dsType.Tables[0].Rows[0]["IS_FEECHARGING_CARD"].ToString() == "1") { return("此卡为不储值卡,不能使用!"); } } else { return("此卡信息不存在!"); } if (SkyComm.eCardAuthorizationData == null || SkyComm.eCardAuthorizationData.Tables[0].Rows.Count <= 0) { return("读取病人信息失败!"); } int IS_FEECHARGING_CARD = -1; IS_FEECHARGING_CARD = Convert.ToInt32(SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["IS_FEECHARGING_CARD"]); SkyComm.cardInfoStruct.Is_FEECHARGING_CARD = IS_FEECHARGING_CARD; SkyComm.cardInfoStruct.CardTypeID = Convert.ToInt32(SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["TYPEID"]); SkyComm.DiagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); if (SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString() != "2") { SkyComm.cardBlance = DecimalRound.Round(theCardAuthorizationFacade.FindCardBalance(SkyComm.DiagnoseID), 2); } else { SkyComm.cardBlance = DecimalRound.Round(theCardAuthorizationFacade.FindCardBalance_New(SkyComm.DiagnoseID, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["ACCOUNT_ID"].ToString()), 2); } CardSavingFacade cf = new CardSavingFacade(); if (SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString() != "2") { SkyComm.cardallmoney = cf.FindBalanceMoneyByDiagnoseID(SkyComm.DiagnoseID); } else { SkyComm.cardallmoney = cf.FindBalanceMoneyByDiagnoseID_New(SkyComm.DiagnoseID, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["ACCOUNT_ID"].ToString()); } return(""); }