Пример #1
0
        // GET: BudgetSummaryNavBar
        public ActionResult BudgetSummary()
        {
            BudgetModel    model   = new BudgetModel();
            SessionManager session = new SessionManager();

            model.CurrentBudget = model.GetBudgetById(session.Get <Budget>(PageConstant.BUDGET_ID_IN_SESSION).Id).CurrentBudget;
            return(View(model));
        }
Пример #2
0
        public ActionResult Load(string[] selected)
        {
            SessionManager session = new SessionManager();
            BudgetModel    bmodel  = new BudgetModel();
            Budget         budget  = bmodel.GetBudgetById(int.Parse(selected.First()));

            session.Replace <Budget>(budget, PageConstant.BUDGET_ID_IN_SESSION);
            bmodel.StartBudget   = budget.StartBudget;
            bmodel.CurrentBudget = budget.CurrentBudget;
            return(View("MainPanel", bmodel));
        }
Пример #3
0
        public ActionResult Update(BudgetModel model)
        {
            SessionManager session = new SessionManager();
            Budget         budget  = model.GetBudgetById(session.Get <Budget>(PageConstant.BUDGET_ID_IN_SESSION).Id);

            model.StartBudget    = budget.StartBudget + model.AddedBudget;
            model.CurrentBudget  = budget.CurrentBudget + model.AddedBudget;
            budget.StartBudget   = model.StartBudget;
            budget.CurrentBudget = model.CurrentBudget;
            model.UpdateBudget(budget);
            return(View("MainPanel", model));
        }
Пример #4
0
        // GET: Budget
        public ActionResult Index()
        {
            BudgetModel    model   = new BudgetModel();
            SessionManager session = new SessionManager();
            Budget         budget  = model.GetBudgetById(session.Get <Budget>(PageConstant.BUDGET_ID_IN_SESSION).Id);

            model.CurrentBudget = budget.CurrentBudget;
            model.EndDate       = budget.EndDate;
            model.StartDate     = budget.StartDate;
            model.StartBudget   = budget.StartBudget;
            return(View(model));
        }