public ActionResult Search(SearchViewModel TheSearch, Int32 StockAccountID) { // get the stock account StockAccount CustomerStockAccount = db.StockAccount.Find(StockAccountID); // make a list to hold the transactions List <BankingTransaction> StockTransaction = SearchTransactions.Search(db, TheSearch, 4, StockAccountID); // Get the customer var CustomerQuery = from u in db.Users where u.UserName == User.Identity.Name select u; AppUser Customer = CustomerQuery.FirstOrDefault(); // Get all of the trades for the customer var TradesQuery = from t in db.Trades where t.StockAccount.StockAccountID == CustomerStockAccount.StockAccountID select t; List <Trade> Trades = TradesQuery.ToList(); // add the stuff to view bag ViewBag.Trades = Trades; ViewBag.Customer = Customer; ViewBag.Transactions = StockTransaction; ViewBag.Ranges = SearchTransactions.AmountRange(); ViewBag.Dates = SearchTransactions.DateRanges(); ViewBag.ResultsCount = StockTransaction.Count; return(View("Details", CustomerStockAccount)); }
public ActionResult Search(SearchViewModel TheSearch, Int32 CheckingID) { Checking checking = db.CheckingAccount.Find(CheckingID); List <BankingTransaction> Transactions = SearchTransactions.Search(db, TheSearch, 1, CheckingID); // Add the list to the view bag ViewBag.CheckingTransactions = Transactions; ViewBag.Ranges = SearchTransactions.AmountRange(); ViewBag.Dates = SearchTransactions.DateRanges(); ViewBag.ResultsCount = Transactions.Count; return(View("Details", checking)); }
public ActionResult Search(SearchViewModel TheSearch, Int32 SavingID) { Saving saving = db.SavingsAccount.Find(SavingID); List <BankingTransaction> Transactions = SearchTransactions.Search(db, TheSearch, 2, SavingID); // Add the list to the view bag ViewBag.SavingsTransactions = Transactions; ViewBag.Ranges = SearchTransactions.AmountRange(); ViewBag.Dates = SearchTransactions.DateRanges(); ViewBag.ResultsCount = Transactions.Count; return(View("Details", saving)); }
public ActionResult Search(SearchViewModel TheSearch, Int32 IRAID) { // get the ira IRA ira = db.IRAAccount.Find(IRAID); List <BankingTransaction> IraTransactions = SearchTransactions.Search(db, TheSearch, 3, IRAID); ViewBag.IraTransactions = IraTransactions; ViewBag.Ranges = SearchTransactions.AmountRange(); ViewBag.Dates = SearchTransactions.DateRanges(); ViewBag.ResultsCount = IraTransactions.Count; return(View("Details", ira)); }