protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["idd"] != null ) { UserAct ac=new UserAct (); User user = ac.GetByid(Request.QueryString["idd"]); if (user == null) return; lQQ.Text = user.QQ; LimitAct limitAct=new LimitAct (); ICollection<Limit> limits = limitAct.GetAll(); lLevel.Text = limits.Where(s => s.Id == user.Limit).First().Name; Limit next = limits.Where(s => s.Integral > user.Jifen).OrderBy(s => s.Integral).FirstOrDefault(); lJifen.Text = user.Jifen.ToString (); JifenChangeAct changeAct=new JifenChangeAct (); List<JifenChange > changs=changeAct.Select(user.QQ); int xiaofei =0; if(changs .Count >0 ) xiaofei = changs.Where(s => s.Type == JifenChangeType.消费).Sum(s => s.Amount); Literal5.Text = xiaofei.ToString (); Literal4.Text = next == null ? "0" : (next.Integral - (user.Jifen+xiaofei)).ToString(); lJifenTotal.Text = (user.Jifen + xiaofei).ToString(); } }
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 Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LimitAct userAct = new LimitAct(); Ruserlist.DataSource = userAct.GetAll (); Ruserlist.DataBind(); } }
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) { LimitAct limitAc=new LimitAct (); dropLimit .DataSource =limitAc .GetAll (); dropLimit .DataTextField ="Name"; dropLimit .DataValueField ="Id"; dropLimit .DataBind (); if (Request.QueryString["id"] != null) { UserAct act = new UserAct(); User user = act.GetByid(Request.QueryString["id"]); Literal1.Text = user.QQ ; Literal2.Text = user.LoginPassWord ; txtJifen.Text = user.Jifen.ToString() ; txtShouyi.Text = user.Shouyi.ToString(); dropLimit.SelectedValue = user.Limit.ToString(); dropCanuse.SelectedValue = user.CanLogin.ToString(); } } }
protected void BTsubmit_Click(object sender, EventArgs e) { if (txtUsername.Text.Trim().Length == 0) { MessageBox("请输入用户名!"); return; } if (txtPassword.Text.Length == 0) { MessageBox("请输入密码!"); } string username=txtUsername .Text .Trim (); string password=txtPassword .Text; LoginAction act = new LoginAction(); User user = new User(); if (act.UserLogin(username, password)) { UserAct userAct = new UserAct(); user = userAct.GetByid(username); if (user.CanLogin == false) { // MessageBox("!"); Response.Write("0该用户已经被禁用!"); Response.End(); return; } //等级调整 if (string.IsNullOrEmpty(user.TuijianrenQQ) == false) { LimitAct limitAct = new LimitAct(); ICollection<Limit> limits = limitAct.GetAll().OrderBy(s => s.Integral).ToList(); Limit userLimit = limits.Where(s => s.Id == user.Limit).FirstOrDefault(); int oldLimit = user.Limit; int jiangli=0; JifenChangeAct changeAct = new JifenChangeAct(); int xiaofei = changeAct.Select(user.QQ).Where(s => s.Type == JifenChangeType.消费).Sum(s => s.Amount); int total = xiaofei + user.Jifen; foreach (var item in limits) { if (total > item.Integral && item.Integral > userLimit.Integral) { user.Limit = item.Id; jiangli =item .ShengjiJiangli ; } } if (oldLimit != user.Limit) { User tuijianren=userAct.GetByid(user.TuijianrenQQ); int hasJiangli = changeAct.Select(tuijianren.QQ).Where (s=>s.Type ==JifenChangeType .被推荐人升级奖励 && s.FromQQ ==user.QQ ).Sum (s=>s.Amount ) ; tuijianren.Jifen += (jiangli-hasJiangli ); try { userAct.Edit(tuijianren); userAct.Edit(user); changeAct.Add(tuijianren.QQ, jiangli, JifenChangeType.被推荐人升级奖励, true,user .QQ); } catch (Exception ex) { MessageBox(ex.Message); } } } Response.Cookies["jifenqq"].Value = "164981897"; Response.Write("1登录成功!"); Response.End(); // Response.Redirect("Page/TuiguangQQ.aspx"); } else { //MessageBox("!"); Response.Write("0用户名或密码错误!"); Response.End(); } }
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('确认观看教学视频?确认观看将扣除你一个积分!');"); } } } } }