//查询 private void query() { try { UnicomQueryInfo info = UnicomAccess.query(Payment.unicomPayParam.PhoneOn); if (!"0000".Equals(info.msgrsp.retcode)) { if (info.msgrsp.retshow.Length > 0) { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), info.msgrsp.retshow); return; } else { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); return; } } Payment.unicomPayParam.Msgrsp = info.msgrsp; Payment.unicomPayParam.AccountNo = info.msgrsp.ACCOUNT_NO; //显示电话号码 this.lblBalance.Dispatcher.Invoke(new balanceDelegate(setBalanceText), Payment.unicomPayParam.PhoneOn); //显示当月消费金额 this.lblAmount.Dispatcher.Invoke(new amountDelegate(setAmountText), info.msgrsp.PRESENT_AMOUNT); //账户余额 this.lblyue.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), this.lblyue, info.msgrsp.PAYMENT_AMOUNT); //显示面板 this.panel.Dispatcher.Invoke(new panelShowDelegate(setPanelVisibility), true); //显示充值按钮 this.OkBtn.Dispatcher.Invoke(new isShowBtnDelegate(setBtnVisibility), OkBtn, true); //提示信息 lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "您的话费信息"); SysBLL.Player("继续充值请点积确定按钮.wav"); } catch (WtException wte) { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); } catch (Exception e) { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); log.Write("error:FormUnicomStep02:query():" + e.Message); } finally { //隐藏动态图片 loadlbl.Dispatcher.Invoke(new isShowLabelDelegate(isShowLabel), loadlbl, false); } }
/// <summary> /// 联通查询 /// </summary> /// <param name="param"></param> /// <returns></returns> public UnicomQueryInfo query(UnicomQueryParam param) { UnicomQueryInfo info = null; Dictionary <String, String> parameters = new Dictionary <String, String>(); parameters.Add("authcode", param.authcode); parameters.Add("servicename", param.servicename); parameters.Add("trandateTime", param.trandateTime); parameters.Add("reqsn", param.reqsn); parameters.Add("loginId", param.loginId); parameters.Add("phoneNo", param.phoneNo); string jsonText = HttpHelper.getHttp(SysConfigHelper.readerNode("UnicomQueryName"), parameters, null); //反序列化JSON字符串,将JSON字符串转换成LIST列表 info = JsonConvert.DeserializeObject <UnicomQueryInfo>(jsonText); return(info); }
/// <summary> /// 联通查询 /// </summary> /// <param name="phoneNo"></param> /// <returns></returns> public static UnicomQueryInfo query(string phoneNo) { UnicomQueryInfo info = null; try { UnicomQueryParam param = new UnicomQueryParam(); SysBLL.Authcode = UnicomLogin(); param.authcode = SysBLL.Authcode; param.servicename = "LT001"; param.trandateTime = SysBLL.getYYYYMMDDHHMMSSTime(); param.reqsn = SysBLL.getSerialNum();; param.loginId = SysBLL.getCpuNo();; param.phoneNo = phoneNo; info = access.query(param); string temp = info.msgrsp.retcode; return(info); } catch (Exception e) { throw new WtException(WtExceptionCode.Bus.BUS_QUERY, e.Message); } }