Exemple #1
0
        public ActionResult Save(FirstLaunchModel model)
        {
            BudgetModel    budgetModel    = new BudgetModel();
            SettingsModel  settingModel   = new SettingsModel();
            SessionManager sessionManager = new SessionManager();
            int            userid         = sessionManager.Get <User>(PageConstant.USER_ID_I_SESSION).Id;

            budgetModel        = model.Budget;
            settingModel       = model.Settings;
            budgetModel.UserId = settingModel.UserId = userid;
            budgetModel.AddBudget(budgetModel);
            settingModel.AddSettings(settingModel);

            Budget budget = budgetModel.GetCurrentBudget(userid);

            sessionManager.Add <Budget>(budget, PageConstant.BUDGET_ID_IN_SESSION);
            budgetModel.CurrentBudget = budget.CurrentBudget;
            budgetModel.StartBudget   = budget.StartBudget;

            return(View("MainPanel", budgetModel));
        }