<%@ page language="C#" validaterequest="false" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_Special, mallz" title="专题管理" enableeventvalidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" language="javascript">
function OpenFileList(boj){
    window.open("Admin_PageFileList.aspx?obj=ctl00_ContentPlaceHolder1_"+boj,"","width=500px; height=350px; help=no; scroll=no; status=no; edge=sunken;");
}
function EditFile(x){
    x = "ctl00_ContentPlaceHolder1_" + x;
    var inputvalue = document.getElementById(x).value;
    if(inputvalue=="")
        location.href = "Admin_Template.aspx?action=add&Dir=" + unescape(inputvalue);
    else
        location.href = "Admin_Template.aspx?action=modify&Dir=" + unescape(inputvalue);
}
</script>
 <table class="adminheading">
     <tr>
        <th valign="middle" class="templates"  align="left">商城专题管理</th>                  
        <td align="right">
        <div style="width:400px">
            <strong>管理导航：</strong>
            <a href="Admin_Special.aspx">商城专题管理首页</a> &nbsp;| 
            <a href="Admin_Special.aspx?tag=Add">添加商城专题</a>
            </div>
        </td>
     </tr>
  </table> 
  
    <asp:Panel ID="Panel_List" runat="server" Width="100%">
          <table class="nick" style="display:none">
              <tr><td colspan="2" class="tit">专题列表</td></tr>
              <tr><td class="ltd">专题所属频道：</td><td class="rtd">
                <asp:DropDownList ID="DropChannel" runat="server" AutoPostBack="True" DataTextField="ChannelName" DataValueField="ChannelID" AppendDataBoundItems="True">
                <asp:ListItem Selected="True" Value="-1">所有</asp:ListItem>
                </asp:DropDownList></td>
              </tr>
          </table>
          
          <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" CssClass="adminlist" OnRowDataBound="GridView1_RowDataBound" >
                <Columns>
                    <asp:BoundField DataField="SpecialID" HeaderText="ID" HeaderStyle-Width="4%" />
                    <asp:TemplateField HeaderText="专题名称" ItemStyle-HorizontalAlign="Left" ItemStyle-Font-Bold="true">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" Target="_blank" NavigateUrl='<%# SiteSpecialDir +"Specail.aspx?ID="+ Eval("SpecialID") %>' Text='<%# Eval("SpecialName") %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="SpecialDir" DataFormatString='{0}.html' HeaderText="静态页路径" ItemStyle-HorizontalAlign="left" HeaderStyle-Width="30%" />
                    <asp:TemplateField HeaderText="打开方式" HeaderStyle-Width="8%" >
                        <ItemTemplate>
                            <asp:Literal ID="opentype" runat="server" Text='<%# (Eval("OpenType").ToString()=="1")?MallZ.Common.Language.GetAdminMsg("Special/OpenType/OpenType1"):MallZ.Common.Language.GetAdminMsg("Special/OpenType/OpenType0") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CheckBoxField DataField="IsElite"  HeaderText="推荐专题" HeaderStyle-Width="8%" />
                    <asp:CheckBoxField DataField="IsVisible"  HeaderText="显示" HeaderStyle-Width="8%" />
                    <asp:TemplateField HeaderText="操作" HeaderStyle-Width="13%">
                        <ItemTemplate>
                            <asp:HyperLink runat="server" ID="modifyBut" NavigateUrl='<%# "?SpecialID=" + Eval("SpecialID") +"&tag=update" %>' Text="修改" />
                            <asp:LinkButton runat="server" ID="createBut" PostBackUrl='<%# "?CreateHtml=CreateHtml&SpecialID=" + Eval("SpecialID") %>' OnClientClick="return confirm('确定后将生成静态页面，确定执行吗？')" Text="生成" />
                            <asp:LinkButton ID="deleteBut" runat="server" CommandName="Select" OnClientClick="if(confirm('确定删除吗？'))return true;return false; " Text="删除" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                <tr>
                    <th scope="col">专题编号</th><th scope="col">专题名称</th><th scope="col">专题目录</th><th scope="col">打开方式</th><th scope="col">推荐专题</th><th scope="col">专题提示</th><th scope="col">修改</th><th scope="col">生成静态页面</th><th scope="col">删除</th>                   
                </tr>
                <tr>
                   <td colspan="9" style="text-align:center; line-height:20px;">暂无记录！</td>
                </tr>
                </EmptyDataTemplate>
                <PagerTemplate>
                     共 <asp:Literal runat="server" ID="allre" Text="0" /> 条记录
                     <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex>0 %>">首页</asp:LinkButton>
                     <asp:LinkButton ID="LinkButton4" runat="server" CommandName="Page" CommandArgument="Prev" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex>0 %>">上一页</asp:LinkButton>
                     <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Page" CommandArgument="Next" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex<((GridView)Container.Parent.Parent).PageCount-1 %>">下一页</asp:LinkButton>
                     <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Last" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex<((GridView)Container.Parent.Parent).PageCount-1 %>">尾页</asp:LinkButton>&nbsp;
                     页次：<asp:Literal ID="Label2" runat="server" Text='<%#((GridView)Container.Parent.Parent).PageIndex+1 %>'/>/<asp:Literal ID="Label3" runat="server" Text='<%#((GridView)Container.Parent.Parent).PageCount %>' />页&nbsp;
                     <asp:Literal ID="Label4" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageSize%>'/>记录/页
                </PagerTemplate>
          </asp:GridView>
    </asp:Panel>
    
    <asp:Panel ID="Panel_EditADD" runat="server" Width="100%">
       <table class="nick">
           <tr>
           <td colspan="2" class="tit">编辑商城专题</td></tr>
           <tr>
              <td class="ltd">专题名称：</td>
              <td class="rtd"><div style="float:left;">
                 <asp:TextBox  MaxLength="50"  ID="SpecialName" runat="server"  Width="270px" /></div><div style="float:left;">
                 <asp:RequiredFieldValidator ID="rfv1" runat="server" ErrorMessage="专题名称不能空" ControlToValidate="SpecialName"/></div>
              </td>
           </tr>
           <tr>
              <td class="ltd">生成静态页路径：</td>
              <td class="rtd">
                 <asp:TextBox MaxLength="50" ID="SpecialDir" runat="server" Width="270px"/><asp:Label Text=".htm" ID="FileSuffix" runat="server"/></asp:Label> <span style="color:Red">（若有目录，请以“/”分隔。为了系统稳定，请使用数字或英文字母）</span><asp:RequiredFieldValidator ID="rfv2" runat="server" ErrorMessage="不能为空" ControlToValidate="SpecialDir"/>
               </td>
            </tr>   
           <tr>
                <td class="ltd">专题图片：</td>
                <td class="rtd">
                    <input id="SpecialPicUrl" maxlength="200" name="SpecialPicUrl" size="49" runat="server" />
                </td>
            </tr>
           <tr>
                <td class="ltd">打开方式：</td>
                <td class="rtd">
                    <asp:RadioButtonList ID="RBTOpenType" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="1" Selected="True">新窗口</asp:ListItem>
                        <asp:ListItem Value="0">原窗口</asp:ListItem>
                    </asp:RadioButtonList></td>
            </tr>
           <tr>
                <td class="ltd">是否为推荐专题：</td>
                <td class="rtd">
                    <asp:CheckBox ID="CBIsElite" runat="server" Text="是否为推荐专题" /></td>
            </tr>
            <tr>
                <td class="ltd">是否在导航显示：</td>
                <td class="rtd">
                    <asp:CheckBox ID="IsVisible" runat="server"  Text="在导航中可见" /> (数据库对应字段 IsVisible )</td>
            </tr>
           <tr>
                <td class="ltd">专题提示：</td>
                <td class="rtd">
                    <textarea id="Tips" MaxLength="255" cols="60" name="Tips" rows="3" runat="server"/>鼠标移至专题名称上时将显示设定的提示文字（不支持HTML）</td>
            </tr>
           <tr>
                <td class="ltd">专题说明：</td>
                <td class="rtd">
                    <textarea id="Readme" cols="60" name="Readme" rows="3" runat="server"></textarea>用于专题页对专题进行说明（支持HTML）</td>
            </tr>
           <tr style="display:none;">
                <td class="ltd">每页显示的商品数：</td>
                <td class="rtd">
                    <select id="MaxPerPage" runat="server">
                        <option value="20"></option>
                    </select>
                </td>
            </tr>
           <tr>
                <td class="ltd">默认配色风格：</td>
                <td class="rtd" id="Skin_ID">
                    <asp:DropDownList ID="SkinID" runat="server" AppendDataBoundItems="True">
                      <asp:ListItem Value="0" Text="默认风格"></asp:ListItem>
                    </asp:DropDownList>
                   相关模板中包含CSS、颜色、图片等信息，如果不选择将采用默认方案下的风格
                </td>
            </tr>
           <tr>
                <td class="ltd">版面设计模板：</td>
                <td class="rtd">
                <asp:TextBox ID="Template" runat="server" Width="400" /><input id="but1" name="but1" type="button" value="浏 览" onclick="return OpenFileList('Template')" /> <input name="Button36" type="button" id="Button36" value="编辑模版" onclick="return EditFile('Template')" /> (留空表示使用默认模板)</td>
            </tr>          
            <tr>
                <td class="btm" colspan="2">
            	<asp:Button ID="Butadd" runat="server" Text="添 加" OnClick="Butadd_Click" />
            	<asp:Button ID="ButUpdate" runat="server" Text="修 改" OnClick="ButUpdate_Click" />
            	<input name="Butcancel" value="返 回" type="button" onclick="history.back()" />	            
                </td>
            </tr>          
        </table>
	<div class="adminlist"></table>
    </asp:Panel>


</asp:Content>
