private void load() { try { SysBLL.Player("正在查询.wav"); result01 = null; result02 = null; result03 = null; list = null; wintopQueryInfo = null; visble(); lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, "正在查询,请稍后..."); //显示正在加载中 loadlbl.Dispatcher.Invoke(new isShowLabelDelegate(isShowLabel), this.loadlbl, true); queryThread = new Thread(delegate() { query(); }); queryThread.Start(); timerLoad = new DispatcherTimer(); timerLoad.Interval = TimeSpan.FromMilliseconds(400); timerLoad.Tick += new EventHandler(timer_Tick); timerLoad.Start(); } catch (Exception ex) { log.Write("error:FormCitizenStep03:load():" + ex.Message); } }
void query() { try { wintopQueryInfo = WintopAccess.WintopQuery(Payment.wintopReChargeParam.WtCardNo); if (!"0000".Equals(wintopQueryInfo.msgrsp.retcode)) { //pictureBox4.Visible = false; if (wintopQueryInfo.msgrsp.retshow.Length > 0) { lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, wintopQueryInfo.msgrsp.retshow); return; } else { lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, "查询失败,请稍后再试"); return; } } if (wintopQueryInfo.msgrsp.wTCardInfoList.Count > 0) { show(); list = wintopQueryInfo.msgrsp.wTCardInfoList; for (int i = 0; i < list.Count; i++) { if ("01".Equals(list[i].TYPE)) { USERID1.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), USERID1, list[i].WTCARDID); AMOUNT1.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), AMOUNT1, list[i].AMOUNT); result01 = list[i]; } if ("02".Equals(list[i].TYPE)) { USERID2.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), USERID2, list[i].WTCARDID); AMOUNT2.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), AMOUNT2, list[i].AMOUNT); result02 = list[i]; } /*if ("03".Equals(list[i].TYPE)) * { * USERID3.Text = list[i].USERID; * AMOUNT3.Text = list[i].AMOUNT; * result03 = list[i]; * button3.Enabled = true; * }*/ } lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, "您的账号信息"); SysBLL.Player("继续缴费请点击充值按钮.wav"); } else { lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, "没有记录"); } } catch (ThreadAbortException ae) { log.Write("error:" + ae.Message); } catch (WtException e) { lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, e.Message); } catch (Exception e) { lblAccountInfo.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), lblAccountInfo, "查询失败,请稍候再试..."); } finally { //隐藏加载 loadlbl.Dispatcher.Invoke(new isShowLabelDelegate(isShowLabel), this.loadlbl, false); } }