<%@ Page Title="新闻聚焦" Language="C#" MasterPageFile="~/Manager/Manger.Master" EnableEventValidation="true" ValidateRequest="false" AutoEventWireup="true" CodeBehind="MNews.aspx.cs" Inherits="Stat.web.Manerger.MNews" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
$(document).ready(function(){
 
 $("input[name$='btnEditSave']").bind('click',CheckFrom); 
 $("a:contains('删除')").bind('click',function(){return confirm('确认要删除吗？');}); 
 
});

 function CheckFrom()
 {
     var title=$("input[name$='txtTitle']").val();  
    if(!CheckLength(title, 1)){alert("标题不能为空！");$("input[name$='txtTitle']").focus();return false;}  
 }
</script>
<script type="text/javascript" charset="utf-8" src="../kindeditor/kindeditor.js"></script>
<%=js_Ke %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpTop" runat="server">
<div style="margin-top: 5px;">
   当前位置：信息管理 &gt; 新闻聚焦
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpMSG" runat="server">
 <span class="M_b14">小贴士：</span> 你可以管理 新闻聚焦。如果 “编辑器”无法展开，请按 “F5” 。
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cpMain" runat="server">
<br />
       <table align="left" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td valign="top" align="center">
                    <asp:Panel ID="pnWebList" runat="server" BackColor="White"  Width="100%">
                        <asp:GridView ID="gvWebList" runat="server" AutoGenerateColumns="False" EmptyDataText="没有找到，请添加"
                            GridLines="None" Width="100%" BorderColor="#CEDFEF" BorderWidth="1px" 
                            onrowdatabound="gvWebList_RowDataBound" onrowdeleting="gvWebList_RowDeleting" 
                            onrowediting="gvWebList_RowEditing" CssClass="tableBorder">
                            <Columns>
                                <asp:BoundField DataField="id" HeaderText="ID" SortExpression="WebId">
                                    <HeaderStyle Height="25px" Font-Size="12px" />
                                    <ItemStyle Width="50px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="title" HeaderText="新闻标题" 
                                    SortExpression="WebName" >
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="推荐" SortExpression="WebUrl">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# IsTop(Eval("isTop")) %>'></asp:Label>
                                    </ItemTemplate>                
                                    <HeaderStyle HorizontalAlign="Left" />
                                    <ItemStyle Width="30px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="状态" >
                                    <ItemTemplate >
                                        <asp:Label ID="Label1" runat="server" Text='<%# IsPass(Eval("IsPass")) %>'></asp:Label>                                      
                                    </ItemTemplate>
                                    <ItemStyle Width="50px" CssClass="forumRow" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:ButtonField CommandName="Edit" Text="编辑">
                                    <ItemStyle Width="40px" HorizontalAlign="Center" />
                                </asp:ButtonField>
                                <asp:CommandField ShowDeleteButton="True">
                                    <ItemStyle Width="40px" HorizontalAlign="Center" />
                                </asp:CommandField>
                            </Columns>                            
                            <HeaderStyle BackColor="#E9F1FA" Height="20px" />
                        </asp:GridView>
                        <br /><br />
                        
                        <asp:Literal ID="ltrPageIndex" runat="server"></asp:Literal>
                        
                        
                        
                        
                       </asp:Panel>
                    <asp:Panel ID="pnEditWeb" runat="server" BackColor="White" Visible="False"
                        Width="100%">
                        <table bgcolor="#cedfef" border="0" cellpadding="0" cellspacing="1" class="padding" width="100%">
                            <tr>
                                <td  colspan="2" style="height: 26px" bgcolor="#e9f1fa" height="25">
                                    <strong><span style="font-size: 12pt">
                                    添加/修改新闻</span></strong></td>
                            </tr>
                            <tr>
                                <td style="width: 165px; height: 25px; text-align: right" bgcolor="#FFFFFF">
                                   新闻标题：</td>
                                <td style="width: 512px; height: 25px; text-align: left" bgcolor="#FFFFFF">
                                    <asp:TextBox ID="txtTitle" runat="server" Width="304px"></asp:TextBox>
                                    </td>
                            </tr>
                            <tr style="color: #000000">
                                <td style="width: 165px; height: 26px; text-align: right" bgcolor="#FFFFFF">
                                    新闻来源：</td>
                                <td style="width: 512px; height: 26px; text-align: left" bgcolor="#FFFFFF">
                                    <asp:TextBox ID="txtSource" runat="server" Width="304px"></asp:TextBox>
                                    </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#FFFFFF" style="width: 165px; height: 26px; text-align: right">
                                    新闻作者：</td>
                                <td bgcolor="#FFFFFF" style="width: 512px; height: 26px; text-align: left">
                                   <asp:TextBox ID="txtAutro" runat="server" Width="304px"></asp:TextBox>   
                                </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#ffffff" style="width: 165px;text-align: right">
                                    新闻内容：</td>
                                <td bgcolor="#ffffff" style="text-align: left">
<div class="editor">
   <textarea runat="server" id="content1" name="content" style="width:700px;height:400px;visibility:hidden;"></textarea>
</div>
                           </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#ffffff" style="width: 165px; height: 26px; text-align: right">
                                    是否推荐：</td>
                                <td bgcolor="#ffffff" style="width: 512px; height: 26px; text-align: left">
                                    <asp:RadioButtonList ID="rBtnIsTop" runat="server" 
                                        RepeatDirection="Horizontal">
                                        <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                                        <asp:ListItem Value="0">否</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#ffffff" style="width: 165px; height: 26px; text-align: right">
                                    立即发布：</td>
                                <td bgcolor="#ffffff" style="width: 512px; height: 26px; text-align: left">
                                    <asp:RadioButtonList ID="rBtnIsPass" runat="server" 
                                        RepeatDirection="Horizontal">
                                        <asp:ListItem Selected="True" Value="1">发布</asp:ListItem>
                                        <asp:ListItem Value="0">草稿</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 26px" bgcolor="#FFFFFF">
                                    &nbsp;<asp:Button ID="btnEditSave" runat="server" OnClick="btnEditSave_Click" 
                                        Text="保存数据" />
                                    <asp:HiddenField ID="hdfId" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table> 
</asp:Content>
