private async void btnSave_Click(object sender, EventArgs e) { if (list.Count > 0) { loading.ShowLoading(); TradeModifyResponseModel[] responseModels = await CustomService.Service.TradeModifyAllAsync(list.ToArray()); loading.HideLoading(); StringBuilder sbMessage = new StringBuilder(); foreach (TradeModifyResponseModel response in responseModels) { if (response.ErrorCode == -1) { _log.Fatal(JsonConvert.SerializeObject(response)); sbMessage.AppendFormat("OrderTicket :{0} Message:{1}", response.ModifyModel.OrderTicket, response.ErrorDescription); sbMessage.AppendLine(); continue; } else { _log.Info(JsonConvert.SerializeObject(response)); } } if (sbMessage.Length == 0) { MessageBox.Show("批量修改成功!"); } else { MessageBox.Show("修改失败订单:\r\b" + sbMessage.ToString()); } } loading.HideLoading(); list.Clear(); }
private async void ModifyOrder_Load(object sender, EventArgs e) { dataGridViewModifyData.AutoGenerateColumns = false; //创建加载框 loading = new UserControls.Loading(); loading.Showed += loading_Showed; loading.Hided += loading_Hided; this.Controls.Add(loading); loading.ShowLoading(); PumpingService.TradeRecordSE[] trades = await Core.CustomService.Service.GetTradesRecordHistoryAsync(this._account, DateTime.Now.AddYears(-20), DateTime.Now); Display(trades.Where(ele => ele.Cmd != 6).ToArray()); loading.HideLoading(); }