Ejemplo n.º 1
0
        public static Dictionary <int, List <StoreProductEntity> > GetStoreProductRecommend(string storeIds, ProductType productType = ProductType.All)
        {
            Dictionary <int, List <StoreProductEntity> > result = new Dictionary <int, List <StoreProductEntity> >();

            if (string.IsNullOrEmpty(storeIds))
            {
                return(result);
            }
            if (storeIds.EndsWith(","))
            {
                storeIds = storeIds.Remove(storeIds.LastIndexOf(','));
            }
            List <StoreProductEntity> list            = new List <StoreProductEntity>();
            StoreProductDao           storeProductDao = new StoreProductDao();

            list = storeProductDao.GetProductRecommend(storeIds, productType);
            list.ForEach(delegate(StoreProductEntity t)
            {
                if (string.IsNullOrEmpty(t.ThumbnailUrl220))
                {
                    t.ThumbnailUrl220 = SettingsManager.GetMasterSettings().DefaultProductImage;
                }
                t.ThumbnailUrl220 = Globals.FullPath(t.ThumbnailUrl220);
            });
            if (list != null)
            {
                result = (from t in list
                          group t by t.StoreId).ToDictionary((IGrouping <int, StoreProductEntity> t) => t.Key, (IGrouping <int, StoreProductEntity> t) => t.ToList());
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static List <StoreProductEntity> GetStoreProductRecommend(int storeId)
        {
            List <StoreProductEntity> list            = new List <StoreProductEntity>();
            StoreProductDao           storeProductDao = new StoreProductDao();

            return(storeProductDao.GetProductRecommend(storeId));
        }