<%@ Page language="c#" Codebehind="NewsCategory.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.NewsCategory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
	    <!--#include file="inc/head.inc"-->
		<title>NewsCategory</title>
	</HEAD>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />
		    <% if(this.Request.QueryString["Action"] == "Manage"){%>新闻类别列表<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>新闻类别添加<%}%>
		</div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title">新闻类别管理</div>
		        <div class="frame_content">
		            <% if(this.Request.QueryString["Action"] == "Manage"){%>
			        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
				        <tr>
					        <td><asp:Button ID="btnDeleteUp" OnClick="btnDeleteUp_Click" Runat="server" Text="删除选定类别" CssClass="inputbtn"></asp:Button>
						        <asp:Button ID="btnModifyUp" OnClick="btnModifyUp_Click" Runat="server" Text="修改" CssClass="inputbtn"></asp:Button></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") %>&Status=1'>
											        查看</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>
					        <td><asp:Button ID="btnDeleteDn" OnClick="btnDeleteDn_Click" Runat="server" Text="删除选定类别" CssClass="inputbtn"></asp:Button>
						        <asp:Button ID="btnModifyDn" OnClick="btnModifyDn_Click" Runat="server" Text="修改" CssClass="inputbtn"></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="ptable" cellspacing="0" cellpadding="0">
							        <tr>
								        <th class="tl">栏目名称：
								        </th>
								        <td class="tr"><asp:textbox id="txtCategoryName" runat="server" Width="200px"></asp:textbox><font color="red">*</font></td>
							        </tr>
							        <tr>
								        <th class="tl">栏目说明：
								        </th>
								        <td class="tr"><asp:textbox id="txtCategoryDesc" runat="server" Width="300px" Height="60px" TextMode="MultiLine"></asp:textbox><font color="red">*</font></td>
							        </tr>
							        <tr>
								        <th class="tl">所属类别：
								        </th>
								        <td class="tr"><asp:dropdownlist id="ddlNewsCategories" runat="server"></asp:dropdownlist></td>
							        </tr>
							        <tr>
								        <th class="tl">是否有效：
								        </th>
								        <td class="tr">
									        <asp:CheckBox id="cbxActive" runat="server" Checked="True"></asp:CheckBox></td>
							        </tr>
							        <tr>
								        <th class="tl"></th>
								        <td class="tr"><asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:button><FONT face="宋体">&nbsp;</FONT>
									        <asp:Button id="btnBack" OnClick="btnBack_Click" runat="server" Text="返回" CssClass="inputbtn"></asp:Button></td>
							        </tr>
						        </table>
					        </td>
				        </tr>
			        </table>
			        <%}%>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</HTML>
