public FinancialSummary AddIncome(Income income) { decimal savingPercentage = income.Saving; decimal budgetPercentage = 100 - savingPercentage; income.Saving = (income.Amount * (savingPercentage / 100)); income.Budget = (income.Amount * (budgetPercentage / 100)); if (income.IsItRecurring == false) { income.Frequency = null; } _context.Incomes.Add(income); _context.SaveChanges(); FinancialSummary financialSummary = new FinancialSummary(); financialSummary.Date = income.Date; financialSummary.ProfileNo = income.ProfileNo; return(FinancialSummaryDetails.GetfinancialSummary(financialSummary, _context)); }
public List <Income> GetAllIncomes(int profileNo, FinancialSummary financialSummary) { financialSummary.ProfileNo = profileNo; return(FinancialSummaryDetails.GetAllIncomes(financialSummary, _context)); }
public FinancialSummary GetfinancialSummary(FinancialSummary financialSummary) { return(FinancialSummaryDetails.GetfinancialSummary(financialSummary, _context)); }