<%@ Page language="c#" Codebehind="NewsCenterManage.aspx.cs" AutoEventWireup="True" Inherits="DreamerShop.Admin.NewsCenterManage" %>
<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>新闻管理－<%=mConfigInf.strWebTitle%>
		</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<META content="<%=mConfigInf.strDescription%>" name=description>
		<META content="<%=mConfigInf.strKeywords%>" name=keywords>
		<LINK href="../StyleSheet1.css" rel="stylesheet">
		<SCRIPT language="javascript" id="clientEventHandlersJS">
		<!--
		function popUpDetail(URLStr, left, top, width, height)
		{
			var popUpWin=0;
			if(popUpWin)

			{

			if(!popUpWin.closed) popUpWin.close();

			}

			popUpWin = open(URLStr, 'popUpDetail', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
		}

		function selsmallpic() {
			var arr = new Array()
			imgArr=self.showModalDialog("ftb.imagegallery1.aspx?rif=BookPic&cif=BookPic",window,'dialogWidth:560px; dialogHeight:500px;help:0;status:0;resizeable:1;')
			var temp;
			var len;
			var len1;
			var filename;
			if(imgArr!=null)
			{
				temp=imgArr['filename'];
				
				len=temp.lastIndexOf("BookPic");
				len1=temp.length;
				filename=temp.substring(len + 8,len1);
				Form1.txtSmallPic.value="BookPic/" + filename;
			}
		}
		function selbigpic() {
			var arr = new Array()
			imgArr=self.showModalDialog("ftb.imagegallery1.aspx?rif=BookPic&cif=BookPic",window,'dialogWidth:560px; dialogHeight:500px;help:0;status:0;resizeable:1;')
			var temp;
			var len;
			var len1;
			var filename;
			if(imgArr!=null)
			{
				temp=imgArr['filename'];
				len=temp.lastIndexOf("BookPic");
				len1=temp.length;
				filename=temp.substring(len + 8,len1);
				Form1.txtBigPic.value="BookPic/" + filename;
			}
		}
		
		function selall()
		{	
			var a = document.getElementsByTagName("input");
		
			var str;
			var len;
			var state;
			for (var i=0; i<a.length; i++)
			{
				if (a[i].type == "checkbox") 
				{
					str=a[i].id;
					len=str.lastIndexOf("ckSelAll");
					if((len * 1)>=1)
					{
						state=a[i].checked;
						break;
						}
				}
			}
			for (var i=0; i<a.length; i++)
			{
				if (a[i].type == "checkbox") 
				{
					str=a[i].id;
					len=str.lastIndexOf("ckSelItem");
					if((len * 1)>=1)
						a[i].checked=state;
				}
			}
		}
		
		
		
		function imgHelp_onclick() {
			popUpWin("DSHelp/ProductManage.html","Help",100,100,800,600);
			}
			
		function popUpWin(URLStr,WinName, left, top, width, height)
		{
			var popUpWin=0;
			if(popUpWin)

			{

			if(!popUpWin.closed) popUpWin.close();

			}

			popUpWin = open(URLStr, WinName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
		}
		//-->
		</SCRIPT>
	</HEAD>
	<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">
		<form id="Form1" method="post" runat="server">
			<asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder>
			<table width="97%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="1%" height="7"><img src="../Images/Admin/lt.gif" width="9" height="9"></td>
					<td width="98%" background="../Images/Admin/top.gif" height="7"><img src="../Images/Admin/spacer.gif" width="1" height="1"></td>
					<td width="1%" height="7"><img src="../Images/Admin/rt.gif" width="9" height="9"></td>
				</tr>
				<tr>
					<td width="1%" background="../Images/Admin/left.gif" height="319">&nbsp;</td>
					<td width="98%" height="319" valign="top">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="262" valign="top">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td bgcolor="#ffffff" valign="top" height="300">
												<FONT face="宋体">
													<asp:panel id="Pan1" runat="server">
														<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
															<TR>
																<TD width="40"><IMG height="32" src="../Images/Admin/program-1.gif" width="32"></TD>
																<TD class="p12black"><SPAN class="p9orange">功能--&gt;新闻中心--&gt;新闻列表</SPAN> <IMG language="javascript" id="imgHelp" style="CURSOR: pointer" onclick="return imgHelp_onclick()"
																		alt="帮助" src="../Images/Admin/helpicon.gif"></TD>
																<TD>
																	<asp:ImageButton id="btAddNew" runat="server" ImageUrl="../Images/Admin/fb-new.gif"></asp:ImageButton>新增新闻</TD>
																<TD>
																	<asp:ImageButton id="ibtDeleteAll" runat="server" ImageUrl="../Images/Admin/fb-delete.gif"></asp:ImageButton>删除所选</TD>
															</TR>
														</TABLE>
														<asp:datagrid id="dgList" runat="server" CssClass="table-shangxia" AllowPaging="True" AutoGenerateColumns="False"
															Width="100%" DataKeyField="NewsID">
															<HeaderStyle HorizontalAlign="Center" BackColor="#F1F1F1"></HeaderStyle>
															<Columns>
																<asp:BoundColumn DataField="NewsTitle" HeaderText="新闻标题">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																</asp:BoundColumn>
																<asp:BoundColumn DataField="ProductName" HeaderText="分类">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																</asp:BoundColumn>
																<asp:TemplateColumn HeaderText="头条">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																	<ItemTemplate>
																		<asp:CheckBox id="ckBigNewsItem" runat="server" Checked= '<%# DataBinder.Eval(Container.DataItem, "BigNews")%>'>
																		</asp:CheckBox>
																	</ItemTemplate>
																</asp:TemplateColumn>
																<asp:TemplateColumn HeaderText="醒目">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																	<ItemTemplate>
																		<asp:CheckBox id="ckIsHilitItem" runat="server" Checked= '<%# DataBinder.Eval(Container.DataItem, "IsHilit")%>'>
																		</asp:CheckBox>
																	</ItemTemplate>
																</asp:TemplateColumn>
																<asp:TemplateColumn HeaderText="固顶">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																	<ItemTemplate>
																		<asp:CheckBox id="ckIsLockTopItem" runat="server" Checked= '<%# DataBinder.Eval(Container.DataItem, "IsLockTop")%>'>
																		</asp:CheckBox>
																	</ItemTemplate>
																</asp:TemplateColumn>
																<asp:TemplateColumn HeaderText="评论">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																	<ItemTemplate>
																		<asp:CheckBox id="ckIsReviewItem" runat="server" Checked= '<%# DataBinder.Eval(Container.DataItem, "IsReview")%>'>
																		</asp:CheckBox>
																	</ItemTemplate>
																</asp:TemplateColumn>
																<asp:TemplateColumn HeaderText="操作">
																	<HeaderStyle></HeaderStyle>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																	<ItemTemplate>
																		<asp:Button id="btUpdate" Text="更新" CssClass="go-wenbenkuang" CommandName="Update" Runat="server"></asp:Button>
																		<asp:Button id="btEdit" Text="修改" CssClass="go-wenbenkuang" CommandName="Edit" Runat="server"></asp:Button>
																		<asp:Button id="btDelete" Text="删除" CssClass="go-wenbenkuang" CommandName="Delete" Runat="server"></asp:Button>
																	</ItemTemplate>
																</asp:TemplateColumn>
																<asp:TemplateColumn>
																	<HeaderStyle></HeaderStyle>
																	<HeaderTemplate>
																		<asp:CheckBox id="ckSelAll" runat="server" onClick="selall()"></asp:CheckBox>
																	</HeaderTemplate>
																	<ItemStyle HorizontalAlign="Center"></ItemStyle>
																	<ItemTemplate>
																		<asp:CheckBox id="ckSelItem" runat="server"></asp:CheckBox>
																	</ItemTemplate>
																</asp:TemplateColumn>
															</Columns>
															<PagerStyle Visible="False" NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Right"></PagerStyle>
														</asp:datagrid>
														<TABLE class="table-zuoyou" id="Table1" width="100%" align="center" border="0">
															<TR align="center" bgColor="#f1f1f1">
																<TD>
																	<asp:button id="btFirst" runat="server" CssClass="go-wenbenkuang" Text=" 首 页" BorderStyle="Groove"></asp:button>&nbsp;
																	<asp:button id="btPre" runat="server" CssClass="go-wenbenkuang" Text="上一页" BorderStyle="Groove"></asp:button>&nbsp;
																	<asp:button id="btNext" runat="server" CssClass="go-wenbenkuang" Text="下一页" BorderStyle="Groove"></asp:button>&nbsp;
																	<asp:button id="btLast" runat="server" CssClass="go-wenbenkuang" Text=" 尾 页" BorderStyle="Groove"></asp:button>&nbsp;
																	<asp:label id="lbPage" runat="server"></asp:label>&nbsp; 转到
																	<asp:textbox id="txtPageNum" runat="server" CssClass="wenbenkuang" Width="30px" MaxLength="3"></asp:textbox>
																	<asp:CompareValidator id="CompareValidator2" runat="server" ControlToValidate="txtPageNum" Display="Dynamic"
																		ErrorMessage="输入数字" Type="Integer" Operator="DataTypeCheck" ForeColor="#FF0000"></asp:CompareValidator>页
																	<asp:button id="btGo" runat="server" CssClass="go-wenbenkuang" Text="Go"></asp:button></TD>
															</TR>
														</TABLE>
														<TABLE align="center" border="0">
															<TR>
																<TD>标题关键字
																	<asp:TextBox id="txtFindKey" runat="server" CssClass="wenbenkuang"></asp:TextBox>
																	<asp:Button id="btFind" runat="server" CssClass="go-wenbenkuang" Text="商品查找"></asp:Button></TD>
															</TR>
														</TABLE>
													</asp:panel></FONT><asp:panel id="Pan2" runat="server" Visible="False">
													<TABLE class="p9black" cellSpacing="0" cellPadding="0" width="100%" border="0">
														<TR>
															<TD style="WIDTH: 711px">
																<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
																	<TR>
																		<TD width="40"><IMG height="32" src="../Images/Admin/program-1.gif" width="32"></TD>
																		<TD class="p12black" align="left"><SPAN class="p9orange">功能--&gt;新闻中心--&gt;
																				<asp:Label id="lbMessage" runat="server"></asp:Label></SPAN><IMG language="javascript" id="imgHelp1" style="CURSOR: pointer" onclick="return imgHelp_onclick()"
																				alt="帮助" src="../Images/Admin/helpicon.gif"></TD>
																		<TD align="right" width="50"><!--BUTTON_BEGIN-->
																			<TABLE>
																				<TR>
																					<TD vAlign="bottom" noWrap>
																						<asp:ImageButton id="ibtReturn" runat="server" ImageUrl="../Images/Admin/fb-cancel.gif" CausesValidation="False"></asp:ImageButton>返回
																					</TD>
																				</TR>
																			</TABLE> <!--BUTTON_END--></TD>
																	</TR>
																</TABLE>
															</TD>
														</TR>
													</TABLE>
													<TABLE cellSpacing="1" cellPadding="5" width="650" align="center" bgColor="#cccccc" border="0">
														<TR bgColor="#ffffff">
															<TD align="right">新闻标题：</TD>
															<TD class="pad" width="70%">
																<asp:textbox id="txtNewsTitle" runat="server" CssClass="wenbenkuang" Width="300px" MaxLength="100"></asp:textbox>
																<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txtProductName" Display="Dynamic"
																	ErrorMessage="请输入商品名称" ForeColor="#FF0000"></asp:requiredfieldvalidator>**</FONT></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">新闻类别：</TD>
															<TD class="pad"></FONT>
																<asp:dropdownlist id="drlClass" runat="server" AutoPostBack="True"></asp:dropdownlist></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">新闻专题：</TD>
															<TD class="pad">
																<asp:DropDownList id="drlSpecial" runat="server"></asp:DropDownList></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">外部链接：</TD>
															<TD class="pad" width="70%">
																<asp:textbox id="txtOutLink" runat="server" CssClass="wenbenkuang" Width="400px" MaxLength="100"></asp:textbox></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">新闻简介：</TD>
															<TD class="pad" width="70%">
																<asp:textbox id="txtExplain" runat="server" CssClass="wenbenkuang" Width="400px" MaxLength="150"></asp:textbox></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">标题图片地址：</TD>
															<TD class="pad">
																<asp:textbox id="txtTitlePic" runat="server" CssClass="wenbenkuang" Width="260px" MaxLength="70"></asp:textbox><INPUT language="javascript" class="go-wenbenkuang" onclick="return selsmallpic()" type="button"
																	value="选择、上传图片" name="selsmallpic1"></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">内容：</TD>
															<TD class="pad">
																<FTB:FreeTextBox id="ftbContent" runat="server" ImageGalleryPath="BookPic" ToolbarType="OfficeXP"
																	width="540px"></FTB:FreeTextBox></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">新闻时间：</TD>
															<TD class="pad">
																<asp:TextBox id="txtNewsTime" runat="server" CssClass="wenbenkuang"></asp:TextBox>(格式：yyyy-mm-dd 
																hh:mm:ss)
																<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ControlToValidate="txtNewsTime"
																	Display="Dynamic" ErrorMessage="请输入指定格式时间" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">参数：</TD>
															<TD class="pad">
																<asp:checkbox id="ckBigNews" runat="server" Text="头条新闻" Checked="True"></asp:checkbox>
																<asp:checkbox id="ckIsHilit" runat="server" Text="标题醒目"></asp:checkbox>
																<asp:checkbox id="ckIsLockTop" runat="server" Text="固顶"></asp:checkbox>
																<asp:checkbox id="ckIsReview" runat="server" Text="开启评论"></asp:checkbox></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">可浏览群体：</TD>
															<TD class="pad"></FONT>
																<asp:CheckBoxList id="cklReadership" runat="server"></asp:CheckBoxList></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">来源：</TD>
															<TD class="pad">
																<asp:textbox id="txtNewsSource" runat="server" CssClass="wenbenkuang" Width="200px" MaxLength="50"></asp:textbox></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">作者：</TD>
															<TD class="pad">
																<asp:textbox id="txtNewsAuthor" runat="server" CssClass="wenbenkuang" Width="200px" MaxLength="50"></asp:textbox></TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right">新闻关键字：</TD>
															<TD class="pad">
																<asp:textbox id="txtNewsKey" runat="server" CssClass="wenbenkuang" Width="200px" MaxLength="50"></asp:textbox>（多个关键字用竖线 
																"|" 分割）</TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="right" width="20%"></TD>
															<TD class="pad">&nbsp;
																<asp:button id="btSubmit" runat="server" CssClass="go-wenbenkuang" Text="提交信息"></asp:button>
																<asp:button id="btSaveUpdate" runat="server" CssClass="go-wenbenkuang" Text="更新信息"></asp:button>&nbsp;&nbsp;
															</TD>
														</TR>
														<TR bgColor="#ffffff">
															<TD align="center" colSpan="2">
																<asp:Label id="lbResult" runat="server" ForeColor="Red"></asp:Label></TD>
														</TR>
													</TABLE>
												</asp:panel>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
					<td width="1%" background="../Images/Admin/right.gif" height="319">&nbsp;</td>
				</tr>
				<tr>
					<td width="1%"><img src="../Images/Admin/lb.gif" width="9" height="9"></td>
					<td width="98%" background="../Images/Admin/bottom.gif"><img src="../Images/Admin/spacer.gif" width="1" height="1"></td>
					<td width="1%"><img src="../Images/Admin/rb.gif" width="9" height="9"></td>
				</tr>
			</table>
			<asp:PlaceHolder id="PlaceHolder2" runat="server"></asp:PlaceHolder>
		</form>
	</body>
</HTML>
