62,074
社区成员
发帖
与我相关
我的任务
分享
<form id="form1" runat="server">
<div>
<asp:Repeater ID="rptList" runat="server">
<HeaderTemplate>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="31" background="../images/d2.jpg"><table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="5%"><div align="center"><STRONG>序号</STRONG></div></td>
<td width="18%"><div align="center"><STRONG>权限</STRONG></div></td>
<td width="41%"><div align="center"><STRONG>用户名</STRONG></div></td>
<td width="38%"><div align="center"><STRONG>操作</STRONG></div></td>
</tr>
</table></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/x1.jpg">
<tr onmouseover="this.bgColor='#D6DD2F'" onmouseout="this.bgColor='#FFFFFF'">
<!--
<tr bgcolor="#F3F7FA" onmouseover="this.bgColor='#D6DD2F'" onmouseout="this.bgColor='#F3F7FA'">
-->
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5%" height="38" class="p12d2"><asp:Label ID="lb_id" runat="server" Text='<%# Eval("Id")%>' Visible="False"></asp:Label></td>
<td width="18%"><%# Eval("UserType").ToString().Trim() == "1" ? "<span>超级管理员</span>" : "<span>普通管理员</span>"%>
</td>
<td width="41%"><%# Eval("UserName")%></td>
<td width="38%"><table width="70%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="10%"><img src="../images/g2.jpg" width="14" height="16"></td>
<td width="40%"><span><a href="user_updateform.aspx?id=<%# Eval("Id") %>">修改</a></span></td>
<td width="10%"><img src="../images/g3.jpg" width="13" height="13"></td>
<td width="40%"><span><a href="user_updateform.aspx?id=<%# Eval("Id") %>">删除</a></span></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="6" bgcolor="#D5E0F2" class="p12d2"><img src="../images/x1x1.jpg" width="26" height="1"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div class="spClear"></div>
<div style="line-height:30px;height:30px;">
<div class="right flickr">
<webdiyer:aspnetpager ID="AspNetPager1" runat="server" CssClass="formfield"
CustomInfoClass="formbutton"
CustomInfoHTML="第<font color='red'><b>%CurrentPageIndex%</b></font>页 共%PageCount% 页 %StartRecordIndex%-%EndRecordIndex%"
CustomInfoTextAlign="Center" FirstPageText="首页" horizontalalign="Center"
InputBoxStyle="width:19px" LastPageText="尾页" meta:resourceKey="AspNetPager1"
NextPageText="下一页" PageSize="9"
PrevPageText="前一页" showcustominfosection="Left" ShowInputBox="Always"
ShowNavigationToolTip="True" style="FONT-SIZE: 12px"
SubmitButtonClass="formfield" SubmitButtonText="GO" width="506px"
onpagechanging="AspNetPager1_PageChanging" PageIndexBoxType="TextBox"
ShowPageIndexBox="Never" AlwaysShow="True">
</webdiyer:aspnetpager>
</div>
<div class="left">
<span class="btn_all" onclick="checkAll(this);">全选</span>
<span class="btn_bg">
<asp:LinkButton ID="lbtnDel" runat="server" onclick="lbtnDel_Click" OnClientClick="return confirm( '确定要删除这些记录吗? ');">批量删除</asp:LinkButton>
</span>
</div>
</div>
</div>
<div>
<ext:ScriptManager ID="ScriptManager1" runat="server">
</ext:ScriptManager>
</div>
</form>
public int pcount = 0;
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack){
RptBind("");
}
}
#region 数据绑定
public void RptBind(string strWhere)
{
Cms.BLL.maintain bll = new Cms.BLL.maintain();
DataSet ds = bll.GetList(strWhere);
DataView dv = ds.Tables[0].DefaultView;
//利用PAGEDDAGASOURCE类来分页
PagedDataSource pds = new PagedDataSource();
AspNetPager1.RecordCount = dv.Count;
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize;
//获得总条数
pcount = bll.GetCount(strWhere);
if (this.pcount > 0)
{
this.lbtnDel.Enabled = true;
}
else
{
this.lbtnDel.Enabled = false;
}
//绑定数据
rptList.DataSource = pds;
rptList.DataBind();
}
#endregion
#region 批量删除
protected void lbtnDel_Click(object sender, EventArgs e)
{
Cms.BLL.maintain bll = new BLL.maintain();
//批量删除
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((Label)rptList.Items[i].FindControl("lb_id")).Text);
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
if (cb.Checked)
{
//保存日志
SaveLogs("[链接管理]删除链接:" + bll.GetModel(id).UserName);
//删除记录
bll.Delete(id);
}
}
Coolite.Ext.Web.Ext.MessageBox.Alert("提示", "批量删除成功").Show();
RptBind("");
}
#endregion
protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
AspNetPager1.CurrentPageIndex = e.NewPageIndex;
RptBind("");
}
<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="user_manage.aspx.cs" Inherits="Cms.Web.maintain.user.user_manage" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!-- #include file="../include/head.aspx" -->
</HEAD>
<!-- #include file="../include/top.aspx" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="186" valign="top" background="../images/add_12.jpg"><table width="40" border="0" cellpadding="0" cellspacing="0" background="../images/add_12.jpg">
<!-- #include file="../include/left_user.aspx" -->
<tr>
<td height="100"><img src="../images/add_12.jpg" width="186" height="17"></td>
</tr>
<!-- #include file="../include/banquan.aspx" -->
</table></td>
<td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="44" background="../images/addnews_8.jpg"><div align="center" class="p12d">
<table width="95%" height="26" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom"><div align="center" class="p12d">用户管理</div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="900" valign="top"><div align="center">
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="32" background="../images/dd.jpg"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30%"><table width="60%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr align="right">
<td align="right"><a href="user_add.aspx"><img src="../images/A1.jpg" width="68" height="23" border="0"></a></td>
<td align="right"><a href="user_manage.aspx"><img src="../images/A2.jpg" width="68" height="23" border="0"></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="rptList" runat="server">
<HeaderTemplate>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="31" background="../images/d2.jpg"><table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="5%"><div align="center"><STRONG>序号</STRONG></div></td>
<td width="18%"><div align="center"><STRONG>权限</STRONG></div></td>
<td width="41%"><div align="center"><STRONG>用户名</STRONG></div></td>
<td width="38%"><div align="center"><STRONG>操作</STRONG></div></td>
</tr>
</table></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/x1.jpg">
<tr onmouseover="this.bgColor='#D6DD2F'" onmouseout="this.bgColor='#FFFFFF'">
<!--
<tr bgcolor="#F3F7FA" onmouseover="this.bgColor='#D6DD2F'" onmouseout="this.bgColor='#F3F7FA'">
-->
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5%" height="38" class="p12d2"><asp:Label ID="lb_id" runat="server" Text='<%# Eval("Id")%>' Visible="False"></asp:Label></td>
<td width="18%"><%# Eval("UserType").ToString().Trim() == "1" ? "<span>超级管理员</span>" : "<span>普通管理员</span>"%>
</td>
<td width="41%"><%# Eval("UserName")%></td>
<td width="38%"><table width="70%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="10%"><img src="../images/g2.jpg" width="14" height="16"></td>
<td width="40%"><span><a href="user_updateform.aspx?id=<%# Eval("Id") %>">修改</a></span></td>
<td width="10%"><img src="../images/g3.jpg" width="13" height="13"></td>
<td width="40%"><span><a href="user_updateform.aspx?id=<%# Eval("Id") %>">删除</a></span></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="6" bgcolor="#D5E0F2" class="p12d2"><img src="../images/x1x1.jpg" width="26" height="1"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div class="spClear"></div>
<div style="line-height:30px;height:30px;">
<div class="right flickr">
<webdiyer:aspnetpager ID="AspNetPager1" runat="server" CssClass="formfield"
CustomInfoClass="formbutton"
CustomInfoHTML="第<font color='red'><b>%CurrentPageIndex%</b></font>页 共%PageCount% 页 %StartRecordIndex%-%EndRecordIndex%"
CustomInfoTextAlign="Center" FirstPageText="首页" horizontalalign="Center"
InputBoxStyle="width:19px" LastPageText="尾页" meta:resourceKey="AspNetPager1"
NextPageText="下一页" PageSize="9"
PrevPageText="前一页" showcustominfosection="Left" ShowInputBox="Always"
ShowNavigationToolTip="True" style="FONT-SIZE: 12px"
SubmitButtonClass="formfield" SubmitButtonText="GO" width="506px"
onpagechanging="AspNetPager1_PageChanging" PageIndexBoxType="TextBox"
ShowPageIndexBox="Never" AlwaysShow="True">
</webdiyer:aspnetpager>
</div>
<div class="left">
<span class="btn_all" onclick="checkAll(this);">全选</span>
<span class="btn_bg">
<asp:LinkButton ID="lbtnDel" runat="server" onclick="lbtnDel_Click" OnClientClick="return confirm( '确定要删除这些记录吗? ');">批量删除</asp:LinkButton>
</span>
</div>
</div>
</div>
<div>
<ext:ScriptManager ID="ScriptManager1" runat="server">
</ext:ScriptManager>
</div>
</form>
</td>
</tr>
</table></td>
</tr>
</table>
<!-- #include file="../include/bottom.aspx" -->