private void button5_Click_1(object sender, EventArgs e) { PropSecOrderParam param = new PropSecOrderParam(); param.shopType = "1"; param.AMOUNT = "12"; param.paymentAmout = "0"; param.SC10009 = "W000000001"; param.SC10010 = "01"; param.SC10007 = "XQ00000221"; param.SC10008 = SC10008; param.merchantNo = merchantNo; PropSecOrderInfo info = access.order(param); PayAccess payAccess = new PayAccess(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("serviceType", "5_2"); parameters.Add("realAmout", info.msgrsp.realAmout); parameters.Add("tr.shop_type", "1"); parameters.Add("tr.cloud_no", info.msgrsp.orderNo); parameters.Add("terminalNo", SysConfigHelper.readerNode("ClientNo")); parameters.Add("ipAddress", SysConfigHelper.readerNode("PayName")); PayResultInfo payinfo = payAccess.PayResNewAcc(parameters); StringBuilder result1 = new StringBuilder(2048); StringBuilder result2 = new StringBuilder(2048); IntPtr status = PropSwwyBLL.WF002( new StringBuilder("02"), //业务类型 new StringBuilder("01"), //卡片种类 new StringBuilder("01"), //卡片版本 new StringBuilder(""), //,业务步骤 new StringBuilder(""), //卡片唯一识别号 new StringBuilder(""), //物业公司编号 new StringBuilder(""), //小区编号 new StringBuilder("W000000001"), //表具产商编号 new StringBuilder("8"), //端口号 result1, //返回说明 new StringBuilder(payinfo.SC20003.ToString()), //业务输入信息 result2 //业务返回信息 ); string result = Marshal.PtrToStringAnsi(status); MessageBox.Show(result); PropSecCardJson card = new PropSec().JsonToModel(result2.ToString()); //SC10007 = card.G_0806; SC10008 = card.G_1802; listViewAdd("写卡:" + "状态:" + result.ToString() + "返回说明:" + result1.ToString() + "返回信息:" + result2.ToString()); //IntPtr intPtr = ReturnString(); //string str = Marshal.PtrToStringAnsi(intPtr); }
public void excute(string _9, string _10, string _11, string serviceType, string cardType) { PropSecQueryParam param = new PropSecQueryParam(); param.SC10009 = _9; param.SC10010 = _10; param.SC10011 = _11; PropSecQueryInfo info = access.query(param); StringBuilder result1 = new StringBuilder(2048); StringBuilder result2 = new StringBuilder(2048); IntPtr status = PropSwwyBLL.WF002( new StringBuilder(serviceType), //业务类型 new StringBuilder(cardType), //卡片种类 new StringBuilder("01"), //卡片版本 new StringBuilder(info.msgrsp.SC10011), //,业务步骤 new StringBuilder(""), //卡片唯一识别号 new StringBuilder(""), //物业公司编号 new StringBuilder(""), //小区编号 new StringBuilder(_9), //表具产商编号 new StringBuilder("8"), //端口号 result1, //返回说明 new StringBuilder(info.msgrsp.SC20003), //业务输入信息 result2 //业务返回信息 ); string result = Marshal.PtrToStringAnsi(status); MessageBox.Show(result); PropSecCardJson card = new PropSec().JsonToModel(result2.ToString()); //SC10007 = card.G_0806; SC10008 = card.G_1802; merchantNo = info.msgrsp.merchantNo; listViewAdd("读卡:" + "状态:" + result.ToString() + "返回说明:" + result1.ToString() + "返回信息:" + result2.ToString()); }
private void read() { try { isRead = false; try { SysBLL.Player("读取中.wav"); showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "正在读卡,请稍后..."); PropSecAccess access = new PropSecAccess(); PropSecQueryParam param = new PropSecQueryParam(); param.SC10009 = Payment.propSecPayParam.ManufacturerNum; param.SC10010 = Payment.propSecPayParam.CardType; param.SC10011 = "01"; param.ResidentialNo = ConfigSysParam.ResidentialNo; PropSecQueryInfo info = access.query(param); if (!"0000".Equals(info.msgrsp.retcode)) { PrintInfo(info.msgrsp.retshow); return; } StringBuilder result1 = new StringBuilder(2048); StringBuilder result2 = new StringBuilder(2048); log.Write("物业2读卡:业务类型:08,卡片种类:" + Payment.propSecPayParam.CardType + ",业务步骤:" + info.msgrsp.SC10011 + ",表具厂商编号:" + Payment.propSecPayParam.ManufacturerNum + ",输入信息:" + info.msgrsp.SC20003 + ",端口:" + SysConfigHelper.readerNode("PropSwwyName")); IntPtr status = PropSwwy.WF002( new StringBuilder("08"), //业务类型 new StringBuilder(Payment.propSecPayParam.CardType), //卡片种类 new StringBuilder("01"), //卡片版本 new StringBuilder(info.msgrsp.SC10011), //,业务步骤 new StringBuilder(""), //卡片唯一识别号 new StringBuilder(""), //物业公司编号 new StringBuilder(""), //小区编号 new StringBuilder(Payment.propSecPayParam.ManufacturerNum), //表具产商编号 new StringBuilder(SysConfigHelper.readerNode("PropSwwyName")), //端口号 result1, //返回说明 new StringBuilder(info.msgrsp.SC20003), //业务输入信息 result2 //业务返回信息 ); string result = Marshal.PtrToStringAnsi(status); log.Write("物业2读卡返回:" + result); if (!"0".Equals(result)) { PrintInfo("读取失败,请重试..."); isRead = true; return; } PropSecCardJson card = new PropSec().JsonToModel(result2.ToString()); log.Write("result2.ToString():" + result2.ToString()); Payment.propSecPayParam.propMeterInfo = access.queryMeter(ConfigSysParam.ResidentialNo, card.G_1802); log.Write("获取表具列表返回码:" + Payment.propSecPayParam.propMeterInfo.msgrsp.retcode); if (!"0000".Equals(Payment.propSecPayParam.propMeterInfo.msgrsp.retcode)) { if (Payment.propSecPayParam.propMeterInfo.msgrsp.retshow != null) { if (Payment.propSecPayParam.propMeterInfo.msgrsp.retshow.Length > 0) { showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, Payment.propSecPayParam.propMeterInfo.msgrsp.retshow); } else { showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "读卡失败,请稍后再试..."); } } else { showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "读卡失败,请稍后再试..."); } SysBLL.Player("读物业卡2失败.wav"); return; } if (DictParam.Prop2TanAnNum.Equals(Payment.propSecPayParam.ManufacturerNum)) { log.Write("G_2015:" + card.G_2015); if (card.G_2015 != null) { if (!"0".Equals(card.G_2015)) { showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "请将上次的气量插入到表内再进行充值!"); return; } } else { showInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), showInfo, "读卡失败,请稍后再试...."); SysBLL.Player("读物业卡2失败.wav"); return; } } Payment.propSecPayParam.SC10007 = card.G_0806; Payment.propSecPayParam.SC10008 = card.G_1802; Payment.propSecPayParam.merchantNo = info.msgrsp.merchantNo; Util.JumpUtil.jumpCommonPage("FormPropSec01_2"); return; } catch (ThreadAbortException ae) { log.Write("error:物业2读卡异常:" + ae.Message); } catch (Exception ex) { PrintInfo("读取失败,请重试..."); SysBLL.Player("读物业卡2失败.wav"); log.Write("error:FormGasGoldenCardStep02:UserControl_Loaded:" + ex.Message); return; } } catch (AccessViolationException ave) { PrintInfo("读取失败,请重试...."); //SysBLL.Player("读物业卡2失败.wav"); log.Write("error1:" + ave.Message); } catch (ThreadAbortException ae) { log.Write("error:物业2读卡异常:" + ae.Message); } catch (WtException e) { PrintInfo("读取失败,请重试...."); //SysBLL.Player("读物业卡2失败.wav"); log.Write("error:2" + e.Message); } catch (Exception e) { PrintInfo("读取失败,请重试...."); SysBLL.Player("读物业卡2失败.wav"); log.Write("error:3" + e.Message); } finally { isRead = true; } }