167 lines
6.0 KiB
C#
167 lines
6.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Text;
|
|
using System.Data;
|
|
using System.Security.Cryptography;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
namespace Mtxfw.VipSite
|
|
{
|
|
public partial class Admin_Member_HongBao : Mtxfw.Utility.MemberBase
|
|
{
|
|
|
|
Mtxfw.DAL.user_bank daoBank = new Mtxfw.DAL.user_bank();
|
|
Mtxfw.DAL.user_info daouser = new Mtxfw.DAL.user_info();
|
|
Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|
Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
|
public int gtype = 0,t=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 (!String.IsNullOrEmpty(Request.QueryString["t"]))
|
|
{
|
|
t = Convert.ToInt32(Request.QueryString["t"].ToString());
|
|
}
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["IFPassword"] == null)
|
|
{
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_HongBao.aspx");
|
|
}
|
|
if (IFStores != 1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
if (MemberJS.IndexOf("红包列表") == -1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
Page.Title = "红包列表 - " + GetWebName;
|
|
|
|
Data_Bind();
|
|
|
|
}
|
|
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
|
{
|
|
Data_Bind();
|
|
};
|
|
}
|
|
protected void Data_Bind()
|
|
{
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
|
String SJ = Request.QueryString["SJ"];
|
|
String SJ2 = Request.QueryString["SJ2"];
|
|
String MemberId = Request.QueryString["MemberId"];
|
|
String key = Request.QueryString["key"];
|
|
String type = Request.QueryString["type"];
|
|
sb.Append(" and utype=8");
|
|
if (!String.IsNullOrEmpty(type))
|
|
{
|
|
sb.Append(" and UserId=" + type);
|
|
Drop_type.SelectedValue=type.ToString();
|
|
}
|
|
if (t == -1)
|
|
{
|
|
sb.Append(" and UserId=0");
|
|
}
|
|
if (gtype == 0)
|
|
{
|
|
if (Memberttype != -1)
|
|
{
|
|
sb.Append(" And gtype=" + Memberttype);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
sb.Append(" And gtype=" + gtype);
|
|
}
|
|
if (!String.IsNullOrEmpty(SJ) && !String.IsNullOrEmpty(SJ2))
|
|
{
|
|
sb.Append(" and (addtime between '" + SJ + " 00:00:00' and '" + SJ2 + " 23:59:59') ");
|
|
}
|
|
if (!String.IsNullOrEmpty(MemberId))
|
|
{
|
|
sb.Append(" and MemberId=" + MemberId);
|
|
}
|
|
if (!String.IsNullOrEmpty(key))
|
|
{
|
|
key = key.Trim();
|
|
sb.Append(" and MemberId=(Select id from user_info b where b.gtype=" + gtype + " and b.IFStores=0 and (b.UserName like '%" + key + "%' or b.realname like '%" + key + "%'))");
|
|
}
|
|
string groupby = "";
|
|
string strOrder = "seef asc,addtime desc,id desc";
|
|
|
|
int Start = 0;
|
|
int Limit = 0;
|
|
Int32 Recount = 0;
|
|
MyPager.PageSize = 50;
|
|
Start = MyPager.PageSize * (MyPager.CurrentPageIndex - 1);
|
|
Limit = MyPager.PageSize;
|
|
DataSet dss = daoResults.GetDataSet(groupby, strOrder, "ID,Totalmoney,addtime,Seef,seeftime,MemberId,UserId,(Select UserName From user_info b Where b.Id=MemberId) as MemberName,(Select realname From user_info b Where b.Id=MemberId) as realname", "", "gtype=" + gtype + " and IFDelete=0" + 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");
|
|
Int64 strID = Int64.Parse(Check.CssClass);
|
|
if (Check.Checked == true)
|
|
{
|
|
daoResults.UpdateIFDelete(1, DateTime.Now.ToString(), strID);
|
|
}
|
|
}
|
|
}
|
|
Data_Bind();
|
|
}
|
|
|
|
|
|
}
|
|
} |