<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Channel, HoWaveIMSV5.0" title="频道管理首页" %>
<%@ 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="~/Images/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>
 <fieldset>
     <legend>频道列表显示</legend>
     <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>                          
            <asp:GridView 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>                  
</fieldset>
   <asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
               <center>
                   <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" DefaultMode="Insert" Width="500px">
                       <InsertItemTemplate>
                           <table class="adminlist">
                              <tr>
                                  <td style=" width:30%; text-align:left">频道名称：</td>
                                  <td align="left"><asp:TextBox ID="ChannelName1" Text='<%# Bind("ChannelName") %>' runat="server" />*
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请填写频道名称" ControlToValidate="ChannelName1"/>
                                  </td>
                              </tr>
                              <tr>
                                  <td style=" width:30%; text-align:left">频道说明：</td>
                                  <td align="left"><asp:TextBox ID="ChannelIntro" Text='<%# Bind("ChannelIntro") %>' runat="server" />                                   
                                  </td>
                              </tr>
                              <tr>
                                  <td style=" width:30%; text-align:left">开启频道：</td>
                                  <td align="left"><asp:RadioButtonList ID="RadioButtonList2" SelectedValue='<%# Bind("Status") %>' 
                                       runat="server" RepeatDirection="Horizontal" >
                                         <asp:ListItem Text="不开启" Value="0"></asp:ListItem> 
                                         <asp:ListItem Text="开启" Value="1" Selected="True"></asp:ListItem>
                                      </asp:RadioButtonList>
                                   </td>
                              </tr>
                               <tr>
                                  <td style=" width:30%; text-align:left">开启频道图片功能：</td>
                                  <td align="left"> 
                                      <asp:RadioButtonList ID="EnableChannelPic1" SelectedValue='<%# Bind("EnableChannelPic") %>' 
                                           runat="server" RepeatDirection="Horizontal">
                                         <asp:ListItem Text="不开启" Value="0" Selected="True"></asp:ListItem> 
                                         <asp:ListItem Text="开启" Value="1"></asp:ListItem>
                                      </asp:RadioButtonList>
                                  </td>
                              </tr>
                               <tr>
                                  <td style=" width:30%; text-align:left">频道图片地址</td>
                                  <td align="left"><asp:TextBox ID="TextBox1" Text='<%# Bind("ChannelPicUrl") %>' runat="server" /></td>
                              </tr>
                               <tr>
                                  <td style=" width:30%; text-align:left">频道地址</td>
                                  <td align="left"><asp:TextBox ID="ChannelURL" Text='<%# Bind("ChannelURL") %>' runat="server"  CssClass="unwatermarked"/>*
                                      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请填写频道地址" ControlToValidate="ChannelURL"/>
                                  </td>
                              </tr>
                               <tr>
                                  <td style=" width:30%; text-align:left">频道打开类型</td>
                                  <td align="left">
                                      <asp:DropDownList ID="RadioButtonList1" SelectedValue='<%# Bind("ChannelOpenType") %>' runat="server" >
                                         <asp:ListItem Text="在原窗口打开" Value="0"></asp:ListItem> 
                                         <asp:ListItem Text="在新窗口打开" Value="1"></asp:ListItem>
                                      </asp:DropDownList>
                                  </td>
                              </tr>
                              <tr>
                                  <td>&nbsp;</td>
                                  <td style="text-align:left">
                                     <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Insert" Text="插入" /> 
                                     <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消" />
                                  </td>
                              </tr>                              
                           </table>
                           <ajaxToolkit:TextBoxWatermarkExtender ID="wbw1" runat="server" TargetControlID="ChannelURL" WatermarkText="http://" WatermarkCssClass="watermarked" />                              
                          
                       </InsertItemTemplate>
                   </asp:FormView>
                    
                </center>

            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>
   <ajaxToolkit:PopupControlExtender ID="Pc1" runat="server" TargetControlID="AddNewChannel" PopupControlID="Panel1" Position="Left" /> 
   <ajaxToolkit:DropShadowExtender ID="Ds1" runat="server" TargetControlID="Panel1" TrackPosition="true" />       
      
</asp:Content>

