<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Channel, HoWaveVGO" title="频道管理首页" enableEventValidation="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
   
<table class="adminheading">
   <tr>
      <th class="menus">频道管理</th> 
      <td style="width:15%; text-align:center;"><asp:Image ImageUrl="../IMS_Img/Manage/new.png"  AlternateText="新增频道" runat="server" id="AddNewChannel"  CssClass="Imagebutton"/><br />新增
       </td>  
   </tr>                
</table>
              
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteChannel" InsertMethod="AddChannel" SelectMethod="GetChannels" TypeName="ChannelBLL" UpdateMethod="UpdateChannel" >
     <DeleteParameters>
         <asp:Parameter Name="ChannelID" Type="Int32" />
     </DeleteParameters>
     <UpdateParameters>
         <asp:Parameter Name="ChannelName" Type="String" />
         <asp:Parameter Name="EnableChannelPic" Type="Int32" />
         <asp:Parameter Name="ChannelPicUrl" Type="String" />
         <asp:Parameter Name="ChannelIntro" Type="String" />
         <asp:Parameter Name="ChannelURl" Type="String" />
         <asp:Parameter Name="ChannelOpenType" Type="Int32" />
         <asp:Parameter Name="Status" Type="Int32" />
         <asp:Parameter Name="ChannelAccess" Type="Int32" />
         <asp:Parameter Name="Charge" Type="Int32" />
         <asp:Parameter Name="ChannelID" Type="Int32" />
     </UpdateParameters>
     <InsertParameters>
         <asp:Parameter Name="ChannelName" Type="String" />
         <asp:Parameter Name="EnableChannelPic" Type="Int32" />
         <asp:Parameter Name="ChannelPicUrl" Type="String" />
         <asp:Parameter Name="ChannelIntro" Type="String" />
         <asp:Parameter Name="ChannelURl" Type="String" />
         <asp:Parameter Name="ChannelOpenType" Type="Int32" />
         <asp:Parameter Name="Status" Type="Int32" />
         <asp:Parameter Name="ChannelAccess" Type="Int32" />
         <asp:Parameter Name="Charge" Type="Int32" />
     </InsertParameters>
 </asp:ObjectDataSource>

     <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>                          
            <asp:GridView  Height="200px" ID="GridView1" runat="server" CellPadding="4"  DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" 
            AllowPaging="True" AutoGenerateColumns="False"  CssClass="adminlist"  Width="100%"  DataKeyNames="ChannelID" RowStyle-HorizontalAlign="Center" OnRowDataBound="GridView1_RowDataBound" >                              
             <alternatingRowStyle BackColor="White" />
                <Columns>                                     
                 <asp:BoundField DataField="ChannelID" HeaderText="频道ID" InsertVisible="False" ReadOnly="True" SortExpression="ChannelID"/>                                     
                 <asp:BoundField DataField="ChannelName" HeaderText="频道名称" SortExpression="ChannelName" />  
                 <asp:TemplateField HeaderText="频道打开方式">
                    <ItemTemplate>
                       <asp:Literal ID="ChannelOpenType" runat="server" Text='<%# (Convert.ToInt32(Eval("ChannelOpenType"))==1)?"新窗口":"原窗口" %>' />
                    </ItemTemplate>
                 </asp:TemplateField>
                 <asp:BoundField HeaderText="频道目录/链接地址" />  
                    <asp:CommandField HeaderText="操作" ShowCancelButton="False" ShowDeleteButton="True" />
             </Columns>
            <RowStyle HorizontalAlign="Center" />
            <EmptyDataTemplate><div style="text-align:center; padding-top:10px;">暂无频道</div></EmptyDataTemplate>
         </asp:GridView>                                 
     </ContentTemplate>
   </asp:UpdatePanel>                  

   <asp:Panel ID="Panel1"  runat="server" CssClass="popupControl">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate >
<asp:FormView id="FormView1" runat="server" DataSourceID="ObjectDataSource1" DefaultMode="Insert"><InsertItemTemplate>
<TABLE style="MARGIN: 5px"><TBODY><TR><TD align=center colSpan=2><B>新增频道</B></TD></TR><TR><TD class="tdbg1" align=right width="30%">频道名称：</TD><TD class="tdbg2" width="70%"><asp:TextBox id="ChannelName1" runat="server" Text='<%# Bind("ChannelName") %>'></asp:TextBox>* <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ControlToValidate="ChannelName1" ErrorMessage="请填写频道名称"></asp:RequiredFieldValidator> </TD></TR><TR><TD class="tdbg1" align=right width="30%">频道说明：</TD><TD class="tdbg2" width="70%"><asp:TextBox id="ChannelIntro" runat="server" Text='<%# Bind("ChannelIntro") %>'></asp:TextBox> </TD></TR><TR><TD class="tdbg1" align=right width="30%">开启频道：</TD><TD class="tdbg2" width="70%"><asp:RadioButtonList id="RadioButtonList2" runat="server" RepeatDirection="Horizontal" SelectedValue='<%# Bind("Status") %>'>
                                         <asp:ListItem Text="不开启" Value="0"></asp:ListItem> 
                                         <asp:ListItem Text="开启" Value="1" Selected="True"></asp:ListItem>
                                      </asp:RadioButtonList> </TD></TR><TR><TD class="tdbg1" align=right width="30%">开启频道图片功能：</TD><TD class="tdbg2" width="70%"><asp:RadioButtonList id="EnableChannelPic1" runat="server" RepeatDirection="Horizontal" SelectedValue='<%# Bind("EnableChannelPic") %>'>
                                         <asp:ListItem Text="不开启" Value="0" Selected="True"></asp:ListItem> 
                                         <asp:ListItem Text="开启" Value="1"></asp:ListItem>
                                      </asp:RadioButtonList> </TD></TR><TR><TD class="tdbg1" align=right width="30%">频道图片地址</TD><TD class="tdbg2" width="70%"><asp:TextBox id="TextBox1" runat="server" Text='<%# Bind("ChannelPicUrl") %>'></asp:TextBox></TD></TR><TR><TD class="tdbg1" align=right width="30%">频道地址</TD><TD class="tdbg2" width="70%"><asp:TextBox id="ChannelURL" runat="server" CssClass="unwatermarked" Text='<%# Bind("ChannelURL") %>'></asp:TextBox>* <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="ChannelURL" ErrorMessage="请填写频道地址"></asp:RequiredFieldValidator> </TD></TR><TR><TD class="tdbg1" align=right width="30%">频道打开类型</TD><TD class="tdbg2" width="70%"><asp:DropDownList id="RadioButtonList1" runat="server" SelectedValue='<%# Bind("ChannelOpenType") %>'>
                                         <asp:ListItem Text="在原窗口打开" Value="0"></asp:ListItem> 
                                         <asp:ListItem Text="在新窗口打开" Value="1"></asp:ListItem>
                                      </asp:DropDownList> </TD></TR><TR><TD class="tdbg1" align=right colSpan=2><asp:LinkButton id="LinkButton1" runat="server" Text="插入" CommandName="Insert" CausesValidation="True"></asp:LinkButton> <asp:LinkButton id="LinkButton2" runat="server" Text="取消" CommandName="Cancel" CausesValidation="False"></asp:LinkButton></TD></TR><TR><TD align=center colSpan=2>&nbsp; </TD></TR></TBODY></TABLE><ajaxToolkit:TextBoxWatermarkExtender id="wbw1" watermarkText="http://" runat="server" TargetControlID="ChannelURL" WatermarkCssClass="watermarked"></ajaxToolkit:TextBoxWatermarkExtender> 
</InsertItemTemplate>
</asp:FormView> 
</ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>
   <ajaxToolkit:PopupControlExtender ID="Pc1" runat="server" TargetControlID="AddNewChannel" PopupControlID="Panel1"  Position="center"/> 
   <ajaxToolkit:DropShadowExtender ID="Ds1" runat="server" TargetControlID="Panel1" TrackPosition="true" />       
      
</asp:Content>