Ejemplo n.º 1
0
        private List <string> getShopNamesForCurrUser()
        {
            Owner currUserOwner = OwnerBiz.GetPlayerFor(UserId);

            currUserOwner.IsNullThrowException("You must be authourized to sell to continue");

            List <Product> shops     = ProductBiz.FindAll().Where(x => x.OwnerId == currUserOwner.Id).ToList();
            List <string>  shopNames = new List <string>();

            if (shops.IsNullOrEmpty())
            {
            }
            else
            {
                foreach (Product shop in shops)
                {
                    string name = string.Format("{0} NO Path. This will not show. Expires: {1}, Is Expired? {2}",
                                                shop.FullName(),
                                                shop.ShopExpiryDate.Date_NotNull_Min.ToLongDateString(),
                                                shop.IsShopExpired ? "Yes" : "No");

                    MenuPathMain mpm = shop.MenuPathMains.FirstOrDefault();

                    if (mpm.IsNull())
                    {
                    }
                    else
                    {
                        name = string.Format("{0} - {1} - {2} - {3} expires: {4}, Is Expired? {5}",
                                             mpm.MenuPath1.FullName(),
                                             mpm.MenuPath2.FullName(),
                                             mpm.MenuPath3.FullName(),
                                             shop.FullName(),
                                             shop.ShopExpiryDate.Date_NotNull_Min.ToLongDateString(),
                                             shop.IsShopExpired ? "Yes" : "No");
                    }


                    shopNames.Add(name);
                }
            }
            return(shopNames);
        }
Ejemplo n.º 2
0
        private List <Product> get_Live_Shops()
        {
            //get all live shops
            //if product has an owner it is a shop.
            List <Product> shopList_All = ProductBiz.FindAll()
                                          .Where(x => x.OwnerId != null || x.OwnerId.Trim() != "")
                                          .ToList();

            List <Product> shopList_Live = new List <Product>();

            foreach (Product shop in shopList_All)
            {
                if (shop.IsShopExpired)
                {
                    continue;
                }
                shopList_Live.Add(shop);
            }
            return(shopList_Live);
        }