Esempio n. 1
0
 public ActionResult AdminShopList()
 {
     ShopDto[] shops = _shopRepositoryClient.GetAllShops();
     if (shops == null)
     {
         return(View(Enumerable.Empty <ShopViewModel>()));
     }
     return(View("AdminShopList", shops.Select(s => s.Map())));
 }
 public ActionResult Shops()
 {
     ShopDto[] shops = _shopRepository.GetAllShops();
     if (shops.IsNullOrEmpty())
     {
         return(View(Enumerable.Empty <ShopViewModel>()));
     }
     return(View(shops.Select(shop => shop.Map())));
 }
        public ActionResult AssignShop(Guid userGuid)
        {
            ShopDto[] allShops = _shopRepository.GetAllShops();
            if (allShops.IsNullOrEmpty())
            {
                return(View(Enumerable.Empty <ShopUserViewModel>()));
            }
            ShopDto[] shopsAssignedToUser = _shopRepository.GetShopsAssignedToUser(userGuid);

            return(View(allShops.Select(s => new ShopUserViewModel
            {
                IsShopAssigned = shopsAssignedToUser.Contains(s),
                ShopGuid = s.ShopGuid,
                ShopName = s.Name,
                UserIdentity = userGuid
            })));
        }