示例#1
0
        public Budget Save(Budget budget)
        {
            if (budget.BudgetType == (int)BudgetType.DateRange)
            {
                budget.StartDate = _view.StartDate;
                budget.EndDate = _view.EndDate;
            }

            if (budget.ID != Guid.Empty)
            {
                budget = UpdateBudget(budget);
            }
            else
            {
                budget = InsertBudget(budget);
            }

            return budget;
        }
示例#2
0
 private Budget UpdateBudget(Budget budget)
 {
     budget.IsActive = _view.IsActive;
     return _budgetService.Update(budget);
 }
示例#3
0
 private Budget InsertBudget(Budget budget)
 {
     var insertedBudget = _budgetService.Insert(budget);
     _view.BudgetId = insertedBudget.ID;
     return insertedBudget;
 }