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

📄 orderdetails_list.aspx

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

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width:100%;">
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                &nbsp;</td>
            <td>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                    BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                    DataKeyNames="OrderCountID" DataSourceID="SqlDataSource1" GridLines="Vertical">
                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                    <Columns>
                        <asp:CommandField HeaderText="编辑" ShowDeleteButton="True" 
                            ShowEditButton="True" />
                        <asp:BoundField DataField="OrderCountID" HeaderText="详细订单号" 
                            InsertVisible="False" ReadOnly="True" SortExpression="OrderCountID">
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="OrderID" HeaderText="订单号" SortExpression="OrderID">
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="BookID" HeaderText="图书号" SortExpression="BookID">
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="BookCount" HeaderText="数量" 
                            SortExpression="BookCount">
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="BookPrice" DataFormatString="{0:c}" HeaderText="价格" 
                            HtmlEncode="False" SortExpression="BookPrice">
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="MoneyCount" DataFormatString="{0:c}" 
                            HeaderText="小计" HtmlEncode="False" SortExpression="MoneyAmount">
                            <ControlStyle Width="80px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="是否删除" SortExpression="IsCancel">
                            <EditItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsCancel") %>' />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("IsCancel") %>' 
                                    Enabled="False" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="Gainsboro" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:BookShopConnectionString %>" 
                    DeleteCommand="DELETE FROM [OrderContent] WHERE [OrderCountID] = @OrderCountID" 
                    InsertCommand="INSERT INTO [OrderContent] ([OrderID], [BookID], [BookCount], [BookPrice], [MoneyAmount], [IsCancel]) VALUES (@OrderID, @BookID, @BookCount, @BookPrice, @MoneyAmount, @IsCancel)" 
                    SelectCommand="SELECT * FROM [OrderContent] WHERE ([OrderID] = @OrderID)" 
                    UpdateCommand="UPDATE [OrderContent] SET [OrderID] = @OrderID, [BookID] = @BookID, [BookCount] = @BookCount, [BookPrice] = @BookPrice, [MoneyAmount] = @MoneyAmount, [IsCancel] = @IsCancel WHERE [OrderCountID] = @OrderCountID">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="OrderID" QueryStringField="OrderID" 
                            Type="Int32" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="OrderCountID" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="OrderID" Type="Int32" />
                        <asp:Parameter Name="BookID" Type="Int32" />
                        <asp:Parameter Name="BookCount" Type="Int32" />
                        <asp:Parameter Name="BookPrice" Type="Decimal" />
                        <asp:Parameter Name="MoneyAmount" Type="Double" />
                        <asp:Parameter Name="IsCancel" Type="Boolean" />
                        <asp:Parameter Name="OrderCountID" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="OrderID" Type="Int32" />
                        <asp:Parameter Name="BookID" Type="Int32" />
                        <asp:Parameter Name="BookCount" Type="Int32" />
                        <asp:Parameter Name="BookPrice" Type="Decimal" />
                        <asp:Parameter Name="MoneyAmount" Type="Double" />
                        <asp:Parameter Name="IsCancel" Type="Boolean" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td align=center>
                <asp:Button ID="Button1" runat="server" Text="返回上一页" onclick="Button1_Click" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

⌨️ 快捷键说明

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