Exemplo n.º 1
0
        public IActionResult LinkShopWarehouse()

        {
            if (HttpContext.Session.GetString("Id") == null)
            {
                HttpContext.Session.Clear();
                return(RedirectToAction("Index", "Account"));
            }



            Gettablewarehouse get = new Gettablewarehouse(_context);

            IEnumerable <tableshopwarehouse> bussinessEntitiesList = get.gettable();
            int       type = 2;//for warehouse
            GetEntity ga   = new GetEntity(_context);
            IEnumerable <BusinessEntity> warehouses = ga.getBussinessEntities(type);

            ViewData["warehousfree"] = warehouses;
            type = 1;
            IEnumerable <BusinessEntity> shops = ga.getBussinessEntities(type);
            IEnumerable <BusinessEntity> shopsnotassociated = ga.getnotassociatedshops();

            ViewData["shopsfree"] = shopsnotassociated;
            ViewData["table"]     = bussinessEntitiesList;

            return(View());
        }