<%@ page language="C#" validaterequest="false" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Special, HoWaveVGO" title="专题管理" enableeventvalidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
 <script 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;");
}
</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="Panel1" 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" DataSourceID="ObjectDataSource4"
                        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" DataSourceID="ObjectDataSource5" Width="100%" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                 CssClass="adminlist" OnRowDataBound="GridView1_RowDataBound" OnDataBound="GridView1_DataBound">
                <Columns>
                    <asp:BoundField DataField="SpecialID" HeaderText="专题编号"  />
                    <asp:TemplateField HeaderText="专题名称">
                        <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="静态页路径" />
                    <asp:BoundField DataField="OpenType" HeaderText="打开方式" />
                    <asp:CheckBoxField DataField="IsElite" HeaderText="推荐专题" />
                    <asp:BoundField DataField="ReadMe" HeaderText="专题提示"/>
                    <asp:HyperLinkField DataNavigateUrlFields="SpecialID" DataNavigateUrlFormatString="?SpecialID={0}&amp;tag=update"
                        HeaderText="修改" Text="修改" />
                    <asp:HyperLinkField DataNavigateUrlFields="SpecialID" DataNavigateUrlFormatString="?CreateHtml=CreateHtml&amp;SpecialID={0}"
                        HeaderText="生成静态页面" Text="生成静态页面" />
                        <asp:TemplateField HeaderText="删除">
                          <ItemTemplate>
                             <asp:LinkButton ID="cl" runat="server" CommandName="Select" OnClientClick="if(confirm('确定删除吗？'))return true;return false; " Text="删除"></asp:LinkButton>
                          </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>
            </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" SelectMethod="GetChannels"  TypeName="ChannelBLL"/>
            <asp:ObjectDataSource ID="ObjectDataSource5" runat="server" DeleteMethod="DeleteSpecial"
                SelectMethod="GetSpecialByChannel" TypeName="SpecialBll" UpdateMethod="UpdateSpecial" OldValuesParameterFormatString="original_{0}">
                <DeleteParameters>
                    <asp:Parameter Name="SpecialID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Custom_Content" Type="String" />
                    <asp:Parameter Name="IsElite" Type="Boolean" />
                    <asp:Parameter Name="ChannelID" Type="Int32" />
                    <asp:Parameter Name="OpenType" Type="Int32" />
                    <asp:Parameter Name="Tips" Type="String" />
                    <asp:Parameter Name="ReadMe" Type="String" />
                    <asp:Parameter Name="SkinID" Type="Int32" />
                    <asp:Parameter Name="SpecialDir" Type="String" />
                    <asp:Parameter Name="SpecialName" Type="String" />
                    <asp:Parameter Name="SpecialPicUrl" Type="String" />
                    <asp:Parameter Name="TemplateID" Type="Int32" />
                    <asp:Parameter Name="MaxPerPage" Type="Int32" />
                    <asp:Parameter Name="SpecialID" Type="Int32" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="DropChannel" DefaultValue="40" Name="ChannelID"
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
    </asp:Panel>
    <asp:Panel ID="Panel3" runat="server" Width="100%">
        <table class="nick" cellpadding="1" cellspacing="1" border="0">
            <tr>
                <td class="tit">合并商品专题</td>
            </tr>
            <tr>
                <td class="ltd">
                    <form action="Admin_Special.asp" method="post" name="myform" onsubmit="return ConfirmUnite();">
                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ObjectDataSource11"
                            DataTextField="Channelname" AutoPostBack="true" DataValueField="ChannelID" Visible="false">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource11" runat="server" SelectMethod="GetChannels"   TypeName="ChannelBLL"/>
                        &nbsp; 将专题&nbsp;
                        <asp:DropDownList ID="FromSpecial" runat="server" DataSourceID="ObjectDataSource9"  DataTextField="SpecialName" DataValueField="SpecialID">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource9" runat="server" SelectMethod="GetSpecialByChannel"
                            TypeName="SpecialBll" OldValuesParameterFormatString="original_{0}">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="40" Name="ChannelID"
                                    PropertyName="SelectedValue" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        合并到
                        <asp:DropDownList ID="ToSpecial" runat="server" DataSourceID="ObjectDataSource10"
                            DataTextField="SpecialName" DataValueField="SpecialId">
                        </asp:DropDownList><asp:ObjectDataSource ID="ObjectDataSource10" runat="server" SelectMethod="GetSpecialByChannel"
                            TypeName="SpecialBll" OldValuesParameterFormatString="original_{0}">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="40" Name="ChannelID"
                                    PropertyName="SelectedValue" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                      
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="合并专题" />
                        &nbsp;&nbsp;
                        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="取消　" />
                     </form>
                </td>
            </tr>
            <tr>
                <td>&nbsp;
                    <b>注意事项：</b><br />
                    <ul style=" word-spacing:2px; line-height:25px">
                      <li>所有操作不可逆，请慎重操作！！！</li><li>不能在同一个专题内进行操作。</li><li>合并后您所指定的专题将被删除，所有商品将转移到目标专题中。</li></ul>
               </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" Width="100%">
       <table class="nick" cellpadding="1" cellspacing="1" border="0">
           <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">
                 网站根目录 / <%=SiteSpecialDir %> / <asp:TextBox MaxLength="50" ID="SpecialDir" runat="server" Width="270px"/>.html <span style="color:Red">（若有目录，请以“/”分隔）</span>
                 <asp:RequiredFieldValidator ID="rfv2" runat="server" ErrorMessage="不能为空" ControlToValidate="SpecialDir" Display="Dynamic"/>
               </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="在导航中可见" /></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"/>
                   相关模板中包含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')" />(留空表示使用默认模板)</td>
            </tr>          
             
          
        </table>
        <div class="div_btm">
            <asp:Button ID="Butadd" runat="server" Text="增加新的专题" OnClick="Butadd_Click" />
            <asp:Button ID="ButUpdate" runat="server" Text="保存修改结果" OnClick="ButUpdate_Click" />
            <asp:Button ID="Butcancel" runat="server" Text="取消" OnClick="Butcancel_Click" />
 </div>
    </asp:Panel>
     
    <div class="show_page">
        &nbsp;</div>
    <table style="width: 100%">
        <tr>
            <form action="Admin_Special.aspx" method="post" name="form1">
                <td  style="text-align:center;">
                </td>
            </form>
        </tr>
    </table>

</asp:Content>
