// GET: InvestmentAccounts
        public ActionResult Index()
        {
            var currentTradeDate = tradeDateRepository.GetLatestTradeDate();

            var accounts = this.accountRepository.LoadInvestmentAccounts(currentTradeDate).ToList();

            return(View(accounts));
        }
Exemplo n.º 2
0
 public Result <List <SecurityPrice> > GetSecurityPrices(DateTime?date)
 {
     if (date.HasValue)
     {
         // Use the provided date - it will be looked up to make sure it is a valid trade date
         return(this.GetSecurityPrices(date.Value));
     }
     else
     {
         var tradeDate = _tradeDateRepository.GetLatestTradeDate();
         return(tradeDate.Eval <Result <List <SecurityPrice> > >(
                    d => this.GetSecurityPrices(d),
                    () => Result.Failure <List <SecurityPrice> >(new MissingDataError("No trade dates are loaded into the system"))));
     }
 }
Exemplo n.º 3
0
        public Result <TradeDate> GetLatestTradeDate()
        {
            var tradeDate = _tradeDateRepository.GetLatestTradeDate();

            return(tradeDate.Eval <Result <TradeDate> >(
                       d => Result.Success <TradeDate>(d),
                       () => Result.Failure <TradeDate>(new ApplicationError("Unable to get latest trade date.  Validate trade dates are loaded into the system"))));
        }