Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public List <Income> GetAllIncomes(int profileNo, FinancialSummary financialSummary)
 {
     financialSummary.ProfileNo = profileNo;
     return(FinancialSummaryDetails.GetAllIncomes(financialSummary, _context));
 }
Exemplo n.º 3
0
 public FinancialSummary GetfinancialSummary(FinancialSummary financialSummary)
 {
     return(FinancialSummaryDetails.GetfinancialSummary(financialSummary, _context));
 }