Exemplo n.º 1
0
        private void btnFilter_Click(object sender, EventArgs e)
        {
            helper.SetAllColumns();

            ReturnViewParam     rlp = new ReturnViewParam();
            AllocationViewParam rp  = new AllocationViewParam();

            if (!string.IsNullOrEmpty(txtCtpy.Text))
            {
                rlp.CtpyCode.AddParamValue(txtCtpy.Text);
                rp.CtpyCode.AddParamValue(txtCtpy.Text);
            }

            if (!string.IsNullOrEmpty(txtSymbol.Text))
            {
                rlp.Ticker.AddParamValue(txtSymbol.Text);
                rp.Ticker.AddParamValue(txtSymbol.Text);
            }

            //Alan Dias
            if (!string.IsNullOrEmpty(txtTradeCategory.Text))
            {
                rlp.TradeCategory.AddParamValue(txtTradeCategory.Text);
                rp.TradeCategory.AddParamValue(txtTradeCategory.Text);
            }



            rf.Load(Returns, rlp);
            af.Load(Allocations, rp);

            lblReturns.Text     = "Returns: " + Returns.Count.ToString();
            lblAllocations.Text = "Allocations: " + Allocations.Count.ToString();
        }
        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)
        {
            helper.SetAllColumns();

            ReturnViewParam     rlp = new ReturnViewParam();
            AllocationViewParam rp  = new AllocationViewParam();

            rlp.Cusip.AddParamValue(e.Cusip);
            rp.Cusip.AddParamValue(e.Cusip);

            rf.Load(Returns, rlp);
            af.Load(Allocations, rp);

            this.Text = "Returns " + e.Cusip;
        }