protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["idd"] == null) { MessageBox("请先登录后观看视频"); return; } UserAct userAct = new UserAct(); User user = userAct.GetByid(Request.QueryString["idd"]); if (user == null || user.LoginPassWord != Request.QueryString["pw"]) { MessageBox("请先登录后观看视频"); return; } string qq = Request.QueryString["idd"].ToString(); string password = Request.QueryString["pw"].ToString(); LimitAct limitAct = new LimitAct(); Limit limit = limitAct.GetByid(user.Limit.ToString()); if (limit.URL == "vip.html") Response.Redirect("vp.aspx?idd="+qq+"&pw="+password); else Response.Redirect("TodayVideo.aspx?idd="+qq+"&pw="+password); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { User user = userAct.GetByid(Request.QueryString["idd"]); LimitAct limitAct = new LimitAct(); Limit limit = limitAct.GetByid(user.Limit.ToString()); MovieAct movAct = new MovieAct(); Movie todayMovie = movAct.GetTodayMovie(); //是否需要积分观看 if (limit.NeedIntegral == false) { StartVideo(todayMovie.URL); return; } else { if (limit.CanRepeater == false) { if (user.Jifen < 1) { MessageBox("您的积分不够了,请及时充值!"); return; } RedureJifen(user); StartVideo(todayMovie.URL); return; } else { IList<string> Watcheduser = MyCache.WatchedUser; if (Watcheduser.Contains(user.QQ)) { StartVideo(todayMovie.URL); return; } else { if (user.Jifen < 1) { MessageBox("您的积分不够了,请及时充值!"); return; } RedureJifen(user); StartVideo(todayMovie.URL); Watcheduser.Add(user.QQ); MyCache.WatchedUser = Watcheduser; return; } } } }
protected void Button2_Click(object sender, EventArgs e) { string name = txtName.Text.Trim(); int integral = 0; try { integral = Convert.ToInt32(txtIntegral.Text.Trim()); } catch (Exception ex) { MessageBox("请输入正确的数字!"); return; } string url = txtURL.Text.Trim(); bool canRepeter =Convert .ToBoolean ( dropCanrepeter .SelectedValue) ; bool needintegral = Convert.ToBoolean(dropNeedIntegral.SelectedValue); int shengjijiangli = 0; try { shengjijiangli = Convert.ToInt32(txtshengjijiangli .Text .Trim ()); } catch (Exception ex) { MessageBox("请输入正确的数字!"); return; } LimitAct act = new LimitAct(); try { if (Request.QueryString["id"] != null) { Limit lit = act.GetByid(Request.QueryString["id"]); lit.Name = name; lit.Integral = integral; lit.NeedIntegral = needintegral; lit.CanRepeater = canRepeter; lit.URL = url; act.Edit(lit); RunScript("alert('修改成功!');window.opener.history.go(0);"); } else { act.Add(name, url, canRepeter, needintegral, integral,shengjijiangli); RunScript("alert('添加成功!');window.opener.history.go(0);"); } } catch (Exception ex) { MessageBox(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { LimitAct act = new LimitAct(); Limit lim = act.GetByid(Request.QueryString["id"]); txtName.Text = lim.Name; txtIntegral.Text = lim.Integral.ToString(); txtURL.Text = lim.URL; dropCanrepeter.SelectedIndex = lim.CanRepeater ? 0 : 1; dropNeedIntegral.SelectedIndex = lim.NeedIntegral ? 0 : 1; txtshengjijiangli.Text = lim.ShengjiJiangli.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["idd"] != null) { UserAct userAct = new UserAct(); User user = userAct.GetByid(Request.QueryString["idd"]); if (user == null || user.LoginPassWord != Request.QueryString["pw"]) { MessageBox("请先登录后观看视频"); return; } LimitAct limitAct = new LimitAct(); Limit limit = limitAct.GetByid(user.Limit.ToString ()); if (limit.URL == "vip.html") video.Visible = true; else video.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MovieAct movAct = new MovieAct(); rep1.DataSource = movAct.GetOldMovies().OrderByDescending(s => s.PlayDay); rep1.DataBind(); if (Request.QueryString["idd"] == null) { //MessageBox("请先登录后观看视频"); return; } User user = userAct.GetByid(Request.QueryString["idd"]); if (user == null || user.LoginPassWord != Request.QueryString["pw"]) { //MessageBox("请先登录后观看视频"); return; } Movie todayMovie = movAct.GetTodayMovie(); Movie nextMoive = movAct.GetNextdayMovie(); if (nextMoive != null) { Literal2.Text = nextMoive.Name; Literal4.Text = nextMoive.Name; } if (todayMovie == null) { MessageBox("今天没有可看的最新视频,请联系我们!"); return; } ImageButton1.Visible = true; Literal1.Text = todayMovie.Name; Literal3.Text = todayMovie.Name; LimitAct limitAct = new LimitAct(); Limit limit = limitAct.GetByid(user.Limit.ToString()); if (limit.NeedIntegral) { if (limit.CanRepeater == false) { ImageButton1.Attributes.Add("onclick", "return confirm('确认观看教学视频?确认观看将扣除你一个积分!');"); } else { IList<string> Watcheduser = MyCache.WatchedUser; if (Watcheduser.Contains(user.QQ) == false) { ImageButton1.Attributes.Add("onclick", "return confirm('确认观看教学视频?确认观看将扣除你一个积分!');"); } } } } }