⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 users.aspx

📁 完成一个网上书店系统
💻 ASPX
字号:
<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Users.aspx.cs" Inherits="admin_Users" Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style22
        {
            width: 702px;
        }
        .style23
        {
            width: 77px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width:100%;">
    <tr>
        <td>
            &nbsp;</td>
        <td class="style22">
            &nbsp;</td>
        <td class="style23">
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td class="style22">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                DataKeyNames="UserID" DataSourceID="SqlDataSource1" Width="699px">
                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                <RowStyle BackColor="White" ForeColor="#003399" />
                <Columns>
                    <asp:BoundField DataField="UserID" HeaderText="用户ID" InsertVisible="False" 
                        ReadOnly="True" SortExpression="UserID">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="UserName" HeaderText="用户名" SortExpression="UserName">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Password" HeaderText="密码" SortExpression="Password">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="EMail" HeaderText="EMail" SortExpression="EMail">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="TelephoneNumber" HeaderText="联系方式" 
                        SortExpression="TelephoneNumber">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Address" HeaderText="地址" SortExpression="Address">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="MoneyCount" HeaderText="金钱总额" 
                        SortExpression="MoneyCount">
                        <ControlStyle Width="80px" />
                    </asp:BoundField>
                    <asp:CheckBoxField DataField="State" HeaderText="状态" SortExpression="State" />
                    <asp:CheckBoxField DataField="UserRight" HeaderText="用户权限" 
                        SortExpression="UserRight" />
                    <asp:TemplateField HeaderText="是否删除">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField HeaderText="编辑" ShowDeleteButton="True" ShowEditButton="True">
                        <ControlStyle Width="50px" />
                    </asp:CommandField>
                </Columns>
                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:BookShopConnectionString %>" 
                DeleteCommand="DELETE FROM [Users] WHERE [UserID] = @UserID" 
                InsertCommand="INSERT INTO [Users] ([UserName], [Password], [EMail], [TelephoneNumber], [Address], [MoneyCount], [State], [UserRight]) VALUES (@UserName, @Password, @EMail, @TelephoneNumber, @Address, @MoneyCount, @State, @UserRight)" 
                SelectCommand="SELECT * FROM [Users]" 
                UpdateCommand="UPDATE [Users] SET [UserName] = @UserName, [Password] = @Password, [EMail] = @EMail, [TelephoneNumber] = @TelephoneNumber, [Address] = @Address, [MoneyCount] = @MoneyCount, [State] = @State, [UserRight] = @UserRight WHERE [UserID] = @UserID">
                <DeleteParameters>
                    <asp:Parameter Name="UserID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="UserName" Type="String" />
                    <asp:Parameter Name="Password" Type="String" />
                    <asp:Parameter Name="EMail" Type="String" />
                    <asp:Parameter Name="TelephoneNumber" Type="String" />
                    <asp:Parameter Name="Address" Type="String" />
                    <asp:Parameter Name="MoneyCount" Type="Decimal" />
                    <asp:Parameter Name="State" Type="Boolean" />
                    <asp:Parameter Name="UserRight" Type="Boolean" />
                    <asp:Parameter Name="UserID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="UserName" Type="String" />
                    <asp:Parameter Name="Password" Type="String" />
                    <asp:Parameter Name="EMail" Type="String" />
                    <asp:Parameter Name="TelephoneNumber" Type="String" />
                    <asp:Parameter Name="Address" Type="String" />
                    <asp:Parameter Name="MoneyCount" Type="Decimal" />
                    <asp:Parameter Name="State" Type="Boolean" />
                    <asp:Parameter Name="UserRight" Type="Boolean" />
                </InsertParameters>
            </asp:SqlDataSource>
        </td>
        <td class="style23">
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td class="style22">
            &nbsp;</td>
        <td class="style23">
            &nbsp;</td>
    </tr>
</table>
</asp:Content>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -