Files
g.hnyhua.cn/Mtxfw.VipSite/Admin_Member_List_HongBao.aspx.cs
2026-02-07 15:48:27 +08:00

170 lines
6.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace Mtxfw.VipSite
{
public partial class Admin_Member_List_HongBao : Mtxfw.Utility.MemberBase
{
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
private static Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
Mtxfw.DAL.user_proxy daoproxy = new Mtxfw.DAL.user_proxy();
protected int IFShowXFJF = 0;
protected string strIFKD = "", strIFNoKD = "";
public int gtype = 0;
#region
private bool _refreshState;
private bool _isRefresh;
/// <summary>
/// 判断页面是否刷新
/// </summary>
public bool IsRefresh
{
get
{
return _isRefresh;
}
}
protected override void LoadViewState(object savedState)
{
object[] allStates = (object[])savedState;
base.LoadViewState(allStates[0]);
_refreshState = (bool)allStates[1];
_isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
}
protected override object SaveViewState()
{
Session["__ISREFRESH"] = _refreshState;
object[] allStates = new object[2];
allStates[0] = base.SaveViewState();
allStates[1] = !_refreshState;
return allStates;
}
#endregion
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
string hostname = Request.Url.Host;
if (!IsPostBack)
{
if (Session["IFPassword"] == null)
{
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_List_HongBao.aspx");
}
if (IFStores != 1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
}
if (MemberJS.IndexOf("可领红包会员") == -1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
}
Data_Bind();
Page.Title = "可领红包会员 - " + GetWebName;
}
MyPager.PageChanged += delegate(object s, EventArgs ex)
{
Data_Bind();
};
}
protected void Data_Bind()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
String key = HttpUtility.UrlDecode(Request.QueryString["key"]);
sb.Append("gtype=" + gtype + " and uutype='0' And userstate<>'未审核' And IFStores=0 And umoney41>0 And DateDiff(day,regtime,getdate())>0");
if (gtype == 0)
{
if (Memberttype != -1)
{
sb.Append(" And gtype=" + Memberttype);
}
}
else
{
sb.Append(" And gtype=" + gtype);
}
if (!String.IsNullOrEmpty(key))
{
key = key.Trim();
string fiold = string.Empty;
sb.Append(" and (UserName like '%" + key + "%' or RealName like '%" + key + "%' or Phone like '%" + key + "%')");
}
string strOrder = " uLevel22 desc";
string groupby = "";
int Start = 0;
int Limit = 0;
Int32 Recount = 0;
MyPager.PageSize = 100;
Start = MyPager.PageSize * (MyPager.CurrentPageIndex - 1);
Limit = MyPager.PageSize;
DataSet dss = daoUser.GetDataSet(groupby, strOrder, "ID,UserName,RealName,uLevel22,umoney28,umoney41", "", sb.ToString(), Start, Limit, out Recount);
Mtxfw.Utility.Tools.ToBind(Repeater1, dss.Tables[1]);
MyPager.RecordCount = Recount;
if (MyPager.RecordCount == 0)
{
MyPager.Visible = false;
}
}
protected void Run_Click(object s, System.EventArgs e)
{
if (IsRefresh == false)
{
CheckBox Check = new CheckBox();
string strs = seclect_Drop.SelectedItem.Value;
foreach (RepeaterItem Item in Repeater1.Items)
{
//在行中查找到该单选框
Check = (CheckBox)Item.FindControl("checka");
int strID = int.Parse(Check.CssClass);
if (Check.Checked == true)
{
if (strs == "0")
{
Mtxfw.Model.user_info umodel = daoUser.GetModel(strID);
if (umodel != null)
{
TextBox LinkID = (TextBox)Item.FindControl("txtLinkID");
if (!System.Text.RegularExpressions.Regex.IsMatch(LinkID.Text, @"^-?\d+$"))
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('" + umodel.UserName + "的排序ID填写错误');</script>");
}
else
{
daoUser.UpdateuLevel("uLevel22", Convert.ToInt32(LinkID.Text), strID);
Model.User_CZ_log logmodel = new Model.User_CZ_log();
logmodel.MemberId = Card;
logmodel.AddTime = DateTime.Now;
logmodel.IP = Mtxfw.Utility.Common.GetIP;
logmodel.Body = "修改领红包排序,用户名:" + umodel.UserName;
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
}
}
}
}
}
Data_Bind();
}
}
}
}