public IActionResult AccountShop(string ID_Shop)
        {
            if (!HttpContext.User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Account"));
            }


            if (!CheckAdmin())
            {
                return(RedirectToAction("index", "Home"));
            }

            List <City>              cities        = City.GetCities();
            Shop                     shop          = Shop.GetItemAdmin(ID_Shop);
            List <Metro>             metros        = Metro.GetCities(shop.City.ID_City);
            List <TimeWayMetroClass> timeWayMetros = TimeWayMetroClass.GetTimewayMetro();

            List <IMG_Shop> imgsShop = IMG_Shop.GetShopIMGs(ID_Shop);

            // предустановка комбо боксов, в первом списке будут текущие значения
            cities.Insert(0, shop.City);
            timeWayMetros.Insert(0, new TimeWayMetroClass()
            {
                minutes = shop.TimeWayMetro, Comment = shop.TimeWayMetro.ToString()
            });
            if (shop.Metro != null)
            {
                metros.Insert(0, shop.Metro);
            }

            AccountShopVM accountShop = new AccountShopVM()
            {
                Shop          = shop,
                Citys         = cities,
                Metros        = metros,
                timeWayMetros = timeWayMetros,
                iMG_Shops     = imgsShop
            };


            return(View(accountShop));
        }
예제 #2
0
 public ImgsShopVM(string ID_SHOP)
 {
     iMG_Shops    = IMG_Shop.GetShopIMGs(ID_SHOP);
     this.ID_SHOP = ID_SHOP;
 }