/// <summary> /// 保存基础交易信息 /// </summary> public void saveTradeInfo(Hashtable hashtable) { string mSql = "INSERT INTO T_BANKHISEXCHANGE_TRANS (HISSEQNO,BANKSTATE,HISSTATE,BUSCD,HISID,TRFAMT,USETYPE,OPERATORID,OPERATETIME,DIAGNOSEID,BUSINESSTYPE,DATASOURCES,OHISSEQNO,BANKSEQNO,PAYCHANNELS) VALUES (@HISSEQNO ,@BANKSTATE,@HISSTATE,@BUSCD,@HISID,@TRFAMT,@USETYPE,@OPERATORID,@OPERATETIME,@DIAGNOSEID,@BUSINESSTYPE,@DATASOURCES,'','','原生接口支付')"; string start = DateTime.Now.ToString("yyyy-MM-dd ") + " 00:00:00"; QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); int i = querySolutionFacade.ExeNonQuery(mSql, hashtable); if (i <= 0) { throw new Exception("保存基础信息失败!"); } }
public void updateHisState(string hisSerialNo) { string mSql = "UPDATE T_BANKHISEXCHANGE_TRANS set HISSTATE = '1' where HISSEQNO = @HISSEQNO"; Hashtable hashtable = new Hashtable(); hashtable.Add("@HISSEQNO", hisSerialNo); QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); int i = querySolutionFacade.ExeNonQuery(mSql, hashtable); if (i <= 0) { throw new Exception("更新医院状态失败!"); } }
public void revokedTrade(string hisSerialNo, string errorId) { try { string mSql = "UPDATE T_BANKHISEXCHANGE_TRANS set REMARK = @REMARK where HISSEQNO = @HISSEQNO"; Hashtable hashtable = new Hashtable(); hashtable.Add("@HISSEQNO", hisSerialNo); hashtable.Add("@REMARK", errorId); QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); int i = querySolutionFacade.ExeNonQuery(mSql, hashtable); } catch (Exception e) { Log.Info(GetType().ToString(), "等待支付结果超时,更新交易表异常:" + e.Message); } }
/// <summary> /// 更新检验报告中间表,更新打印状态 /// </summary> private void UpdateListData() { DataTable dtPrint = (DataTable)this.gdcMain.DataSource; QuerySolutionFacade facade = new QuerySolutionFacade(); try { foreach (DataRow dr in dtPrint.Rows) { string sql = "UPDATE LIS_REPORTFILE SET PRINTCOUNT=PRINTCOUNT+1 WHERE CHECK_NO=@CHECKNO"; Hashtable ht = new Hashtable(); ht.Add("@CHECKNO", dr["CHECK_NO"].ToString()); facade.ExeNonQuery(sql, ht); } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalErrorMessage("更新检验结果中间表失败,原因:" + ex.Message); } }
public void updateRefundOrderResult(List <string> list, string hisSerialNo) { try { string mSql = "UPDATE T_BANKHISEXCHANGE_TRANS set OHISSEQNO = @OHISSEQNO, BANKSTATE = '0', HISSTATE = '0',REFUNDMONEY = @REFUNDMONEY,OPERATETIME = @OPERATETIME where a.HISSEQNO = @HISSEQNO"; Hashtable hashtable = new Hashtable(); hashtable.Add("@OHISSEQNO", list[1]); hashtable.Add("@REFUNDMONEY", list[2]); hashtable.Add("@OPERATETIME", list[3]); hashtable.Add("@HISSEQNO", hisSerialNo); QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); int i = querySolutionFacade.ExeNonQuery(mSql, hashtable); } catch (Exception e) { Log.Info(GetType().ToString(), "保存" + SkyComm.cardInfoStruct.CardNo + "的退费记录", e.Message); } }
private void btnBalance_Click(object sender, EventArgs e) { QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); DetailAccountFacade detailAccountFacade = new DetailAccountFacade(); string mechinNo = string.Empty; try { #region 获取ip string ipAddress = null; try { string hostName = Dns.GetHostName(); IPHostEntry ipEntry = Dns.GetHostEntry(hostName); for (int i = 0; i < ipEntry.AddressList.Length; i++) { if (ipEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork) { ipAddress = ipEntry.AddressList[i].ToString(); } } } catch (Exception ex) { SkyComm.ShowMessageInfo(ex.Message); return; } #endregion #region 获取机器码 string sql1 = "select * from T_AUTOSERVICEMACHINE_INFO where IPADDRESS = @IPADDRESS"; Hashtable hashtable1 = new Hashtable(); hashtable1.Add("@IPADDRESS", ipAddress); DataSet dataSet = querySolutionFacade.ExeQuery(sql1, hashtable1); if (dataSet.Tables[0].Rows.Count > 0) { mechinNo = dataSet.Tables[0].Rows[0]["MACHINENO"].ToString(); } #endregion #region 判断结算 Hashtable hashtablejs = new Hashtable(); string sqljs = "select * from SETTLEMENT_RECORD where MECHINNO = @MECHINNO";// and BANKSTATE = '1' hashtablejs.Add("@MECHINNO", mechinNo); DataSet dataSet1 = querySolutionFacade.ExeQuery(sqljs, hashtablejs); if (dataSet1.Tables[0].Rows.Count > 0) { if (dataSet1.Tables[0].Rows[0]["SETTLEMENT_TIME"].ToString().Equals(DateTime.Now.ToString("yyyy-MM-dd"))) { SkyComm.ShowMessageInfo("此台机器已经结算过"); return; } else { } } #endregion #region 获取结算时间 string MBeginTime = DateTime.Now.ToLocalTime().ToString();; string MEndTime = DateTime.Now.ToLocalTime().ToString();; string sql3 = "select * from SETTLEMENT_TIME where M_NO = @M_NO"; Hashtable hashtable3 = new Hashtable(); hashtable3.Add("@M_NO", mechinNo); DataSet dataSet3 = querySolutionFacade.ExeQuery(sql3, hashtable3); if (dataSet3.Tables[0].Rows.Count > 0) { MBeginTime = dataSet3.Tables[0].Rows[0]["TIMES"].ToString(); } #endregion #region 获取现金记录 string sql2 = "select * from T_AUTOINMONEY_RECORD where MACHINENO = @MACHINENO and OPERATORTIME between @starttime and @endtime"; Hashtable hashtable2 = new Hashtable(); hashtable2.Add("@MACHINENO", mechinNo); hashtable2.Add("@starttime", MBeginTime); hashtable2.Add("@endtime", MEndTime); DataSet dataSet2 = querySolutionFacade.ExeQuery(sql2, hashtable2); if (dataSet2.Tables[0].Rows.Count == 0) { SkyComm.ShowMessageInfo("此台机器没有结算信息,已经记录结算时间"); } else { dataSet2.WriteXml(Application.StartupPath + @"\\ReportXml\\自助机结算.xml"); string path = Application.StartupPath + @"\\Reports\\自助机结算.frx"; PrintManager print = new PrintManager(); print.InitReport("自助机结算"); print.AddParam("结算时间", DateTime.Now.ToLocalTime().ToString()); print.AddData(dataSet2.Tables[0], "report"); PrintManager.CanDesign = true; print.Print(); print.Dispose(); } #endregion } catch (Exception e1) { SkyComm.ShowMessageInfo(e1.Message); return; } #region 记录结算 DataSet data = new DataSet(); Hashtable hashtable = new Hashtable(); string mSql = "delete from SETTLEMENT_RECORD where MECHINNO = @MECHINNO";// and BANKSTATE = '1' hashtable.Add("@MECHINNO", mechinNo); querySolutionFacade.ExeNonQuery(mSql, hashtable); string sql = "insert into SETTLEMENT_RECORD values (@SETTLEMENT_TIME,'已结算',@MECHINNO);"; hashtable.Add("@SETTLEMENT_TIME", DateTime.Now.ToString("yyyy-MM-dd")); data = querySolutionFacade.ExeQuery(sql, hashtable); #endregion #region 记录结算时间 string sql4 = "delete from SETTLEMENT_TIME where M_NO = @M_NO"; Hashtable hashtable4 = new Hashtable(); hashtable4.Add("@M_NO", mechinNo); int a = querySolutionFacade.ExeNonQuery(sql4, hashtable4); string sql5 = "insert into SETTLEMENT_TIME values (@TIMES,@M_NO)"; Hashtable hashtable5 = new Hashtable(); hashtable5.Add("@TIMES", DateTime.Now.ToLocalTime().ToString()); hashtable5.Add("@M_NO", mechinNo); int b = querySolutionFacade.ExeNonQuery(sql5, hashtable5); #endregion SkyComm.ShowMessageInfo("现金结算成功"); //_mSquareAccountsPresenter = new SquareAccountsPresenter(this); //_mSquareAccountsPresenter.GetSquareAccount(); }