Esempio n. 1
0
        public async static Task <List <Shippers> > GetShippers(IConfiguration _configuration)
        {
            ServiceShippers serviceShippers = new ServiceShippers(_configuration);

            List <Shippers> shippersList = await serviceShippers.GetShippers();

            shippersList.Insert(0, new Shippers {
                CompanyName = ""
            });
            return(shippersList);
        }
Esempio n. 2
0
        // GET: Shippers
        public async Task <IActionResult> Index(int page = 1, int itemsPerPage = 10)
        {
            DistributionPerPage distributionPerPage = new DistributionPerPage();

            distributionPerPage.recordCount = await _serviceShippers.GetCount();

            distributionPerPage.itemsPerPage = itemsPerPage;
            distributionPerPage.page         = page;

            distributionPerPage.CalculateDistribution();

            ViewData["PagesCount"]     = int.Parse(distributionPerPage.pageCount.ToString());
            ViewData["page"]           = distributionPerPage.page;
            ViewData["PageStart"]      = distributionPerPage.PageStart;
            ViewData["PagingItems"]    = distributionPerPage.itemsPerPage;
            ViewData["ControllerName"] = "Shippers";

            var _results = await _serviceShippers.GetShippers(page, itemsPerPage);

            return(View(_results));
        }