<%@ page language="C#" autoeventwireup="true" inherits="admin_adv_1, webpages" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        添加广告：<br />
        广告标题：<asp:TextBox ID="ad_title" runat="server" Width="241px"></asp:TextBox>
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        链接：<asp:TextBox ID="links" runat="server"></asp:TextBox>
        <br />
        &nbsp; &nbsp; &nbsp; &nbsp; 地址：<asp:TextBox ID="pic" runat="server" Width="241px"></asp:TextBox>
        <input type="button" name="upfile" value="浏览文件" onClick="javascript:window.open('uploadfile.aspx?getfrom=form1&getvalue=pic ','','status=no,scrollbars=no,top=80,left=200,width=420,height=165')">
        类型：<asp:DropDownList ID="lei" runat="server">
            <asp:ListItem Value="0">图片</asp:ListItem>
            <asp:ListItem Value="1">FLASH</asp:ListItem>
        </asp:DropDownList>&nbsp;<asp:CheckBox ID="shenghe" runat="server" Text="审核" /><br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Text="确定添加" OnClick="Button1_Click" /><br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
            Width="100%" AllowPaging="True" DataKeyNames="id" DataMember="DefaultView">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:BoundField DataField="ad_title" HeaderText="标题" SortExpression="ad_title" />
                <asp:BoundField DataField="links" HeaderText="链接" SortExpression="links" />
                <asp:CheckBoxField DataField="lei" HeaderText="图片(false)/FLASH(true)" SortExpression="lei" />
                <asp:CheckBoxField DataField="shenghe" HeaderText="审核" SortExpression="shenghe" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Label ID="xgms" runat="server" Text='' ><a href="adv_editad.aspx?id=<%# Eval("id") %> " target="_blank">修改 </a></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>">
            <UpdateParameters>
                <asp:Parameter Name="ad_title" />
                <asp:Parameter Name="links" />
                <asp:Parameter Name="lei" />
                <asp:Parameter Name="shenghe" />
                <asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue" />
            </UpdateParameters>
            <DeleteParameters>
                <asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue" />
            </DeleteParameters>
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
