示例#1
0
        public async Task OnGetAsync(string day, int?flowId = null)
        {
            await PrepareModelsAsync();

            if (day.IsNullOrEmpty())
            {
                Filter = ReportTableFilter.CurrentDay();
            }
            else
            {
                Filter = new ReportTableFilter(day, day, flowId)
                {
                    Flow = await _expenseFlowQueries.GetNameById(flowId)
                };
                foreach (var error in Filter.Validate())
                {
                    ModelState.AddModelError(error.PropertyName, error.Message);
                }
            }
            if (ModelState.IsValid)
            {
                Expenses = await LoadExpensesAsync();
            }
            else
            {
                IsDataValid = false;
            }
        }
示例#2
0
        public async Task OnGetAsync(string dateFrom, string dateTo, int pageNumber = 1)
        {
            BalanceState = await _inventorizationQueries.GetBalanceState();

            if (string.IsNullOrEmpty(dateFrom) || string.IsNullOrEmpty(dateTo))
            {
                Filter = ReportTableFilter.CurrentYear();
            }
            else
            {
                Filter = new ReportTableFilter(dateFrom, dateTo);
                foreach (var error in Filter.Validate())
                {
                    ModelState.AddModelError(error.PropertyName, error.Message);
                }
            }
            if (ModelState.IsValid)
            {
                Incomes = await LoadIncomesAsync(pageNumber);
            }
            else
            {
                IsDataValid = false;
            }
        }
示例#3
0
        public async Task OnGetAsync(string dateFrom, string dateTo, int pageNumber = 1)
        {
            await PrepareModelsAsync();

            if (string.IsNullOrEmpty(dateFrom) || string.IsNullOrEmpty(dateTo))
            {
                Filter = ReportTableFilter.CurrentMonth();
            }
            else
            {
                Filter = new ReportTableFilter(dateFrom, dateTo);
                foreach (var error in Filter.Validate())
                {
                    ModelState.AddModelError(error.PropertyName, error.Message);
                }
            }
            if (ModelState.IsValid)
            {
                Expenses = await LoadExpensesAsync(pageNumber);
            }
            else
            {
                IsDataValid = false;
            }
        }