protected void BTsubmit_Click(object sender, EventArgs e) { if (Request.QueryString["idd"] != null) { string qq = Request.QueryString["idd"]; CashKaAct kaAct = new CashKaAct(); string ka = txtChongzhika.Text.Trim(); CashKa chongzhika = kaAct.GetByNumber(ka); if (string .IsNullOrEmpty( chongzhika.QQ)==false ) { MessageBox("充值卡已经被使用"); return; } try { kaAct.Chongzhi(ka, qq); UserAct userAct = new UserAct(); User user = userAct.GetByid(qq); user.Jifen+=chongzhika .Cash; userAct.Edit(user); JifenChangeAct jifenAct = new JifenChangeAct(); jifenAct.Add(qq, chongzhika.Cash, JifenChangeType.充值, true); MessageBox("充值成功!"); } catch (Exception ex) { MessageBox(ex.Message); } } }
protected void Button2_Click(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { UserAct act = new UserAct(); User user = act.GetByid(Request.QueryString["id"]); int oldJifen = user.Jifen; user.Limit = Convert.ToInt32(dropLimit.SelectedValue); user.Jifen = Convert.ToInt32(txtJifen.Text.Trim()); user.Shouyi = Convert.ToInt32(txtShouyi.Text.Trim()); user.CanLogin = Convert.ToBoolean(dropCanuse.SelectedValue); try { act.Edit(user); JifenChangeAct changAct = new JifenChangeAct(); int amount= Math.Abs(oldJifen -user.Jifen ); changAct .Add (user.QQ ,amount ,JifenChangeType.调整 , user .Jifen >oldJifen ); RunScript("alert('修改成功!');window.opener.history.go(0);"); } catch (Exception ex) { MessageBox(ex.Message); } } }
protected void Button2_Click(object sender, EventArgs e) { int amount = 0; try { amount = Convert.ToInt32(TextBox1.Text.Trim()); } catch (Exception ex) { MessageBox("请输入正确的积分数"); return; } bool isAdd = true; try { isAdd = Convert.ToBoolean(DropDownList1.SelectedValue); } catch (Exception) { throw; } try { string qqs = TextBox2.Text.Trim(); string[] ids = qqs.Split(new string[]{"\r\n"},StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < ids.Length; i++) { UserAct userAct = new UserAct(); User user = userAct.GetByid(ids[i]); if (user != null) { if (isAdd) user.Jifen += amount; else { user.Jifen -= amount; } userAct.Edit(user); JifenChangeAct jifenAct = new JifenChangeAct(); jifenAct.Add(user.QQ, amount, JifenChangeType.调整, isAdd); } } //MessageBox("!"); RunScript("alert('积分修改成功!');window.opener.history.go(0);"); } catch (Exception ex) { MessageBox(ex.Message); throw; } }
protected void BTsubmit_Click(object sender, EventArgs e) { if (Request.QueryString["idd"] != null) { string qq = Request.QueryString["idd"]; ChongzhiRecardAct act = new ChongzhiRecardAct(); ChongzhiKaAct kaAct = new ChongzhiKaAct(); string ka = txtChongzhika.Text.Trim(); ChongzhiKa chongzhika = kaAct.GetNew(); if (chongzhika.Number != ka) { MessageBox("充值卡有误!请重新输入"); return; } ChongzhiRecard recard = act.GetByQQAndChongzhika(qq, ka); if (recard != null) { MessageBox("您的账户已经用该充值卡充过值了!无法重复充值!"); return; } try { act.Add(qq, ka); UserAct userAct = new UserAct(); User user = userAct.GetByid(qq); user.Jifen++; userAct.Edit(user); JifenChangeAct jifenAct = new JifenChangeAct(); jifenAct.Add(qq, 1, JifenChangeType.优惠, true); MessageBox("充值成功!"); } catch (Exception ex) { MessageBox(ex.Message); } } }
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 BTsubmit_Click(object sender, EventArgs e) { if (txtQQNO.Text.Trim().Length == 0) { MessageBox("请输入QQ号码!"); return; } try { Convert.ToInt32(txtQQNO.Text.Trim()); } catch (Exception) { MessageBox("请输入QQ号码!"); return; } if (txtPassword.Text.Length == 0) { MessageBox("请输入密码!"); return; } if (txtPassword2.Text != txtPassword.Text ) { MessageBox("密码重复不匹配!"); return; } string qq=txtQQNO .Text .Trim (); string password=txtPassword .Text; string tuijianrenQQ=txtTuijian .Text .Trim (); string mac = txtMac.Text.Trim(); if (mac.Length == 0) { Response.Write("0注册失败!"); Response.End(); } UserAct act = new UserAct(); if (act.GetByid(qq) != null) { Response.Write("0该QQ号码已经被注册!"); Response.End(); // return; } if (act.GetByMac(mac) != null) { //MessageBox("您已经注册,请勿重复注册!"); Response.Write("0您已经注册,请勿重复注册!"); Response.End(); // return; } if (!string.IsNullOrEmpty(tuijianrenQQ)) { if (act.GetByid(tuijianrenQQ) == null) { Response.Write("0推荐人QQ号码不存在,请重新输入!"); Response.End(); // MessageBox("推荐人QQ号码不存在,请重新输入!"); // return; } } try { act.Add(qq, password, tuijianrenQQ,mac,1); if (!string.IsNullOrEmpty(tuijianrenQQ)) { JifenChangeAct changeAct = new JifenChangeAct(); changeAct.Add(tuijianrenQQ, MyCache .GetCommon .TuijianIntegral, JifenChangeType.推荐 , true); User user = act.GetByid(tuijianrenQQ); //if (user == null) //{ // throw new NullReferenceException("qq号不存在"); //} user.Jifen += MyCache.GetCommon.TuijianIntegral; act.Edit(user); } Response.Write("1恭喜你!账号注册成功,可立即登录观看!"); } catch (Exception ex) { Response.Write("0" + ex.Message); } Response.End(); }
private void RedureJifen(User user) { JifenChangeAct changeAct = new JifenChangeAct(); changeAct.Add(user.QQ, 1, JifenChangeType.消费, false); user.Jifen--; userAct.Edit(user); }