Ejemplo n.º 1
0
        public AddTradeView(InvestmentDataModel dataModel, IMarketDataSource marketDataSource, TradeDetails trade)
        {
            _marketDataSource = marketDataSource;
            _dataModel        = dataModel;
            InitializeComponent();

            _displayContext = SynchronizationContext.Current;

            //populate investment names combo
            cmboName.Items.AddRange(_dataModel.GetAllCompanies().ToArray());

            if (trade != null)
            {
                this.Text = "Edit Trade";
                dteTransactionDate.Value = DateTime.Now;
                cmboName.SelectedText    = trade.Name;
                cmboName.Text            = trade.Name;
                nmrcNumber.Value         = (decimal)trade.Quantity;
                nmrcScaling.Value        = (decimal)trade.ScalingFactor;
                txtSymbol.Text           = trade.Symbol;
                txtExchange.Text         = trade.Exchange;
                txtCcy.Text       = trade.Currency;
                txtTotalCost.Text = trade.TotalCost.ToString();
                cmboType.Items.AddRange(Enum.GetNames(typeof(TradeType)));
                cmboType.SelectedItem = trade.Action;
            }
            else
            {
                cmboType.Items.AddRange(Enum.GetNames(typeof(TradeType)));
            }
            btnCheck.Enabled = _marketDataSource != null;
        }
Ejemplo n.º 2
0
 public CashAccountView(InvestmentDataModel dataModel)
 {
     logger.Info("creating cash account view");
     InitializeComponent();
     SetupGrid();
     _dataModel = dataModel;
     SetupDatasource(cashAccountBindingSource);
     cashAccountGrid.DataSource = cashAccountBindingSource;
     _bInitialised = true;
 }
Ejemplo n.º 3
0
        public AddRedemptionView(InvestmentDataModel dataModel)
        {
            InitializeComponent();

            cmboUsers.Items.AddRange(dataModel.GetParametersForType("Subscription")
                                     .Cast <object>().ToArray());
            if (cmboUsers.Items.Count > 0)
            {
                cmboUsers.SelectedIndex = 0;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public MainView(InvestmentDataModel dataModel, IConfigurationSettings settings, IMarketDataSource marketDataSource)
        {
            logger.Info("creating main view");
            InitializeComponent();
            _dataModel        = dataModel;
            _marketDataSource = marketDataSource;
            _views            = new List <IInvestmentBuilderView>();
            _settings         = settings;

            btnUndo.Enabled              = false;
            _dataModel.TradeUpdateEvent += (enabled) =>
            {
                btnUndo.Enabled = enabled;
                PopulateValuationDates();
                return(true);
            };

            _displayContext = SynchronizationContext.Current;
        }
 public AddTransactionView(InvestmentDataModel dataModel, string side)
 {
     _dataModel = dataModel;
     InitializeComponent();
     _side = side;
 }
Ejemplo n.º 6
0
 protected abstract string GetMnenomic(InvestmentDataModel dataModel);
Ejemplo n.º 7
0
 protected abstract double GetCashAccountDataImpl(InvestmentDataModel dataModel, DateTime dtValuationDate);