📄 leavelist.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.Common;
namespace YXShop.Web.Admin.LeaveWord
{
public partial class leaveList : System.Web.UI.Page
{
public PageSet ps;
YXShop.BLL.YXShop_LeaveWord bll = new YXShop.BLL.YXShop_LeaveWord();
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.LeaveWord.leaveList));
if (!IsPostBack)
{
string whereStr = " 1=1 order by LW_Time desc";
bindLeaveList(whereStr);
}
}
/// <summary>
/// 绑定所有留言
/// </summary>
private void bindLeaveList(string whereStr)
{
int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
if (pageIndex < 0)
{
pageIndex = 0;
}
if ((Request["Event"] == null) || (Request["Event"] == ""))
{
pageIndex = 0;
}
DataSet datas = bll.GetList(whereStr);
GridView1.DataSource = datas;
ps = new PageSet(datas.Tables[0].Rows.Count, PageSet.PageSize, pageIndex);
if (ps.PageCount <= pageIndex + 1)
{
pageIndex = ps.PageCount - 1;
}
GridView1.PageSize = PageSet.PageSize;
GridView1.PageIndex = pageIndex;
if (datas.Tables[0].Rows.Count < 1)
{
GridView1.BackColor = System.Drawing.Color.White;
}
else
{
GridView1.BackColor = System.Drawing.Color.FromArgb(0x5D, 0x8F, 0xB2);
}
GridView1.DataBind();
}
[AjaxPro.AjaxMethod]
public void delLeaveword(string lwid)
{
if (YXShop.Common.WebUtility.isNumeric(lwid))
{
try
{
bll.Delete(Convert.ToInt32(lwid));
}
catch { }
}
}
[AjaxPro.AjaxMethod]
public void ItemListDel(string idList)
{
string[] str = idList.Split(',');
for (int i = 0; i < str.Length; i++)
{
delLeaveword(str[i]);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string whereStr = " 1=1 order by LW_Time desc";
bindLeaveList(whereStr);
}
protected void Button2_Click(object sender, EventArgs e)
{
string whereStr = " LW_IsRead=0 order by LW_Time desc";
bindLeaveList(whereStr);
}
protected void Button3_Click(object sender, EventArgs e)
{
string whereStr = " LW_IsAuditing=0 order by LW_Time desc";
bindLeaveList(whereStr);
}
protected void Button4_Click(object sender, EventArgs e)
{
string whereStr = " LW_IsRevert=0 order by LW_Time desc";
bindLeaveList(whereStr);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -