示例#1
0
 public ActionResult ReCordViewers(string livePageID, string numberOfViewers)
 {
     try
     {
         int           liveID        = LivePostService.Select(livePageID);
         ViewerService viewerService = new ViewerService();
         viewerService.Create(liveID, numberOfViewers);
         return(Json("OK", JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         return(Json("error:" + e, JsonRequestBehavior.AllowGet));
     }
 }
示例#2
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());
        }
示例#3
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());
        }