Files
g.hnyhua.cn/Mtxfw.shop/_Admin/admin_User_Online2.aspx.cs

58 lines
2.0 KiB
C#
Raw Permalink Normal View History

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Mtxfw.shop._Admin
{
public partial class admin_User_Online2 : Mtxfw.Utility.AdminPage
{
public Mtxfw.DAL.User_OnLine daoOnLine = new Mtxfw.DAL.User_OnLine();
public string stronlinecount = "0", stronlinecount2 = "0";
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!IsPostBack)
{
stronlinecount = daoOnLine.getonlinecount(0).ToString();
stronlinecount2 = daoOnLine.getonlinecount(1).ToString();
Data_Bind();
}
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"]);
string Orderby = " Order By ID desc";
int order = 0;
if (!String.IsNullOrEmpty(Request.QueryString["order"]))
{
order = Convert.ToInt32(Request.QueryString["order"]);
}
if (order == 1)
{
Orderby = " Order By IsOnline desc,ID desc";
}
if (!String.IsNullOrEmpty(key))
{
key = key.Trim();
sb.Append(" and MemberId=(Select id from User_Info b where b.UserName='" + key + "')");
}
Int32 Recount = daoOnLine.GetCount("UserType=0" + sb.ToString());
MyPager.PageSize = 100;
Mtxfw.Utility.Tools.ToBind(Repeater1, daoOnLine.GetPager(MyPager, "(select username from User_Info b where id=a.MemberId) as CMemberId,", "UserType=0" + sb.ToString() + Orderby));
MyPager.RecordCount = Recount;
}
}
}