//ALANDIAS----------------------------------------------------------------------- private void cbPendingFilter_CheckedChanged(object sender, EventArgs e) { if (cbPendingFilter.Checked) { var Pendings = Display.Where(x => x.Status == DtcMessageStatusEnum.Pending).ToList(); var MadeAfterPendings = Display.Where(x => x.Status == DtcMessageStatusEnum.MadeAfterPend).ToList(); DisplayWOUnecessaryPendings.Load(Display); foreach (var P in Pendings) { foreach (var MAP in MadeAfterPendings) { if (P.Cusip == MAP.Cusip && P.CounterParty == MAP.CounterParty && P.ShareQuantity == MAP.ShareQuantity && P.DelivererAccountNum == MAP.DelivererAccountNum) { DisplayWOUnecessaryPendings.Remove(P); break; } } } dgvDeliveryOrders.DataSource = DisplayWOUnecessaryPendings; ColorRows(); DGVDel.SetColumns(); } else { dgvDeliveryOrders.DataSource = Display; ColorRows(); DGVDel.SetColumns(); } }
private void LoadHeldUp() { SortableBindingList <RealTimeOccPositionObject> tmp = new SortableBindingList <RealTimeOccPositionObject>(); AllocationViewFactory avf = new AllocationViewFactory(); List <AllocationViewObject> heldUpReturns = new List <AllocationViewObject>(); AllocationViewParam avp = new AllocationViewParam(); tmp.Load(AllRealTimePositions); HeldUpRealTimePositions.Clear(); avp.HeldUp.AddParamValue(1); avf.Load(heldUpReturns, avp); //now remove the non Held Up positions foreach (RealTimeOccPositionObject rt in tmp) { if (heldUpReturns.Exists(av => av.Cusip == rt.Cusip)) { HeldUpRealTimePositions.Add(rt); } } HeldUpRealTimePositions.Sort("TradeCategory", ListSortDirection.Ascending); }
void OnCusipSelected(object sender, CusipSelectEventArgs e) { IncomingDeliveryOrderParam p = new IncomingDeliveryOrderParam(); p.DateAndTimeStamp_Date.AddParamValue(DateTime.Today); p.Cusip.AddParamValue(e.Cusip); df.Load(Orders, p); //Remove records that are receives but 5239 is not the receiver, same for deliver Orders.RemoveAll(delegate(IncomingDeliveryOrderObject d) { return((d.Receiver != Settings.Account.Padded() && d.DelivererReceiverIndicator == "R") || (d.Deliverer != Settings.Account.Padded() && d.DelivererReceiverIndicator == "D")); }); Display.Load(Orders); Display.Sort("DateAndTimeStamp"); ColorRows(); this.Text = "DTC Activity " + e.Cusip; //ALANDIAS cbPendingFilter_CheckedChanged(null, null); //-------- }
private void CalculateExpected() { expected.Load(filtered5239); HedgeTradeViewParam htvp = new HedgeTradeViewParam(); htvp.Book.AddParamValue("FMAI"); htvf.Load(hedgeTrades, htvp); foreach (PositionSummaryObject ps in expected) { HedgeTradeViewObject h = hedgeTrades.Find(h1 => h1.Cusip == ps.Cusip); if (h != null) { if (h.BorrowLoan == "B") { ps.ExpectedBorrowQty = h.Quantity.Value; ps.ExpectedBorrowValue = h.LoanValue.Value; } if (h.BorrowLoan == "L") { ps.ExpectedLoanQty = h.Quantity.Value; ps.ExpectedLoanValue = h.LoanValue.Value; } } } }
public RecentDtcActivityForm(IList <IncomingDeliveryOrderObject> orders) { InitializeComponent(); Orders.Load(orders); Orders.Sort("DateAndTimeStamp", ListSortDirection.Descending); dgvDeliveryOrders.DataSource = Orders; helper.Add(new DgvHelper(dgvDeliveryOrders, this.Name, true)); helper.handleCellSelected += new CellSelectEventHandler(h_handleCellSelected); handleDtcMessageReceived = new IncomingDtcMessageEventHandler(Instance_handleDtcMessageReceived); DtcChannel.Instance.handleDtcMessageReceived += handleDtcMessageReceived; }
private void LoadHedged() { SortableBindingList <RealTimePositionObject> tmp = new SortableBindingList <RealTimePositionObject>(); tmp.Load(AllRealTimePositions); HedgedRealTimePositions.Clear(); //now remove the non Hedge foreach (RealTimePositionObject rt in tmp) { if (rt.ContainsHedge) { HedgedRealTimePositions.Add(rt); } } HedgedRealTimePositions.Sort("HedgedSortField", ListSortDirection.Descending); }
private void ServerForm_Load(object sender, EventArgs e) { chkAutoRefresh.Checked = Properties.Settings.Default.AutoRefresh; SetAutoRefresh(Properties.Settings.Default.AutoRefresh); try { //load the data from the table first AllRealTimePositions.Load(calc.RealTimePositions.Values.OrderByDescending(o => o.SortField)); ColorRows(); } catch (Exception ex) { Trace.WriteLine(ex, TraceEnum.LoggedError); MessageBox.Show("Error starting app: \r\n" + ex.ToString()); } foreach (DataGridViewColumn c in dgvRealTimePosition.Columns) { c.ReadOnly = true; } dgvRealTimePosition.Columns["Notes"].ReadOnly = false; }