Пример #1
0
        protected override async Task OnInitializedAsync()
        {
            var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();

            var user = authState.User;

            CurrentUser = await UserManager.GetUserAsync(user);

            UserConfig = await ConfigService.GetUserConfigAsync(CurrentUser.Id);

            Expenses = await ExpenseService.GetAllExpensesAsync(CurrentUser.Id);

            People = await PersonService.GetPeopleAndSharedAsync(CurrentUser.Id);

            MonthlyIncome      = FinanceService.GetTotalMonthlyIncome(People);
            MonthlyExpenditure = FinanceService.GetTotalMonthlyExpenditure(Expenses);
            MonthlyNet         = MonthlyIncome - MonthlyExpenditure;


            if (MonthlyIncome <= MonthlyExpenditure)
            {
                SpendingWarning = true;
            }
        }