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

📄 itemform.aspx

📁 C# + MYSQL 课程设计 ASP.NET 2.0数据库开发《餐饮消费管理系统》功能完整
💻 ASPX
字号:
<%--文件名:ItemForm.aspx--%>
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ItemForm.aspx.cs" Inherits="EatingManage_ItemForm" Title="当前位置:用餐管理->客人用餐管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 558px; height: 1px">
        <tr>
            <td align="left" style="font-size: 0.8em; width: 550px; font-family: 宋体; height: 17px;
                background-color: deepskyblue">
                用餐日期:<asp:TextBox ID="TextBox1" runat="server" Width="75px">2007-9-18</asp:TextBox>
                菜品大类:<asp:DropDownList ID="DropDownList1" runat="server" Width="80px" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="菜品大类" DataValueField="菜品大类">
                </asp:DropDownList>
                菜品小类:<asp:DropDownList ID="DropDownList2" runat="server" Width="90px" DataSourceID="SqlDataSource2" DataTextField="菜品小类" DataValueField="菜品小类">
                </asp:DropDownList>
                <asp:Button ID="Button1" runat="server" Text="查询" Width="74px" /></td>
        </tr>
        <tr>
            <td style="overflow: auto; width: 550px; height: 103px; background-color: gainsboro">
                <asp:Panel ID="Panel1" runat="server" Height="150px" ScrollBars="Auto" Width="555px">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
                        BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"
                        Font-Names="宋体" Font-Size="Small" GridLines="None"
                        Width="650px" DataKeyNames="菜品名称" DataSourceID="SqlDataSource4" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
                        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                        <HeaderStyle BackColor="Navy" Font-Bold="True" ForeColor="#E7E7FF" HorizontalAlign="Center" />
                        <Columns>
                            <asp:CommandField ButtonType="Button" HeaderText="选择" ShowSelectButton="True" />
                            <asp:BoundField DataField="菜品名称" HeaderText="菜品名称" ReadOnly="True" SortExpression="菜品名称" />
                            <asp:BoundField DataField="菜品大类" HeaderText="菜品大类" SortExpression="菜品大类" />
                            <asp:BoundField DataField="菜品小类" HeaderText="菜品小类" SortExpression="菜品小类" />
                            <asp:BoundField DataField="菜品风味" HeaderText="菜品风味" SortExpression="菜品风味" />
                            <asp:BoundField DataField="计量单位" HeaderText="计量单位" SortExpression="计量单位" />
                            <asp:BoundField DataField="计费单价" HeaderText="计费单价" SortExpression="计费单价" />
                            <asp:BoundField DataField="当前状态" HeaderText="当前状态" SortExpression="当前状态" />
                            <asp:BoundField DataField="补充说明" HeaderText="补充说明" SortExpression="补充说明" />
                        </Columns>
                    </asp:GridView>                  
                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:MyEateryDBConnectionString %>"
                        SelectCommand="SELECT * FROM [菜品信息] WHERE (([菜品大类] = @菜品大类) AND ([菜品小类] = @菜品小类)AND ([当前状态] = '可以供应'))">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="菜品大类" PropertyName="SelectedValue"
                                Type="String" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="菜品小类" PropertyName="SelectedValue"
                                Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </asp:Panel>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyEateryDBConnectionString %>"
                    SelectCommand="SELECT DISTINCT [菜品大类] FROM [菜品信息]"></asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MyEateryDBConnectionString %>"
                    SelectCommand="SELECT DISTINCT [菜品小类] FROM [菜品信息] WHERE ([菜品大类] = @菜品大类)">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList1" Name="菜品大类" PropertyName="SelectedValue"
                            Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:MyEateryDBConnectionString %>"
                    SelectCommand="SELECT * FROM [用餐信息] WHERE ([用餐日期] = @用餐日期) AND ([当前状态] = '正在用餐')">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="TextBox1" Name="用餐日期" PropertyName="Text" Type="DateTime" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td style="font-size: 0.8em; width: 550px; font-family: 宋体; height: 17px; background-color: lightseagreen">
                &nbsp;用餐编号:<asp:DropDownList ID="DropDownList3" runat="server" Width="185px" DataSourceID="SqlDataSource3" DataTextField="用餐单号" DataValueField="用餐单号">
                </asp:DropDownList>&nbsp;菜品名称:<asp:TextBox ID="TextBox2" runat="server" BackColor="Silver"
                    ReadOnly="True" Width="111px"></asp:TextBox>
                计量单位:<asp:TextBox ID="TextBox3" runat="server" BackColor="Silver" ReadOnly="True"
                    Width="25px"></asp:TextBox><br />
                &nbsp;计费单价(元):<asp:TextBox ID="TextBox4" runat="server" Width="64px"></asp:TextBox>
                计费数量:<asp:TextBox ID="TextBox5" runat="server" Width="38px">1</asp:TextBox>
                自动编号:<asp:TextBox ID="TextBox6" runat="server" BackColor="Silver" ReadOnly="True"
                    Width="46px"></asp:TextBox>&nbsp;<asp:Button ID="Button2" runat="server" Text="增加"
                        Width="63px" OnClick="Button2_Click" />
                <asp:Button ID="Button3" runat="server" Text="修改" Width="63px" OnClick="Button3_Click" /></td>
        </tr>
        <tr>
            <td style="overflow: auto; width: 550px; height: 103px; background-color: gainsboro">
                <table style="width: 558px; height: 1px">
                    <tr>
                        <td style="overflow: auto; width: 550px; height: 103px; background-color: gainsboro">
                            <asp:Panel ID="Panel2" runat="server" Height="250px" ScrollBars="Auto" Width="555px">
                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BackColor="White"
                                    BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"
                                    Font-Names="宋体" Font-Size="Small" GridLines="None" Width="750px" DataKeyNames="自动编号" DataSourceID="SqlDataSource5" OnRowCreated="GridView2_RowCreated" OnSelectedIndexChanged="GridView2_SelectedIndexChanged">
                                    <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                                    <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                                    <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                                    <HeaderStyle BackColor="Navy" Font-Bold="True" ForeColor="#E7E7FF" HorizontalAlign="Center" />
                                    <Columns>
                                        <asp:CommandField ButtonType="Button" HeaderText="选择" ShowSelectButton="True" />
                                        <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                            <ItemTemplate>
                                                <asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Delete"
                                                    Text="删除" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="菜品名称" HeaderText="菜品名称" SortExpression="菜品名称" />
                                        <asp:BoundField DataField="计量单位" HeaderText="计量单位" SortExpression="计量单位" />
                                        <asp:BoundField DataField="计费单价" HeaderText="计费单价" SortExpression="计费单价" />
                                        <asp:BoundField DataField="计费数量" HeaderText="计费数量" SortExpression="计费数量" />
                                        <asp:BoundField DataField="计费金额" HeaderText="计费金额" ReadOnly="True" SortExpression="计费金额" />
                                        <asp:BoundField DataField="用餐单号" HeaderText="用餐单号" SortExpression="用餐单号" />
                                        <asp:BoundField DataField="自动编号" HeaderText="自动编号" InsertVisible="False" ReadOnly="True"
                                            SortExpression="自动编号" />
                                    </Columns>
                                </asp:GridView>
                                <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:MyEateryDBConnectionString %>"
                                    DeleteCommand="DELETE FROM [用餐明细] WHERE [自动编号] = @自动编号" InsertCommand="INSERT INTO [用餐明细] ([菜品名称], [计量单位], [计费单价], [计费数量], [用餐单号]) VALUES (@菜品名称, @计量单位, @计费单价, @计费数量, @用餐单号)"
                                    SelectCommand="SELECT [菜品名称], [计量单位], [计费单价], [计费数量], [计费金额], [用餐单号], [自动编号] FROM [用餐明细] WHERE ([用餐单号] = @用餐单号)" UpdateCommand="UPDATE [用餐明细] SET [菜品名称] = @菜品名称, [计量单位] = @计量单位, [计费单价] = @计费单价, [计费数量] = @计费数量, [用餐单号] = @用餐单号 WHERE [自动编号] = @自动编号">
                                    <DeleteParameters>
                                        <asp:Parameter Name="自动编号" Type="Int32" />
                                    </DeleteParameters>
                                    <UpdateParameters>
                                        <asp:ControlParameter ControlID="TextBox2" Name="菜品名称" PropertyName="Text" Type="String" />
                                        <asp:ControlParameter ControlID="TextBox3" Name="计量单位" PropertyName="Text" Type="String" />
                                        <asp:ControlParameter ControlID="TextBox4" Name="计费单价" PropertyName="Text" Type="Double" />
                                        <asp:ControlParameter ControlID="TextBox5" Name="计费数量" PropertyName="Text" Type="Double" />
                                        <asp:ControlParameter ControlID="DropDownList3" Name="用餐单号" PropertyName="SelectedValue"
                                            Type="String" />
                                        <asp:ControlParameter ControlID="TextBox6" Name="自动编号" PropertyName="Text" Type="Int32" />
                                    </UpdateParameters>
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="DropDownList3" Name="用餐单号" PropertyName="SelectedValue"
                                            Type="String" />
                                    </SelectParameters>
                                    <InsertParameters>
                                        <asp:ControlParameter ControlID="TextBox2" Name="菜品名称" PropertyName="Text" Type="String" />
                                        <asp:ControlParameter ControlID="TextBox3" Name="计量单位" PropertyName="Text" Type="String" />
                                        <asp:ControlParameter ControlID="TextBox4" Name="计费单价" PropertyName="Text" Type="Double" />
                                        <asp:ControlParameter ControlID="TextBox5" Name="计费数量" PropertyName="Text" Type="Double" />
                                        <asp:ControlParameter ControlID="DropDownList3" Name="用餐单号" PropertyName="SelectedValue"
                                            Type="String" />
                                    </InsertParameters>
                                </asp:SqlDataSource>
                                &nbsp; &nbsp; &nbsp;
                            </asp:Panel>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>

⌨️ 快捷键说明

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