<%@ Page Language="C#" MasterPageFile="~/admins/Masteradmin.master" AutoEventWireup="true" CodeFile="UserManager.aspx.cs" Inherits="admins_UserManager" Title="星欣书城" %>
<%-- 在此处添加内容控件 --%>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div style="width: 455px; height: 9px">
        <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="注册会员管理" Width="176px"></asp:Label></div>
    <div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="userID" DataSourceID="AccessDataSource1" PageSize="8" Width="800px">
            <Columns>
                <asp:BoundField DataField="userID" HeaderText="用户ID" InsertVisible="False" ReadOnly="True"
                    SortExpression="userID" />
                <asp:BoundField DataField="userName" HeaderText="用户名" ReadOnly="True" SortExpression="userName" />
                <asp:BoundField DataField="trueName" HeaderText="真实姓名" ReadOnly="True" SortExpression="trueName" />
                <asp:BoundField DataField="address" HeaderText="地址" ReadOnly="True" SortExpression="address" />
                <asp:BoundField DataField="postcode" HeaderText="邮政编码" ReadOnly="True" SortExpression="postcode" />
                <asp:BoundField DataField="email" HeaderText="电子邮箱" ReadOnly="True" SortExpression="email" />
                <asp:BoundField DataField="phone" HeaderText="电话" ReadOnly="True" SortExpression="phone" />
                <asp:BoundField DataField="xingMoney" HeaderText="欣币数" SortExpression="xingMoney" />
                <asp:CommandField EditText="添加欣币" ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DeleteCommand="DELETE FROM [user_info] WHERE [userID] = @userID" InsertCommand="INSERT INTO [user_info] ([userName], [trueName], [address], [email], [phone], [xingMoney], [postcode]) VALUES (@userName, @trueName, @address, @email, @phone, @xingMoney, @postcode)"
            SelectCommand="SELECT [userID], [userName], [trueName], [address], [email], [phone], [xingMoney], [postcode] FROM [user_info]"
            UpdateCommand="UPDATE [user_info] SET  [trueName] = @trueName, [address] = @address, [email] = @email, [phone] = @phone, [xingMoney] = @xingMoney, [postcode] = @postcode WHERE [userID] = @userID"　DataFile="~/App_Data/database.mdb">
            <DeleteParameters>
                <asp:Parameter Name="userID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                
                <asp:Parameter Name="trueName" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="xingMoney" Type="Int64" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="userID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="userName" Type="String" />
                <asp:Parameter Name="trueName" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="xingMoney" Type="Int64" />
                <asp:Parameter Name="postcode" Type="String" />
            </InsertParameters>
        </asp:AccessDataSource>
    </div>
</asp:Content>
