<%@ Page language="c#" Codebehind="ADCategory.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.ADCategory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
		<title>ADCategory</title> 
		<!--#include file="inc/head.inc"-->
	</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="9" width="8" 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" Text="删除选定类别" Runat="server" CssClass="inputbtn"></asp:button></td>
									</tr>
									<tr>
										<td class="forumRowHighlight" height="23">
											<asp:datagrid id="dgCategoryList" runat="server" AllowPaging="False" PagerStyle-Mode="NumericPages"
												AutoGenerateColumns="False" DataKeyField="ADCategoryID" Width="100%" HorizontalAlign="Center" HeaderStyle-CssClass="summary-title">
												<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="类别编号" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
														<ItemTemplate>
															<%# DataBinder.Eval(Container.DataItem, "ADCategoryID") %>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="类别名称" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
														<ItemTemplate>
															<%# DataBinder.Eval(Container.DataItem, "ADCategoryName") %>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="广告类型" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
														<ItemTemplate>
															<%# DataBinder.Eval(Container.DataItem, "ADType").ToString() == "0" ? "普通广告" : "FLASH广告" %>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="" ItemStyle-Width="30" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
														<HeaderStyle></HeaderStyle>
														<ItemTemplate>
															<a href='ADCategory.aspx?Action=Modify&ADCategoryID=<%# DataBinder.Eval(Container.DataItem, "ADCategoryID") %>'>
																修改</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>
								</table>
								<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
								<table cellSpacing="0" cellPadding="0" class="ptable" style="width:100%">									
									<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:DropDownList id="ddlADType" runat="server">
												<asp:ListItem Value="0">普通广告</asp:ListItem>
												<asp:ListItem Value="1">FLASH广告</asp:ListItem>
											</asp:DropDownList>
											<font color="red">*</font>
										</td>
									</tr>
									<tr>
										<th class="tl">类别说明：</th>
										<td class="tr"><asp:textbox id="txtCategoryDesc" runat="server" Width="300px" TextMode="MultiLine" Height="60px"></asp:textbox></td>
									</tr>
									<tr>
										<td colSpan="2" class="center">
											<asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:button>
											<asp:button id="btnBack" OnClick="btnBack_Click" runat="server" Text="返回" CssClass="inputbtn"></asp:button>
										</td>
									</tr>
								</table>
								<%}%>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</body>
</HTML>