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; }
private Budget UpdateBudget(Budget budget) { budget.IsActive = _view.IsActive; return _budgetService.Update(budget); }
private Budget InsertBudget(Budget budget) { var insertedBudget = _budgetService.Insert(budget); _view.BudgetId = insertedBudget.ID; return insertedBudget; }