Exemplo n.º 1
0
        private void LoadFilters()
        {
            var pageFilterSize = PageFilter.GetPageSizeFiltersSelectList();

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

            var dbTransactorTypes = _context.TransactorTypes.OrderBy(p => p.Code).AsNoTracking();
            List <SelectListItem> transactorTypes = new List <SelectListItem>();

            transactorTypes.Add(new SelectListItem()
            {
                Value = 0.ToString(), Text = "{All Types}"
            });
            foreach (var dbTransactorType in dbTransactorTypes)
            {
                transactorTypes.Add(new SelectListItem()
                {
                    Value = dbTransactorType.Id.ToString(), Text = dbTransactorType.Code
                });
            }
            ViewData["TransactorTypeId"] = new SelectList(transactorTypes, "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;
        }
        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 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");

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

            ViewData["CurrencyListJs"] = currencyListJs;
        }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
0
        private void LoadFilters()
        {
            var materialNatures = FiltersHelper.GetWarehouseItemNaturesList();


            ViewData["MaterialNatureValues"] = new SelectList(materialNatures, "Value", "Text");

            var companiesList = FiltersHelper.GetCompaniesFilterList(_context);

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

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

            ViewData["CurrencyListJs"] = currencyListJs;
        }