void ModifyOrder() { if (dataGridViewOrders.SelectedRows.Count == 1) { try { DataGridViewRow row = dataGridViewOrders.SelectedRows[0]; if (null == row.Cells[columnClientOrderID.Index].Value) { return; } Order order = (Order)row.Tag; using (NewOrderForm form = new NewOrderForm(tradingManager, this, order, eventView)) { if (DialogResult.OK == form.ShowDialog()) { tradingManager.ModifyOrder(order); } } } catch (Exception ex) { eventView.LogError("Cannot Modify Order: " + ex.Message); Trace.TraceError("Cannot Modify Order: " + ex.Message); MessageBox.Show(this, ex.Message, "Cannot Modify Order", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
void NewOrder() { NewOrderForm form = new NewOrderForm(tradingManager, this, eventView); form.Show(this); form.Focus(); }