private void dgridOpenOrders_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (gvMyOpenOrders.Column(e.ColumnIndex).Name == "delete") { string orderid = (string)gvMyOpenOrders.CellValue("openUuid", e.RowIndex); dgridOpenOrders.Rows.Remove(dgridOpenOrders.Rows[e.RowIndex]); tradeLogic.CancellMyOrder(new OpenOrder() { openUuid = orderid }, CancellOrder_UIResultHandler); UpdateMyOpenOrders(); } }
public void buttonCancellAllOrders_UIResultHandler(RequestItemGroup resultResponse) { if (Helper.IsResultHasErrors(resultResponse)) { return; } List <OpenOrder> myOpenOrders = (List <OpenOrder>)resultResponse.items[0].result.resultData; foreach (OpenOrder order in myOpenOrders) { tradeLogic.CancellMyOrder(order, CancellOrder_UIResultHandler); break; } }