<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Page, HoWaveVGO" title="自定义页面管理" validaterequest="false" enableEventValidation="false" %>
<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/Function.js" type="text/javascript"></script>

    <table class="adminheading">                       
          <tr>
            <th class="sections" nowrap="nowrap">自定义页面管理</th>
            <td align="right">
            <div style="width:500px">
                <b>管理导航：</b>&nbsp;
                <a href="Admin_ManagePage.aspx">自定义页面管理首页</a>&nbsp;|&nbsp;
                <a href="Admin_ManagePage.aspx?Action=AddPageClass">添加自定义页面分类</a>&nbsp;|&nbsp;
                <a href="Admin_Page.aspx">添加自定义页面</a>
            </div>
            </td>
            <td class="rtdw"></td>
          </tr>                        
    </table> 
     
      <asp:FormView ID="FormView1" runat="server" DataKeyNames="DefaultPageID" DataSourceID="ObjectDataSource1" Width="100%" DefaultMode="Insert" OnItemInserted="FormView1_ItemInserted" OnItemUpdated="FormView1_ItemUpdated">
          <EditItemTemplate>                                   
               <table width="100%" class="nick" cellpadding="1" cellspacing="1" border="0">
                <tr>
                    <td class="tit" colspan="2">
                        <strong>自定义页面</strong>
                    </td>
                </tr>
                <tr>
                      <td class="ltd">页面ID：</td>
                      <td class="rtd">
                         <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DefaultPageID") %>' CssClass="text_Mutline"/></td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面名称：</td>
                      <td class="rtd">
                         <asp:TextBox ID="DefaultPageName" runat="server" Text='<%# Bind("DefaultPageName") %>' CssClass="text_Mutline"/></td>                      
                    </tr>
                    <tr>
                      <td class="ltd">所属分类：</td>
                      <td class="rtd">
                         <asp:DropDownList ID="DefaultPageType" runat="server" DataSourceID="ObjectDataSource2" DataTextField="ClassName" DataValueField="ID" SelectedValue='<%# Bind("DefaultPageType") %>'>                          
                         </asp:DropDownList>
                      </td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面类型：</td>
                      <td class="rtd">
                         <asp:DropDownList ID="DefaultPageKind" runat="server" SelectedValue='<%# Bind("DefaultPageKind") %>'>
                            <asp:ListItem Text="html" Value="html" />                           
                            <asp:ListItem Text="aspx" Value="aspx" />
                            <asp:ListItem Text="asp" Value="asp"/>
                            <asp:ListItem Text="txt" Value="txt"/>
                         </asp:DropDownList>                               
                    </tr>
                    <tr>
                      <td class="ltd">页面路径：</td>
                      <td class="rtd">
                         <asp:TextBox ID="DefaultPageURL" runat="server" Text='<%# Bind("DefaultPageURL") %>' CssClass="text_Mutline"/>不写表示根目录,后面不能包含"/"</td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面简介：</td>
                      <td class="rtd">
                         <asp:TextBox ID="DefaultPageIntro" runat="server" Text='<%# Bind("DefaultPageIntro") %>' 
                            TextMode="MultiLine" Width="500px" Height="100px" CssClass="text_Mutline"/></td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面内容：</td>
                      <td class="rtd">
                        <span style="color:Red">切换从代码模式切换为设计模式时会丢失<html><head><body>的代码，请先保存后切换</span>                       
                           
                             <fckeditorv2:FCKeditor ID="DefaultPageContent" runat="server" Value='<%# Bind("DefaultPageContent") %>'  AutoDetectLanguage="true" BasePath="../FCKEditor/" Height="200px" Width="90%" ></fckeditorv2:FCKeditor>     
                      </td>                      
                    </tr>
                    </table> 
                      <div style="text-align:center">                        
                         <asp:LinkButton ID="button1" CommandName="Update" CausesValidation="true" runat="server" Text="更新"/>
                         <asp:LinkButton ID="button2" CommandName="Cancle" CausesValidation="false" runat="server"  Text="取消"/>
                      </div>
              
          </EditItemTemplate>
          <InsertItemTemplate>
              <table width="100%" class="nick" cellpadding="1" cellspacing="1" border="0">
                <tr>
                    <td class="tit" colspan="2">
                        <strong>新添自定义页面</strong>
                    </td>
                </tr>
                <tr>
                      <td class="ltd"><div style="width:70px">页面名称：</div></td>
                      <td class="rtd">
                         <asp:TextBox ID="DefaultPageName" runat="server" Text='<%# Bind("DefaultPageName") %>' CssClass="text_Mutline"/></td>                      
                    </tr>
                    <tr>
                      <td class="ltd">所属分类：</td>
                      <td class="rtd">
                         <asp:DropDownList ID="DefaultPageType" runat="server" DataSourceID="ObjectDataSource2" DataTextField="ClassName" DataValueField="ID" SelectedValue='<%# Bind("DefaultPageType") %>'>                           
                         </asp:DropDownList>
                      </td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面类型：</td>
                      <td class="rtd">
                         <asp:DropDownList ID="DefaultPageKind" runat="server" SelectedValue='<%# Bind("DefaultPageKind") %>'>
                            <asp:ListItem Text="html" Value="html" />                           
                            <asp:ListItem Text="aspx" Value="aspx" />
                            <asp:ListItem Text="asp" Value="asp"/>
                            <asp:ListItem Text="txt" Value="txt"/>                     
                         </asp:DropDownList>                               
                    </tr>
                    <tr>
                      <td class="ltd">页面路径：</td>
                      <td class="rtd">
                         <asp:TextBox ID="DefaultPageURL" runat="server" Text='<%# Bind("DefaultPageURL") %>' CssClass="text_Mutline" Width="200px"/>不写表示根目录,后面不能包含"/"</td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面简介：</td>
                      <td class="rtd">
                         <asp:TextBox ID="DefaultPageIntro" runat="server" Text='<%# Bind("DefaultPageIntro") %>' 
                            TextMode="MultiLine" Width="500px" Height="100px" CssClass="text_Mutline"/></td>                      
                    </tr>
                    <tr>
                      <td class="ltd">页面内容：</td>
                      <td class="rtd">
                         <span style="color:Red">切换从代码模式切换为设计模式时会丢失<html><head><body>的代码，请先保存后切换</span>                        
        
                             <fckeditorv2:FCKeditor ID="DefaultPageContent" runat="server" Value='<%# Bind("DefaultPageContent") %>'  AutoDetectLanguage="true" BasePath="../FCKEditor/" Height="200px" Width="90%" ></fckeditorv2:FCKeditor>     
                      </td>                      
                    </tr>
                    </table> 

                      <div style="text-align:center">                        
                         <asp:LinkButton ID="button1" CommandName="Insert" CausesValidation="true" runat="server" Text="保存并生成文件"/>
                         <asp:LinkButton ID="button2" CommandName="Cancle" CausesValidation="false" runat="server"  Text="取消"/>                         
                      </div>

              
          </InsertItemTemplate>          
          <EmptyDataTemplate><center>没有自定义页面</center></EmptyDataTemplate>
      </asp:FormView>   
      <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeletePage"
          InsertMethod="AddPage" SelectMethod="GetPages" TypeName="Howave_Page" UpdateMethod="UpdatePage">
          <DeleteParameters>
              <asp:Parameter Name="DefaultPageID" Type="Int32" />
          </DeleteParameters>
          <UpdateParameters>
              <asp:Parameter Name="DefaultPageID" Type="Int32" />
              <asp:Parameter Name="DefaultPageKind" Type="String" />
              <asp:Parameter Name="DefaultPageContent" Type="String" />
              <asp:Parameter Name="DefaultPageIntro" Type="String" />
              <asp:Parameter Name="DefaultPageName" Type="String" />
              <asp:Parameter Name="DefaultPageType" Type="Int32" />
              <asp:Parameter Name="DefaultPageURL" Type="String" />
          </UpdateParameters>
          <SelectParameters>
              <asp:QueryStringParameter Name="DefaultPageID" QueryStringField="DefaultPageID" Type="Int32" />
          </SelectParameters>
          <InsertParameters>
              <asp:Parameter Name="DefaultPageKind" Type="String" />
              <asp:Parameter Name="DefaultPageContent" Type="String" />
              <asp:Parameter Name="DefaultPageIntro" Type="String" />
              <asp:Parameter Name="DefaultPageName" Type="String" />
              <asp:Parameter Name="DefaultPageType" Type="Int32" />
              <asp:Parameter Name="DefaultPageURL" Type="String" />
          </InsertParameters>
      </asp:ObjectDataSource>
      <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetPageClass" TypeName="HowavePageClass"></asp:ObjectDataSource>
  
</asp:Content>

