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)); } }
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()); }
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()); }