<%@ Page language="c#" Codebehind="NewsCategory.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.Admin.NewsCategory" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>NewsCategory</title>
		<LINK href="inc/style.css" type="text/css" rel="stylesheet">
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
<table width="100%" height="550" style="border:1px #619ADF solid; border-left:0;margin-top:6px; margin-right:7px;background:#F2F7FD;" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
<div class="top">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><span class="tt">文章管理 &gt;&gt; 新闻类别管理</span></td>
		<td class="tm2"><span class="tt"><a href="http://www.wangqi.com" target="_blank"><IMG alt="帮助" src="Images/admin_help.gif" border="0"></a></span></td>
		<td class="tr"></td>
	</tr>
</table>
</div>
<div class="mframe">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><div class="tt">&nbsp; 新闻类别管理</div></td>
		<td class="tr"></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="ml"></td>
    <td  class="mm" align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#EBF3FE" valign="top" style=" border-right:1px #77ABE5 solid;">
<table width="90%"  cellspacing="0" cellpadding="0">
	<tr>
		<td class="ml1"></td>
		<td class="mm1">
			<% if(this.Request.QueryString["Action"] == "Manage"){%>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0">
				<tr height="35">
					<td><asp:Button ID="btnDeleteUp" CssClass="btn1" Runat="server" Text="删除选定类别"></asp:Button>
						<asp:Button ID="btnModifyUp" CssClass="btn" Runat="server" Text="修改"></asp:Button> <font color="#FF0000">注意：模板自带新闻类别只可修改，不可删除，否则网站首页会出现调用错误</font></td>
				</tr>
				<tr>
					<td class="forumRowHighlight" height="23"><asp:datagrid id="dgCategoryList" runat="server" HeaderStyle-CssClass="summary-title" HorizontalAlign="Center"
							Width="100%" DataKeyField="CategoryID" AutoGenerateColumns="False" PagerStyle-Mode="NumericPages" AllowPaging="False">
							<HeaderStyle Font-Bold="True"></HeaderStyle>
							<Columns>
								<asp:TemplateColumn>
									<HeaderTemplate>
										<asp:CheckBox id="chkAll" runat="server"></asp:CheckBox>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:CheckBox id="chkItem" runat="server"></asp:CheckBox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="分类ID" ItemStyle-Width="40" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="排序" ItemStyle-HorizontalAlign="Left">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<img src="../images/empty.gif" width='<%#10*(int)DataBinder.Eval(Container.DataItem,"Depth")%>' height="1" align="absmiddle">
										<asp:textbox id="txtSort" runat="server" Width="20px" Text='<%# DataBinder.Eval(Container.DataItem, "Sort") %>'>
										</asp:textbox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="类别名称" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
									<ItemTemplate>
										<img src="../images/empty.gif" width='<%#10*(int)DataBinder.Eval(Container.DataItem,"Depth")%>' height="1" align="absmiddle">├
										<asp:textbox id="categoryName" runat="server" Width="200px" Text='<%# DataBinder.Eval(Container.DataItem, "CategoryName") %>'>
										</asp:textbox>
										<!--(< %# DataBinder.Eval(Container.DataItem, "ArticleNum") %>)-->
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="是否发布" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<asp:CheckBox id="isActive" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IsActive") %>'>
										</asp:CheckBox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="新闻" ItemStyle-Width="30" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<a href='News.aspx?Keyword=&CatID=<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'>
											查看</a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<a href='NewsCategory.aspx?Action=Add&CategoryID=<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'>
											添加类别</a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="" ItemStyle-Width="30" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<a href='NewsCategory.aspx?Action=Modify&CategoryID=<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'>
											修改</a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:ButtonColumn ItemStyle-Width="30" ItemStyle-HorizontalAlign="Center" Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('真的要删除吗？此操作将删除属于该类别的所有商品！')&quot;&gt;删除&lt;/div&gt;"
									HeaderText="" CommandName="Delete"></asp:ButtonColumn>
							</Columns>
						</asp:datagrid></td>
				</tr>
				<tr height="35">
					<td><asp:Button ID="btnDeleteDn" CssClass="btn1" Runat="server" Text="删除选定类别"></asp:Button>
						<asp:Button ID="btnModifyDn" Runat="server" CssClass="btn" Text="修改"></asp:Button></td>
				</tr>
			</table>
			<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0">
				<tr>
					<td height="23">
						<table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0"
							valign="top">
							<tr>
								<td align="right" width="150">栏目名称：
								</td>
								<td><asp:textbox id="txtCategoryName" CssClass="input" runat="server" Width="200px"></asp:textbox><font color="red">*</font></td>
							</tr>
							<tr>
								<td align="right" width="150">栏目说明：
								</td>
								<td><asp:textbox id="txtCategoryDesc" CssClass="input" runat="server" Width="300px" Height="60px" TextMode="MultiLine"></asp:textbox><font color="red">*</font></td>
							</tr>
							<tr>
								<td align="right" width="150">所属类别：
								</td>
								<td><asp:dropdownlist id="ddlNewsCategories" runat="server"></asp:dropdownlist></td>
							</tr>
							<tr>
								<td align="right" width="150">是否有效：
								</td>
								<td>
									<asp:CheckBox id="cbxActive" runat="server" Checked="True"></asp:CheckBox></td>
							</tr>
							<tr height="35">
								<td align="center" colSpan="2"><asp:button id="btnSave" CssClass="btn" runat="server" Text="保存"></asp:button><FONT face="宋体">&nbsp;</FONT>&nbsp;<asp:Button id="btnBack" CssClass="btn" runat="server" Text="返回"></asp:Button></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<%}%>
		</td>
		<td class="mr1"></td>
	</tr>
</table>
</td>
  </tr>
</table>


<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>
</td>
    <td  class="mr"></td>
  </tr>
</table>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>

</div>
    </td>
  </tr>
</table>
		</form>
	</body>
</HTML>
