Exemplo n.º 1
0
        private void LoadFilters()
        {
            var datePeriods = DateFilter.GetDateFiltersSelectList();

            // var datePeriodsJs = DateFilter.GetDateFiltersSelectList();

            ViewData["DataFilterValues"] = new SelectList(datePeriods, "Value", "Text");
            var pageFilterSize = PageFilter.GetPageSizeFiltersSelectList();

            ViewData["PageFilterSize"] = new SelectList(pageFilterSize, "Value", "Text");

            var dbCompanies = _context.Companies.OrderBy(p => p.Code).AsNoTracking();
            List <SelectListItem> companiesList = new List <SelectListItem>();

            companiesList.Add(new SelectListItem()
            {
                Value = 0.ToString(), Text = "{All Companies}"
            });
            foreach (var company in dbCompanies)
            {
                companiesList.Add(new SelectListItem()
                {
                    Value = company.Id.ToString(), Text = company.Code
                });
            }
            ViewData["CompanyFilter"] = new SelectList(companiesList, "Value", "Text");
        }
Exemplo n.º 2
0
        public async Task <IViewComponentResult> InvokeAsync(IndexFiltersToShow filtersToShow)
        {
            var indexFiltersResult = new IndexFilterResult();

            if (filtersToShow.ShowCompaniesFlt)
            {
                indexFiltersResult.CompanyFilterValues = await FiltersHelper.GetCompaniesFilterListAsync(_context);
            }
            if (filtersToShow.ShowCurrencyFlt)
            {
                indexFiltersResult.CurrencyFilterValues = await FiltersHelper.GetCurrenciesFilterListAsync(_context);
            }
            if (filtersToShow.ShowDateFlt)
            {
                indexFiltersResult.DateFilterValues = DateFilter.GetDateFiltersSelectList();
            }
            if (filtersToShow.ShowPageSizeFlt)
            {
                indexFiltersResult.PageSizeFilterValues = FiltersHelper.GetPageSizeFiltersSelectList();
            }
            if (filtersToShow.ShowMaterialNatureFlt)
            {
                indexFiltersResult.MaterialNaturesFilterValues = FiltersHelper.GetWarehouseItemNaturesList();
            }
            if (filtersToShow.ShowTransactorTypeFlt)
            {
                indexFiltersResult.TransactorTypeFilterValues = await FiltersHelper.GetTransactorTypeFilterListAsync(_context);
            }

            indexFiltersResult.FiltersToShow = filtersToShow;
            return(View(indexFiltersResult));
        }
Exemplo n.º 3
0
        private void LoadFilters()
        {
            var currencyListJs = _context.Currencies.OrderBy(p => p.Name).AsNoTracking().ToList();

            ViewData["CurrencyListJs"] = currencyListJs;

            var companiesListJs = FiltersHelper.GetCompaniesFilterList(_context);

            ViewData["CompanyListJs"] = companiesListJs;

            var datePeriodListJs = DateFilter.GetDateFiltersSelectList();

            ViewData["DatePeriodListJs"] = datePeriodListJs;
        }
Exemplo n.º 4
0
        private void LoadFilters()
        {
            var datePeriods = DateFilter.GetDateFiltersSelectList();

            ViewData["DataFilterValues"] = new SelectList(datePeriods, "Value", "Text");
            var pageFilterSize = PageFilter.GetPageSizeFiltersSelectList();

            ViewData["PageFilterSize"] = new SelectList(pageFilterSize, "Value", "Text");
            var companiesList = FiltersHelper.GetCompaniesFilterList(_context);

            ViewData["CompanyFilter"]    = new SelectList(companiesList, "Value", "Text");
            ViewData["CurrencySelector"] = new SelectList(FiltersHelper.GetCurrenciesFilterList(_context), "Value", "Text");
            var currencyListJs = _context.Currencies.OrderBy(p => p.Id).AsNoTracking().ToList();

            ViewData["CurrencyListJs"] = currencyListJs;
        }