页面介绍展示:
以上是餐饮管理系统制作图片介绍,接下来是代码部分。
menu.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="menu" Title="无标题页" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form runat="server"> <> <asp:GridView runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" AllowPaging="True" PageSize="4"> <PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast" NextPageText="下一页" PreviousPageText="上一页" /> <Columns> <asp:BoundField DataField="menuID" HeaderText="序号" InsertVisible="False" ReadOnly="True" SortExpression="menuID" /> <asp:BoundField DataField="menuName" HeaderText="菜名" SortExpression="menuName" /> <asp:ImageField DataImageUrlField="menuPhoto" HeaderText="图片" ControlStyle-Height="30px" ControlStyle-Width="70px" SortExpression="menuPhoto" > <ControlStyle></ControlStyle> </asp:ImageField> <asp:BoundField DataField="menuCooker" HeaderText="厨师" SortExpression="menuCooker" /> <asp:BoundField DataField="menuStyle" HeaderText="菜系" SortExpression="menuStyle" /> <asp:BoundField DataField="menuPrice" HeaderText="价格" SortExpression="menuPrice" /> <asp:BoundField DataField="menuDate" HeaderText="创菜日期" SortExpression="menuDate" /> </Columns> </asp:GridView> <asp:SqlDataSource runat="server" ConnectionString="<%$ ConnectionStrings:ConnStr %>" SelectCommand="SELECT [menuID], [menuName], [menuPhoto], [menuCooker], [menuStyle], [menuPrice], [menuDate] FROM [Menus]"> </asp:SqlDataSource> </> </form> </asp:Content> <asp:Content ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> <> <asp:DataList runat="server" DataSourceID="SqlDataSource2"> <HeaderTemplate > <table> <tr> <td>图片</td> <td>菜名</td> <td>原价格</td> <td>优惠价格</td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:Image runat="server" ImageUrl='<%# Eval("menuPhoto") %>' /> </td> <td> <asp:Label runat="server" Text='<%# Eval("menuName") %>'></asp:Label> </td> <td> <asp:Label runat="server" Text='<%# Eval("menuPrice") %>'></asp:Label> </td> <td> <asp:Label runat="server" Text='<%# Eval("menuNewPrice") %>'></asp:Label> </td> </tr> </ItemTemplate> <FooterTemplate></table></FooterTemplate> </asp:DataList> <asp:SqlDataSource runat="server" ConnectionString="<%$ ConnectionStrings:ConnStr %>" SelectCommand="SELECT [menuName], [menuPhoto], [menuNewPrice], [menuPrice] FROM [Menus] WHERE ([menuNewPrice] IS NOT NULL)"> </asp:SqlDataSource> </> </asp:Content>
menuCar.aspx
<%@ Page Language="C#" MasterPageFile="~/Land-zhuce.master" AutoEventWireup="true" CodeFile="menuCar.aspx.cs" Inherits="menuCar" Title="无标题页" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form runat="server"> <> <table cellSpacing="1" cellPadding="0"> <TR> <TD> <asp:label runat="server" Font-Size="X-Large" Font-Names="华文行楷" ForeColor="Blue">订餐车</asp:label></TD> </TR> <TR> <TD> <asp:DataList runat="server" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" DataKeyField="ID" onupdatecommand="DataList1_UpdateCommand" OnDeleteCommand="DataList1_DeleteCommand" AllowPaging="true" PageSize="4" RepeatColumns="4"> <%-- <AlternatingItemStyle BackColor="PaleGoldenrod" /> <SelectedItemStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />--%> <HeaderTemplate> <table> <tr> <td> 序号</td> <td> 菜名</td> <td> 图片</td> <td> 付费</td> <td> 份数</td> <td> 保存份数</td> <td> 删除</td> </tr> </HeaderTemplate> <HeaderStyle BackColor="Tan" Font-Bold="True" /> <ItemTemplate> <tr> <td><%# DataBinder.Eval(Container.DataItem ,"goodID") %></td> <td><%# DataBinder.Eval(Container.DataItem ,"menuName") %></td> <%-- <td><%# DataBinder.Eval(Container.DataItem ,"menuPhoto") %></td>--%> <td><asp:Image runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem ,"menuPhUrl") %>'></asp:Image></td> <td><%# DataBinder.Eval(Container.DataItem ,"payMoney") %></td> <td><asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container.DataItem ,"number") %>'></asp:TextBox></td> <td><asp:Button runat="server" Text="保存修改" CommandName="Update"></asp:Button></td> <td><asp:Button runat="server" Text="删除" CommandName= "Delete"/></td> </tr> </ItemTemplate> <FooterTemplate></table></FooterTemplate> <FooterStyle BackColor="Tan" /> </asp:DataList> </TD> </TR> <TR> <TD>总金额: <asp:TextBox runat="server"></asp:TextBox> <asp:Button runat="server" Text="继续购物"></asp:Button> <asp:Button runat="server" Text="清空购物车"></asp:Button> <asp:Button runat="server" Text="结算中心"></asp:Button></TD> </TR> <TR> <TD></TD> </TR> <TR> <TD> </TD> </TR> </table> </> </form> </asp:Content>
menuCar.aspx.cs