示例#1
0
        // 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()));
        }
示例#2
0
        // 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()));
        }
示例#4
0
        // 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());
        }
示例#5
0
        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));
        }