private void DoPrevOrder(string orderyKey) { string msg=string.Empty; if (this.InvokeRequired) { this.BeginInvoke(new MethodInvoker(delegate() { this.lbLoding.BringToFront(); this.lbLoding.Visible = true; })); } TicketInfo ti = null; if (!this.IsDisposed) { ti = TicketHelper.GetTicketInfo(orderyKey, qe, ref msg); } Action finishAction = () => { this.dgTicket.Enabled = true; this.lbLoding.Visible = false; if (ti != null) { OrderForm of = new OrderForm(ti); of.ShowDialog(this); } else { if (msg != "") { if (msg.Contains("您还有未处理的订单")) { msg = "您还有未处理的订单,请处理完后再订票!"; } MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { msg = "获取车次预订信息失败!"; } } }; this.BeginInvoke(finishAction); }