<%@ Page Language="C#" ValidateRequest="false" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="NewsView.aspx.cs" Inherits="LoveWeb.Admin.NewsView" %>


<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <h1>新闻修改编辑</h1>
     <div class="page_new">
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                    DataSourceID="objView" Height="237px" Width="522px" CellPadding="3" 
                    BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" 
                    BorderWidth="1px" AllowPaging="True" AutoGenerateDeleteButton="True" 
                    GridLines="Horizontal" DataKeyNames="Newsid">
                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                    <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                    <Fields>
                        <asp:BoundField DataField="Newsid" HeaderText="新闻编号" 
                            SortExpression="Newsid" ReadOnly="True" />
                        <asp:TemplateField HeaderText="新闻标题" SortExpression="Title">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Title") %>' 
                                    Height="28px" Width="209px"></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="TextBox6" runat="server" Height="33px" Width="257px"></asp:TextBox>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="新闻内容" SortExpression="News_contents">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox5" runat="server" Height="125px" 
                                    Text='<%# Bind("News_contents") %>' TextMode="MultiLine" Width="387px"></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <FCKeditorV2:FCKeditor ID="FCKeditor5" runat="server" Height="200px" 
                                    Width="100%">
                                </FCKeditorV2:FCKeditor>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("News_contents") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="新闻发布时间" SortExpression="Newstime">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Newstime") %>' CssClass="Wdate"  onClick="WdatePicker()"></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Newstime") %>' CssClass="Wdate" onClick="WdatePicker()"></asp:TextBox>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("Newstime") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:CommandField ShowEditButton="True" />
                    </Fields>
                    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <AlternatingRowStyle BackColor="#F7F7F7" />
                </asp:DetailsView>
                <asp:ObjectDataSource ID="objView" runat="server" 
                    SelectMethod="GetNewsByNewsid" TypeName="LoveBLL.NewsManager" 
                    DataObjectTypeName="Models.News" DeleteMethod="DelNews" InsertMethod="AddNews" 
                    UpdateMethod="UpdateNews">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
        
            
                添加新闻：<br />
            
                新闻标题：<asp:TextBox ID="btntitle" runat="server"></asp:TextBox>
    <br />
                新闻类型：<asp:DropDownList ID="dpl" runat="server" DataSourceID="ObjectDataSource1" 
                    DataTextField="News_cotename" DataValueField="News_coteid">
                <asp:ListItem Value="1">国际新闻</asp:ListItem>
                <asp:ListItem Value="2">国内新闻</asp:ListItem>
    </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                    SelectMethod="GetAllNewsCote" TypeName="LoveBLL.NewsCoteManagers">
                </asp:ObjectDataSource>
            <br />
             
                新闻发布时间：<asp:TextBox ID="newstime" runat="server" CssClass="Wdate" Text=" "  onClick="WdatePicker()"></asp:TextBox>
            <br />
                作者：<asp:TextBox ID="author" runat="server"></asp:TextBox>
    <br />
            
            <br />
                新闻内容编辑：<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server">
            </FCKeditorV2:FCKeditor>
            <asp:Button ID="Button1" runat="server" Text="提交" Height="26px" 
                onclick="Button1_Click" OnClientClick="return confirm('确认添加新闻吗？')" Width="40px" />
            <br />
            <br />
            
            <br />
    </div>

</asp:Content>
