Exemple #1
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));
        }
        private void LoadFilters()
        {
            var materialNatures = FiltersHelper.GetWarehouseItemNaturesList();

            ViewData["MaterialNatureValues"] = new SelectList(materialNatures, "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");

            var dbClientProfiles = _context.ClientProfiles.OrderBy(p => p.Name).AsNoTracking();
            List <SelectListItem> clientProfilesList = new List <SelectListItem>();

            clientProfilesList.Add(new SelectListItem()
            {
                Value = 0.ToString(), Text = "{All Profiles}"
            });
            foreach (var clientProfile in dbClientProfiles)
            {
                clientProfilesList.Add(new SelectListItem()
                {
                    Value = clientProfile.Id.ToString(), Text = clientProfile.Name
                });
            }
            ViewData["ClientProfileFilter"] = new SelectList(clientProfilesList, "Value", "Text");

            var dbCashRegCategories = _context.CashRegCategories.OrderBy(p => p.Name).AsNoTracking();
            List <SelectListItem> cashRegRegCateroryList = new List <SelectListItem>();

            cashRegRegCateroryList.Add(new SelectListItem()
            {
                Value = 0.ToString(), Text = "{All Categories}"
            });
            foreach (var cashRegCategory in dbCashRegCategories)
            {
                cashRegRegCateroryList.Add(new SelectListItem()
                {
                    Value = cashRegCategory.Id.ToString(), Text = cashRegCategory.Name
                });
            }
            ViewData["CashRegCategoryFilter"] = new SelectList(cashRegRegCateroryList, "Value", "Text");
        }
Exemple #3
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;
        }
        private void LoadFilters()
        {
            var materialNatures = FiltersHelper.GetWarehouseItemNaturesList();

            ViewData["MaterialNatureValues"] = new SelectList(materialNatures, "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 });
            //}
            var companiesList = FiltersHelper.GetCompaniesFilterList(_context);

            ViewData["CompanyFilter"] = new SelectList(companiesList, "Value", "Text");
        }
        private void LoadFilters()
        {
            var materialNatures = FiltersHelper.GetWarehouseItemNaturesList();

            //List<SelectListItem> materialNatures = new List<SelectListItem>
            //{
            //    new SelectListItem() {Value = "0", Text = "{All Natures}"},
            //    new SelectListItem() {Value = WarehouseItemNatureEnum.WarehouseItemNatureMaterial.ToString(), Text = "Υλικό"},
            //    new SelectListItem() {Value = WarehouseItemNatureEnum.WarehouseItemNatureService.ToString(), Text = "Υπηρεσία"},
            //    new SelectListItem() {Value = WarehouseItemNatureEnum.WarehouseItemNatureExpense.ToString(), Text = "Δαπάνη"},
            //    new SelectListItem() {Value = WarehouseItemNatureEnum.WarehouseItemNatureFixedAsset.ToString(), Text = "Πάγιο"}


            //};

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

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