public virtual ActionResult Index() { var budgets = ProjectionManager.GetBudgetsList().GetBudgetsUserCanView(GetCurrentUserId()); var model = new BudgetListViewModel(budgets); return(View(model)); }
public virtual ActionResult Edit(string budgetId, string lineId) { var categories = ProjectionManager.GetCategories().GetBudgetsCategories(new Domain.Budgets.BudgetId(budgetId)); var budget = ProjectionManager.GetBudgetsList().GetBudgetById(new Domain.Budgets.BudgetId(budgetId)); var model = new EditBudgetLineViewModel(budget.Name, budget.Id, budget.CurrencyISOCode, ProjectionManager.GetStreamEvents(lineId), categories, budget.GetDistributionKeys(), Currencies.GetAll()); return(View(model)); }
EditBudgetLineViewModel Prepare_EditBudgetLineViewModel(string id) { var categories = ProjectionManager.GetCategories().GetBudgetsCategories(new Domain.Budgets.BudgetId(id)); var budget = ProjectionManager.GetBudgetsList().GetBudgetById(new Domain.Budgets.BudgetId(id)); var model = new EditBudgetLineViewModel(budget.Name, id, budget.CurrencyISOCode, categories, budget.GetDistributionKeys(), Currencies.GetAll()); return(model); }
public virtual ActionResult Create(string budgetId, string returnUrl) { var budget = ProjectionManager.GetBudgetsList().GetBudgetById(new MyBudget.Domain.Budgets.BudgetId(budgetId)); var model = new DistributionKeyViewModel { BudgetId = budgetId, BudgetName = budget.Name, Name = "New DistributionKey", ReturnUrl = returnUrl, }; return(View(model)); }
public virtual ActionResult Create(string budgetId) { var budget = ProjectionManager.GetBudgetsList().GetBudgetById(new MyBudget.Domain.Budgets.BudgetId(budgetId)); var model = new CategoryViewModel { BudgetId = budgetId, BudgetName = budget.Name, Id = "Category-" + Guid.NewGuid().ToString(), Name = "New Category", Description = "Description", }; return(View(model)); }
public virtual ActionResult Details(string id) { var budgetId = new BudgetId(id); var budget = ProjectionManager.GetBudgetsList().GetBudgetById(budgetId); var categories = ProjectionManager.GetCategories().GetBudgetsCategories(budgetId); var model = new BudgetDetailsViewModel { Budget = budget, Categories = categories, DistributionKeys = budget.GetDistributionKeys(), }; return(View(model)); }
public virtual ActionResult Edit(string budgetId, string categoryId) { var bid = new Domain.Budgets.BudgetId(budgetId); var category = ProjectionManager.GetCategories().GetBudgetsCategories(bid) .Single(r => r.Id == categoryId); var budget = ProjectionManager.GetBudgetsList().GetBudgetById(bid); var model = new CategoryViewModel { Id = categoryId, BudgetId = budgetId, BudgetName = budget.Name, Description = category.Description, Name = category.Name, }; return(View(model)); }
public BudgetChooserResult ChooseBudget(string reason = "") { var tu = _pm.GetUsersList().AllUsers(); tu.Wait(); var userId = ChooseUserId(tu.Result); var budgets = _pm.GetBudgetsList().GetBudgetsUserCanView(new MyBudget.Domain.Users.UserId(userId)); var budgetId = ChooseBudgetId(budgets, reason); return(new BudgetChooserResult { UserId = userId, BudgetId = budgetId, }); }