public frmEditOrder(frmEditOrder.OrderEditRecord recordData) { this.InitializeComponent(); this._record = recordData; this.SetResize(); }
private void ShowEditForm() { if (base.InvokeRequired) { base.Invoke(new MethodInvoker(this.ShowEditForm)); } else { try { RecordItem recordItem = this.intzaOrderList.Records(this.intzaOrderList.FocusItemIndex); string text = recordItem.Fields("status").Text.ToString(); long num = 0L; long.TryParse(recordItem.Fields("matched").Text.ToString().Replace(",", ""), out num); if (text == "O" || text == "OC" || text == "OA" || text == "OAC" || text == "M" || text == "MA" || text == "MC" || text == "MAC" || (ApplicationInfo.SupportFreewill && (text == "PO" || text == "POC")) || text.IndexOf("(O)") > 0 || text.IndexOf("(OC)") > 0 || text.IndexOf("(OA)") > 0 || text.IndexOf("(OAC)") > 0 || text.IndexOf("(M)") > 0 || text.IndexOf("(MA)") > 0 || text.IndexOf("(MC)") > 0 || text.IndexOf("(MAC)") > 0 || num > 0L) { if (this._editOrderBox != null) { if (!this._editOrderBox.IsDisposed) { this._editOrderBox.Dispose(); } this._editOrderBox = null; } if (ApplicationInfo.SupportFreewill) { if (recordItem.Fields("offline").Text.ToString() == "Y") { this.ShowMessageInFormConfirm("AfterClose order cannot edit order.", frmOrderFormConfirm.OpenStyle.ShowBox); return; } } frmEditOrder.OrderEditRecord recordData; recordData.OrderNumber = Convert.ToInt64(recordItem.Fields("order_number").Text.ToString()); recordData.Side = recordItem.Fields("side").Text.ToString(); recordData.Stock = recordItem.Fields("stock").Text.ToString(); int trusteeID = 0; int.TryParse(recordItem.Fields("ttf").Text.ToString(), out trusteeID); recordData.TrusteeID = trusteeID; long.TryParse(recordItem.Fields("volume").Text.ToString().Replace(",", ""), out recordData.Volume); long.TryParse(recordItem.Fields("matched").Text.ToString().Replace(",", ""), out recordData.MatVolume); recordData.Price = recordItem.Fields("price").Text.ToString(); recordData.EntryDate = recordItem.Fields("send_date").Text.ToString(); long.TryParse(recordItem.Fields("published").Text.ToString().Replace(",", ""), out recordData.PubVol); this._editOrderBox = new frmEditOrder(recordData); this._editOrderBox.TopLevel = false; this._editOrderBox.Parent = this; Rectangle position = this.intzaOrderList.GetPosition(this.intzaOrderList.FocusItemIndex, "order_number"); this._editOrderBox.Location = new Point(0, this.intzaOrderList.Top + position.Top + position.Height); this._editOrderBox.TopMost = true; this._editOrderBox.Show(); this._editOrderBox.BringToFront(); } else { this.ShowMessageInFormConfirm("Invalid order status.", frmOrderFormConfirm.OpenStyle.ShowBox); } } catch (Exception ex) { this.ShowError("ShowEditForm", ex); } } }