Пример #1
0
        public ActionResult Index(string livePageID, string liveName, string keywordPattern)
        {
            //新增直播進資料庫
            LivePostService.CreateLivePost(livePageID, liveName);
            //新增商品進資料庫
            ProductRepositories product_repo = new ProductRepositories();
            var products = ProductService.GetCurrentProducts().ProductItems;

            foreach (var item in products)
            {
                if (!product_repo.SelectProduct(item.SkuId))
                {
                    product_repo.InsertProduct(item);
                }
            }
            ViewData["products"]       = products;
            ViewData["livePageID"]     = livePageID;
            ViewData["keywordPattern"] = keywordPattern;
            return(View());
        }
Пример #2
0
        public ActionResult Index(string livePageID, string liveName, string keywordPattern)
        {
            string userid = User.Identity.GetUserId();
            //string fanpageid = (string)Session["FanPageID"];
            int fanpageid = FanPageService.GetPageId(userid);

            //新增直播進資料庫
            LivePostService.CreateLivePost(livePageID, liveName, fanpageid);
            //新增商品進資料庫
            ProductRepositories product_repo = new ProductRepositories();
            var products = ProductService.GetCurrentProducts().ProductItems;

            foreach (var item in products)
            {
                if (!product_repo.SelectProduct(item.SkuId))
                {
                    product_repo.InsertProduct(item);
                }
            }
            ViewData["products"]       = products;
            ViewData["livePageID"]     = livePageID;
            ViewData["keywordPattern"] = keywordPattern;
            return(View());
        }