• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
    問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
    當前位置: 首頁 - 科技 - 知識百科 - 正文

    ASP.NET餐飲管理系統制作代碼分享

    來源:懂視網 責編:小采 時間:2020-11-27 22:38:07
    文檔

    ASP.NET餐飲管理系統制作代碼分享

    ASP.NET餐飲管理系統制作代碼分享:頁面介紹展示: 以上是餐飲管理系統制作圖片介紹,接下來是代碼部分。 menu.aspx  <%@ Page Language=C# MasterPageFile=~/MasterPage.master AutoEventWireup=true CodeFile=menu.aspx
    推薦度:
    導讀ASP.NET餐飲管理系統制作代碼分享:頁面介紹展示: 以上是餐飲管理系統制作圖片介紹,接下來是代碼部分。 menu.aspx  <%@ Page Language=C# MasterPageFile=~/MasterPage.master AutoEventWireup=true CodeFile=menu.aspx

    頁面介紹展示:

    以上是餐飲管理系統制作圖片介紹,接下來是代碼部分。

    menu.aspx

    

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="menu" Title="無標題頁" %> 
     
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
     <form id="form1" runat="server"> 
    < style="height: 300px"> 
     
     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
     DataSourceID="SqlDataSource1" Height="299px" 
     Width="544px" 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 Height="30px" Width="70px"></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 ID="SqlDataSource1" runat="server" 
     ConnectionString="<%$ ConnectionStrings:ConnStr %>" 
     SelectCommand="SELECT [menuID], [menuName], [menuPhoto], [menuCooker], [menuStyle], [menuPrice], [menuDate] FROM [Menus]"> 
     </asp:SqlDataSource> 
     
    </> 
     </form> 
    </asp:Content> 
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> 
     < style=" height:300px "> 
     
     
     <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource2"> 
     <HeaderTemplate > 
     <table border="1" style="width: 104%; height: 36px"> 
     <tr> 
     <td>圖片</td> 
     <td>菜名</td> 
     <td>原價格</td> 
     <td>優惠價格</td> 
     </tr> 
     </HeaderTemplate> 
     <ItemTemplate> 
     <tr> 
     <td style="width: 90px"> 
     <asp:Image ID="Image1" runat="server" Height="88px" 
     ImageUrl='<%# Eval("menuPhoto") %>' Width="88px" /> 
     </td> 
     <td style="width: 40px"> 
     <asp:Label ID="Label1" runat="server" Text='<%# Eval("menuName") %>'></asp:Label> 
     </td> 
     <td style="width: 50px"> 
     <asp:Label ID="Label2" runat="server" Text='<%# Eval("menuPrice") %>'></asp:Label> 
     </td> 
     <td style="width: 50px"> 
     <asp:Label ID="Label3" runat="server" Text='<%# Eval("menuNewPrice") %>'></asp:Label> 
     </td> 
     </tr> 
     </ItemTemplate> 
     <FooterTemplate></table></FooterTemplate> 
     </asp:DataList> 
     <asp:SqlDataSource ID="SqlDataSource2" 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 ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
     <form id="form1" runat="server"> 
    < style="height:350px"> 
     <table id="Table1" cellSpacing="1" cellPadding="0" width="530" align="center" border="0"> 
     <TR> 
     <TD align="center"> 
     <asp:label id="Label1" runat="server" Font-Size="X-Large" Font-Names="華文行楷" ForeColor="Blue">訂餐車</asp:label></TD> 
     </TR> 
     <TR> 
     <TD align="center"> 
     <asp:DataList ID="DataList1" 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 border="1" style="width: 100%"> 
     <tr> 
     <td style="width: 25px"> 
     序號</td> 
     <td style="width: 33px"> 
     菜名</td> 
     <td style="width: 49px"> 
     圖片</td> 
     <td style="width: 30px"> 
     付費</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 ID="Image1" runat="server" Width="60px" Height="40px" ImageUrl='<%# DataBinder.Eval(Container.DataItem ,"menuPhUrl") %>'></asp:Image></td> 
     <td><%# DataBinder.Eval(Container.DataItem ,"payMoney") %></td> 
     <td><asp:TextBox ID="txtCount" runat="server" Width="32px" 
     Text='<%# DataBinder.Eval(Container.DataItem ,"number") %>'></asp:TextBox></td> 
     <td><asp:Button ID="bnMod" runat="server" Text="保存修改" CommandName="Update"></asp:Button></td> 
     <td><asp:Button ID="Button1" runat="server" Text="刪除" CommandName= "Delete"/></td> 
     </tr> 
     </ItemTemplate> 
     <FooterTemplate></table></FooterTemplate> 
     <FooterStyle BackColor="Tan" /> 
     </asp:DataList> 
     </TD> 
     </TR> 
     <TR> 
     <TD align="center" height="40">總金額: 
     <asp:TextBox id="total_money_txt" runat="server" Width="82px"></asp:TextBox> 
     <asp:Button id="shoppingbtn" runat="server" Text="繼續購物" OnClick="shoppingbtn_Click"></asp:Button> 
     <asp:Button id="delallbtn" runat="server" Text="清空購物車" OnClick="delallbtn_Click"></asp:Button> 
     <asp:Button id="orderbtn" runat="server" Text="結算中心" OnClick="orderbtn_Click"></asp:Button></TD> 
     </TR> 
     <TR> 
     <TD align="center"></TD> 
     </TR> 
     <TR> 
     <TD align="center"> 
     </TD> 
     </TR> 
     </table> 
     
     
    </> 
     </form> 
    </asp:Content> 
    

    menuCar.aspx.cs

    using System; 
    using System.Collections; 
    using System.Configuration; 
    using System.Data; 
    using System.Linq; 
    using System.Web; 
    using System.Web.Security; 
    using System.Web.UI; 
    using System.Web.UI.HtmlControls; 
    using System.Web.UI.WebControls; 
    using System.Web.UI.WebControls.WebParts; 
    using System.Xml.Linq; 
     
    public partial class menuCar : System.Web.UI.Page 
    { 
     String SqlStr; 
     DB db = new DB(); 
     DataSet Ds = new DataSet(); 
     public void DataListBind() 
     { 
     SqlStr = "select * from OrderMenu where customerName='" + Session["UserName"] + "'"; 
     //Ds = db.GetDataTableBySql(SqlStr); 
     DataSet das = Dataoperator.getRows(SqlStr); 
     DataList1.DataSource = das; 
     DataList1.DataBind(); 
     //try 
     //{ 
     // this.DataList1.DataSource = Ds.Tables[0].DefaultView; 
     // this.DataList1.DataBind(); 
     //} 
     //catch (Exception) 
     //{ 
     // Response.Write("<script>alert('沒有得到數據,請重試!')</script>"); 
     //} 
     } 
     protected void Page_Load(object sender, EventArgs e) 
     { 
     if (Page.IsPostBack == false) 
     { 
     SqlStr = "select * from OrderMenu"; 
     Ds = db.GetDataTableBySql(SqlStr); 
     //try 
     //{ 
     // if (Ds.Tables[0].Rows.Count != 0)//若購物車有此產品則提示用戶 
     // { 
     // Response.Write("<script>alert('你已經購買了此產品,只要更改數量就行!')</script>"); 
     // } 
     // else//若購物車沒有此產品則將此產品的相關信息插入購物車 
     // { 
     // Response.Write("沒有!!"); 
     // } 
     //} 
     //catch (Exception) 
     //{ 
     // Response.Write("<script>alert('沒有得到數據,請重試!')</script>"); 
     //} 
     DataListBind();//綁定數據 
     //total_money();//計算價格 
     } 
     } 
     protected void shoppingbtn_Click(object sender, EventArgs e) 
     { 
     Response.Redirect("orderMainMenu.aspx"); 
     } 
     protected void delallbtn_Click(object sender, EventArgs e) 
     { 
     } 
     protected void orderbtn_Click(object sender, EventArgs e) 
     { 
     Response.Redirect("menuorder.aspx"); 
     } 
     protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e) 
     { 
     //String book_id = this.DataList1.DataKeys[e.Item.ItemIndex].ToString(); 
     //SqlStr = "delete from 購物車表 where 圖書編號='" + book_id + "'"; 
     //Boolean Del_Result; 
     //Del_Result = db.UpdateDataBySql(SqlStr); 
     //if (Del_Result == true) 
     //{ 
     // Response.Write("<script>alert('記錄刪除成功!')</script>"); 
     // DataListBind();//綁定數據 
     // total_money();//計算價格 
     //} 
     //else 
     // Response.Write("<script>alert('記錄刪除失敗,請檢查!')</script>"); 
     } 
     protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e) 
     { 
     String book_id = this.DataList1.DataKeys[e.Item.ItemIndex].ToString(); 
     TextBox count = (TextBox)this.DataList1.Items[e.Item.ItemIndex].FindControl("txtcount"); 
     string SqlStr1 = "select * from Menus where menuNumber='" + Session["menu_number"] + "'"; 
     Ds = Dataoperator.getRows(SqlStr1); 
     
     if (Ds.Tables[0].Rows.Count>0) 
     { 
     int pric = Convert.ToInt32(Ds.Tables[0].Rows[0][6]); 
     int mon = Convert.ToInt32(count.Text) * pric; 
     //Session["payMon"] = mon.ToString(); 
     //total_money_txt.Text = mon.ToString(); 
     SqlStr = "update OrderMenu set number='" + Convert.ToInt32(count.Text) + "',payMoney='" + mon + "' where ID='" + book_id + "'"; 
     Boolean Update_Result; 
     Update_Result = db.UpdateDataBySql(SqlStr); 
     if (Update_Result == true) 
     { 
     Response.Write("<script>alert('數量修改成功!')</script>"); 
     DataListBind();//綁定數據 
     // total_money();//計算價格 
     } 
     else 
     Response.Write("<script>alert('數量修改失敗,請檢查!')</script>"); 
     } 
     else 
     { 
     } 
     } 
    } 
    

    [ASP/Basic]代碼

    //menuorder.aspx 
     protected void Page_Load(object sender, EventArgs e) 
     { 
     if (Page.IsPostBack == false) 
     { 
     //Session["Username"] = "ning"; 
     // DataGridViewBind(); 
     //total_money(); 
     string sql = "select * from menuView where customerName='" + Session["UserName"] + "'"; 
     Ds = Dataoperator.getRows(sql); 
     int i = Ds.Tables[0].Rows.Count; 
     int tem = 0; 
     for (int j = 0; j < i; j++) 
     { 
     tem = Convert.ToInt32(Ds.Tables[0].Rows[j][5].ToString()) + tem; 
     } 
     total_money_txt.Text = tem.ToString(); 
     } 
     
     } 
    protected void orderbtn_Click(object sender, EventArgs e) 
     { 
     
     string sql = "select * from menuView where customerName='" + Session["UserName"] + "'"; 
     Ds = Dataoperator.getRows(sql); 
     int i = Ds.Tables[0].Rows.Count; 
     
     string strgoodid=""; 
     string strcustomername = ""; 
     string strmenuname = ""; 
     string strnumber = ""; 
     string deldate = ""; 
     int strpaymoney = 0; 
     if (i > 0) 
     { 
     bool te = false; 
     for (int j = 0; j < i; j++) 
     { 
     strgoodid = Ds.Tables[0].Rows[j][0].ToString(); 
     strcustomername = Ds.Tables[0].Rows[j][1].ToString(); 
     strmenuname = Ds.Tables[0].Rows[j][2].ToString(); 
     strnumber = Ds.Tables[0].Rows[j][3].ToString(); 
     deldate = Ds.Tables[0].Rows[j][4].ToString(); 
     strpaymoney = Convert.ToInt32(Ds.Tables[0].Rows[j][5]); 
     tem++; 
     
     string songdate = Calendar1.SelectedDate.ToString(); 
     string stylePay = ddlpayment.SelectedValue.ToString(); 
     string sakmenu = remarktxtbox.Text; 
     string sqlind = "insert into IndentMenu values('" + strgoodid + "','" + strcustomername + "','" + strmenuname + "','" + strnumber + "','" + deldate + "','" + strpaymoney + "','" + songdate + "','" + stylePay + "','" + sakmenu + "')"; 
     te = Dataoperator.exSql(sqlind); 
     
     } 
     if (te) 
     { 
     MessageBox.ShowPath("menuIndent.aspx"); 
     } 
     else 
     { 
     MessageBox.Show("存儲錯誤.."); 
     } 
     } 
     else 
     { 
     MessageBox.Show("出錯了啊!!"); 
     } 
    } 

    聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    ASP.NET餐飲管理系統制作代碼分享

    ASP.NET餐飲管理系統制作代碼分享:頁面介紹展示: 以上是餐飲管理系統制作圖片介紹,接下來是代碼部分。 menu.aspx  <%@ Page Language=C# MasterPageFile=~/MasterPage.master AutoEventWireup=true CodeFile=menu.aspx
    推薦度:
    標簽: 設計 代碼 源代碼
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 亚洲国产精品狼友中文久久久| 无码人妻精品一区二区三区99不卡| 国产成人精品cao在线| 亚洲欧美日韩国产一区二区三区精品 | 中文字幕一精品亚洲无线一区| 亚洲精品一二区| 国产精品视频一区二区噜噜 | 日韩精品无码免费视频| 国产精品成人啪精品视频免费| 2020亚洲男人天堂精品| 日韩精品无码一区二区三区不卡 | 国产精品久久一区二区三区| 亚洲精品无码激情AV| 国产精品丝袜久久久久久不卡 | 国产精品无码日韩欧| 亚洲一日韩欧美中文字幕欧美日韩在线精品一区二 | 精品亚洲欧美无人区乱码| 夜色www国产精品资源站| 国产成人vr精品a视频| 欧美午夜精品久久久久免费视| 欧美日韩精品久久久久| 精品无码三级在线观看视频| 国产精品嫩草影院一二三区| 中国精品videossex中国高清| 久久99精品国产麻豆宅宅| 国产精品美女久久久| 国产精品成人免费福利| 99热亚洲色精品国产88| 国产精品日本一区二区不卡视频 | 久久精品国产99久久久| 人妻精品久久无码区| 亚洲av永久无码精品秋霞电影影院 | 精品精品国产自在久久高清| 国产精品美女久久久久| 久久国产精品99精品国产| 人人妻人人澡人人爽欧美精品| 日韩一区精品视频一区二区| 日本VA欧美VA精品发布| 精品人妻久久久久久888| 精品久久8x国产免费观看| 99re8这里有精品热视频免费|