// GET: BudgetItems public ActionResult Index() { var houseId = householdHelper.GetMyHouse().Id; var budgets = db.Households.Where(h => h.Id == houseId).SelectMany(b => b.Budgets); var budgetItems = budgets.SelectMany(b => b.BudgetItems).ToList(); return(View(budgetItems.ToList())); }
// GET: Budgets public ActionResult Index() { var houseId = householdHelper.GetMyHouse().Id; var budgets = db.Budgets.Where(i => i.HouseholdId == houseId); return(View(budgets.ToList())); }
public ActionResult Index() { var houseId = householdHelper.GetMyHouse().Id; var invitations = db.Invitations.Where(i => i.HouseholdId == houseId); return(View(invitations.ToList())); }
// GET: Transactions/Create public ActionResult Create() { var houseId = householdHelper.GetMyHouse().Id; var budgets = db.Households.Where(h => h.Id == houseId).SelectMany(b => b.Budgets); var budgetItems = budgets.SelectMany(b => b.BudgetItems).ToList(); var bankAccounts = householdHelper.ListMyBanks(); ViewBag.BankAccountId = new SelectList(bankAccounts, "Id", "Name"); ViewBag.BudgetItemId = new SelectList(budgetItems, "Id", "Name"); return(View()); }
public JsonResult BarChartData() { var userId = User.Identity.GetUserId(); var household = householdHelper.GetMyHouse(); var bankAccounts = household.BankAccounts.Where(b => b.OwnerId == userId).ToList(); var myData = new StackedChart { Labels = bankAccounts.Select(b => b.Name).ToList(), BarLabel1 = "SB", BarLabel2 = "CB", BarLabel3 = "LBT", BGColor1 = "#11F136", BGColor2 = "#EFEB76", BGColor3 = "#F13811", Data1 = bankAccounts.Select(b => b.StartingBalance).ToList(), Data2 = bankAccounts.Select(b => b.CurrentBalance).ToList(), Data3 = bankAccounts.Select(b => b.LowBalanceThreshold).ToList() }; return(Json(myData)); }