<%@Page Language="C#" Inherits="IWMS.Admin.PostSortMan" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<script type="text/javascript">
	<!--
		<asp:Literal id="ltScript" runat="server"/>
		function confirmDelete(obj,id){
			var s="<div style='padding:30px'>删除分类下帖子转至 <select id='sel2'>";
			for(var i=0;i<psorts.length;i++){
				if(psorts[i][0]==id){
					continue;
				}
				s+="<option value='"+ psorts[i][0] +"'>"+ psorts[i][1] +"<\/option>";
			}
			s+="<\/select><\/div>";
			Boxy.confirm(s,function(){
				$.post('admin_postSort.aspx',{act:'ajax',cmd:'delete',id:id,moveto:$('#sel2').val()},function(r){
					if(r.success){
						Boxy.alert("成功删除分类",null,{title:"操作结果"});
						$(obj).parents("tr:first").hide();
					}else{
						Boxy.alert("删除分类失败",null,{title:"操作结果"});
					}
				},'json');
			});
		}
	-->
	</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="cphMain" runat="server">

	<form id="myForm" runat="server">
	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<span class="tt">管理讨论区分类</span>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<ASP:DataGrid id="MyDataGrid" runat="server"
				Width="100%"
				align="center"
				ShowHeader="true"
				ShowFooter="false"
				AllowPaging="true"
				AutoGenerateColumns="false"
				DataKeyField="id"
				OnItemDataBound="MyDataGrid_ItemDataBound"
				OnItemCommand="MyDataGrid_ItemCommand"
				OnPageIndexChanged="MyDataGrid_Page"
				CssClass="grid"
				BorderColor="#cccccc"
				HeaderStyle-CssClass="gridHead"
				ItemStyle-CssClass="tdbg"
				PageSize="10"
				CellPadding="6"
				CellSpacing="0" >
			
			<Columns>
				<asp:TemplateColumn>
					<ItemTemplate>
						<a href="admin_postSortAdd.aspx?id=<%#Eval("id")%>">修改</a>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center"/>
					<HeaderStyle Width="40"/>
				</asp:TemplateColumn>
				<asp:BoundColumn
					HeaderText="分类名"
					DataField="name"
					>
					<ItemStyle HorizontalAlign="center"/>
				</asp:BoundColumn>
				<asp:ButtonColumn
					HeaderText="上升"
					ButtonType="LinkButton"
					Text="&uarr;"
					CommandName="up"
					>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="40"/>
				</asp:ButtonColumn>
				<asp:ButtonColumn
					HeaderText="下降"
					ButtonType="LinkButton"
					Text="&darr;"
					CommandName="down"
					>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="40"/>
				</asp:ButtonColumn>
				<asp:TemplateColumn>
					<ItemTemplate>
						<a href="###" onclick="confirmDelete(this,<%#Eval("id")%>)">删除</a>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center"/>
					<HeaderStyle Width="40"/>
				</asp:TemplateColumn>
			</Columns>
		</ASP:DataGrid>
		
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	
	<table width="400" align="center"><tr><td align="right">
	<asp:Label id="PageList" runat="server"/>
	</td></tr>
	</table>
	
	</form>

</asp:Content>