




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
: 與技術(shù)專 業(yè): 應(yīng)用技術(shù)號: 20XX12388104生姓名: 訚新俊指導(dǎo)教師: 李順新日 期: 20XX年6月1日要效率計算機(jī)引其發(fā),通計算機(jī)效率、、歌舞操界面簡潔直觀非手;支純鍵盤和純鼠收銀可最短時間內(nèi)飛速包設(shè)置查詢設(shè)置維護(hù)幫助信息幾大,自包含若干子信息最佳選擇。全動態(tài)設(shè)置菜類別出品付款折扣特價套均可實按戶動態(tài)設(shè)置。計算機(jī)一部分,使計算機(jī)對信息,具有手所.:、些優(yōu)夠極大地信息效率,也科學(xué)、與世界接軌條。關(guān)鍵詞:;sql2000vs20XXAbstractAlongwiththeprogressofthesociety,people'slivinglevelunceasingenhancement,therestaurantindustryconsumptiongrowth,increasinglyfiercepetition.theoperationoftraditionalcateringenterprisesoronartificiallymanagement,orderfromtheguest,againtocheckbyartificiallypleterecords,basicallydonotonlythehumancostresourcesandeasytocausetherecordslostorrepeatmistake,causingmanagementlevelisNowofthecateringindustryistowardscale,direction,thetraditionalmanagementpatternalreadycannotadapttothedevelopmentpotentialoffashion.Thisisurgentneedsstandards,efficientmanagementstyleguidethedevelopmentofputer,throughtheputermanagementdailyoperation,toconstantlyperfectmanagementlevel,andimproveworkefficiency.Cateringmanagementsystemistailoredspecificallyforcateringsoftware.Applicabletovariousofcateringandentertainmententerprise,suchas:restaurant,restaurants,cafes,fast-foodrestaurantsandbars,sauna,nightclub,singinganddancinghall,etc.Operationinterfaceissimple,intuitiveandveryeasytouse;Supportpurekeyboardandpuremousetwooperatingmode,orderandcheckout,cashiercanintheshortestpossibletimerapidpleted.Systemincludingthedailyoperations,operatingsetting,inquiresthestatistics,thesystemSettings,systemmaintenanceandhelpinformationandsoonseveralbigmodules,eachbigmoduleagainundertheirrespectivecontainseveralsonmodule,entertainmententerpriseisthebestchoiceformoderninformationmanagement.FullydynamicsystemSettings:productcategories,thewaiterspayment,waiters,requirements,discounts,specials,package,etcaccordingtouser'srequirementscanbedynamicSettings.Asapartofputerapplication,usetheputertocateringenterprisesinformationmanagement,hastheadvantagesofcraftsinparable.Forexample:retrieves,thesearchrapidlyconvenient,thereliabilityhigh,thereservesbig,thesecrecygood,thelifeislong,lowcost.Thesemeritscanenormouslyenhancetheinformationmanagementefficiency,alsoisenterprise'sscientificandstandardizationmanagementconnectingwiththeworldtheimportantcondition.Keywords:RestaurantManagementSystem;Sql2000;vs20XX錄11.1 .NET11.2 C#11.3 .241.3.3852.1 52.2 93.1 93.2 3.3 294.1 4.2 4.3 31637!。致 謝 39.NET.NET框架是一種新的計算平臺,它簡化了在高度分布式nternet環(huán)境中的應(yīng)用程 序開發(fā)。.NET框架旨在實現(xiàn)下列目標(biāo):提供一個一致的面向?qū)ο蟮木幊汰h(huán)境,而無論對象代碼是在本地存儲和執(zhí)行,還是在本地執(zhí)行但在Internet上分布,或者是在遠(yuǎn)程執(zhí)行的。提供一個將軟件部署和版本控制沖突最小化的代碼執(zhí)行環(huán)境。提供一個保證代碼(包括由未知的或不完全受信任的第三方創(chuàng)建的代碼)安全執(zhí)行的代碼執(zhí)行環(huán)境。提供一個可消除腳本環(huán)境或解釋環(huán)境的性能問題的代碼執(zhí)行環(huán)境。使開發(fā)人員的經(jīng)驗在面對類型大不相同的應(yīng)用程序(如基于 的應(yīng)用程序和基于 Web的應(yīng)用程序)時保持一致。按照工標(biāo),?;?NET框架的代碼可任代碼。.NET框架個件:行和.NET框架類。行.NET核(、線處)且強(qiáng)施嚴(yán)格及可靠形事概念原則為稱為托為稱為非托管.NET另綜合重合,含從傳統(tǒng)命令圖形戶界(GUI)到ASP.NET提(Web和XMLWebservices).NET非托承載這些加載到們進(jìn)程并啟動托從利托非托功.NET若干宿且支宿C#介紹C#是從C和 C++演化而來的,是一種簡單、現(xiàn)代、面向?qū)ο笄翌愋桶踩?編程。C#備了C++固的強(qiáng)大能力,同時也吸收了 Java和Delphi等的特點和精華,是目前進(jìn)行.NET開發(fā)的首選。C#(Csharp)C#Microsoft.NETMicrosoft.NEC#——無論高級商業(yè)還統(tǒng)級簡單C#結(jié)些便的轉(zhuǎn)化XML從而們?nèi)魏卧谌魏尾僮鹘y(tǒng)上Internet行調(diào)#++原有強(qiáng)#+者轉(zhuǎn)C#。C#效網(wǎng)絡(luò)商業(yè)斷縮短周期斷推出版本僅僅個“標(biāo)志”版本C#在時就考慮些少的代碼做多事同時也不易出錯。支持現(xiàn)有網(wǎng)絡(luò)標(biāo)準(zhǔn)模型意味著依賴出現(xiàn)網(wǎng)絡(luò)標(biāo)準(zhǔn)例如 HTMXMSOAP等現(xiàn)存往往都早于Internet出現(xiàn)或在我們所知網(wǎng)絡(luò)還處孕育期時出現(xiàn)所們一般無法好支持網(wǎng)絡(luò)C#在Microsoft.NET上事半功倍擴(kuò)展框架C#包含內(nèi)置特任何輕松轉(zhuǎn)化XML網(wǎng)絡(luò)Internet被任何操作統(tǒng)上運行任何調(diào)突出XML框架現(xiàn)有XML說就C#樣樣就便他們已有巧現(xiàn)有XML精細(xì)特#流例如L逐漸在傳輸數(shù)據(jù)標(biāo)準(zhǔn)數(shù)據(jù)集合往往非常小#允許把數(shù)據(jù)直接映射到struct數(shù)據(jù)而不class少量數(shù)據(jù)非常有效。消除錯誤專家級C++也常會犯些簡單小錯誤——比如忘初始化變量但往往就些小錯誤帶預(yù)料有些要很長時間尋找旦個作產(chǎn)品就簡單錯誤糾起也可能要付出其昂貴代價。C#C++資源回收減輕了序員內(nèi)存管理負(fù)擔(dān)。C#中變量由環(huán)境自動初始。變量是類型安全。這樣,序員寫與維護(hù)那些解決復(fù)雜商業(yè)問題序就更方便了。對版本更新提供內(nèi)在容易出工作,因為碼修改可無意間改變原有序C#為版本更新提供內(nèi)在錯C。后續(xù)過加健壯從而少后續(xù)商業(yè)軟件更對。業(yè)商業(yè)劃要付諸,必須在抽象商業(yè)實際軟件間建立緊密地對。過大語言都難做到這。例如,如今序員們一般用碼注釋注明哪類對應(yīng)于某抽象商業(yè)對象。C言允許元數(shù)據(jù)元數(shù)據(jù)應(yīng)用于任何構(gòu)者可以義有語-類,。,開檢查每元素個檢查每否被正確定抽象部分只創(chuàng)建份基于領(lǐng)域報表定制元數(shù)據(jù)緊密應(yīng)于加強(qiáng)預(yù)期實際實之應(yīng)系。擴(kuò)交互性適合于大數(shù)企應(yīng)用但實際的經(jīng)驗表應(yīng)用仍然需要底層是因為考慮要么是因為要與有應(yīng)用序兼容。這些情況可會迫開發(fā)者用 C++,即他們身寧愿用更高效開發(fā)環(huán)境。C#采用以下對策解決這一問題:.置建象模()基于 ?I;2.允許有限制地用純指針(NativePointer)。C#中,每個對象都自動生成為一個對象。開發(fā)者不再需要顯式的實現(xiàn) IUnknown和其他接口.這些功能都是內(nèi)置的.類似的,C#可以調(diào)用現(xiàn)有的對象,無論它是由什么語言編寫的。C#包含了一個特殊的功能,使程序可以調(diào)用任何純API。在一段特別標(biāo)記的代碼中,開發(fā)者可以使用指針和傳統(tǒng)C/C++特性,如手工的內(nèi)存管理和指針運算。這是其相對于其它環(huán)境的極大優(yōu)勢。這意味著 C#程序員可以在原有的 C/C++代碼的基礎(chǔ)上編寫程序,而不是徹底放棄那些代碼。無論是支持還是純 API的調(diào)用,都是為了使開發(fā)者在 C#環(huán)境中直接擁有必要的強(qiáng)大功能。出項目背景當(dāng)今世界已進(jìn)入了在計算機(jī)信息管理了,如不開的自、一。,的多,信息量大,信息處理速度快,批量大,的效率就高,中立于不敗之地。隨著科學(xué)技術(shù)的不斷提高,計算機(jī)科學(xué)日漸成熟,其強(qiáng)大的功能已為人深刻,它已進(jìn)入人類社會的各個越來越重要的作用。越來越多的管理人員意到信息管理的重要性。系統(tǒng)目的餐館菜單管理系統(tǒng)主要是用來方便客戶進(jìn)網(wǎng)上點菜,現(xiàn)在的人生活節(jié)作快了,時價格和菜的藥用性,做到吃出健康,吃的省錢。傳統(tǒng)餐飲企業(yè)的日常運作還是靠人工管理,從客人點單,再到結(jié)賬基本上由人工完成記錄,這做不僅耗費人力資源而且容易導(dǎo)致記錄丟失或重復(fù)等錯誤,造成管理水平低下。所以餐飲業(yè)的管理效率不高。由于缺乏科學(xué)的管理和現(xiàn)代化的管理工具,餐飲業(yè)在管理上和業(yè)務(wù)的安排上都存在著不、酒樓、咖啡屋、快店、酒吧、桑拿、夜總會、歌舞等操作界面簡潔、。機(jī)自動化經(jīng)營者提供及時、準(zhǔn)確計數(shù)據(jù)。戶可以快速查找自己點菜名和料。員可以對菜類菜類菜類類查類。員可以對菜對菜查和。查式界操作完、機(jī)、、及餐創(chuàng)造更大利潤和。關(guān)鍵技術(shù)開發(fā)環(huán)境VisualStudio20XX和、機(jī)和式程集成提供類程板包括MicrosoftWindowsASP.NETASP.NETWebSmartPhone20XX、CE其他此外它還設(shè)備(設(shè)備)板而且開發(fā)人還根需要選擇不同編語言包括 C#托C++。很多應(yīng)開發(fā)代碼編輯器IntelliSense、解決方案資源、類視圖、對象瀏覽器和類關(guān)。下VisualStudio環(huán)境。1.1 1VisualStudio20XX顯示出來VisualStudio20XX【選擇默認(rèn)環(huán)境設(shè)置】對話框從中選擇一種環(huán)境在此選擇"VisualC設(shè)置"選項如1.1 1.2 設(shè)置環(huán)境信息第2步 MicrosoftVisualStudio20XX始為第一次使1.2 設(shè)置環(huán)境信息第3步 稍后會出現(xiàn)MicrosoftVisualStudio20XX主如1.2所示。1.3 VisualStudio20XXtloX--工根據(jù)當(dāng)前窗體不同類型會動態(tài)改變,1.3 VisualStudio20XX箱區(qū)--箱以卡形式來分組顯示常用組標(biāo)準(zhǔn)、數(shù)據(jù)、驗證等作區(qū)--用于體目要區(qū)域設(shè)計控整體布局事代碼編寫等。目區(qū)屬性區(qū)--目區(qū)顯示所建目所有夾相應(yīng)配置;屬性區(qū)顯示設(shè)計所控種設(shè)置信息。出圖圖2.2 MenuSeries庫技術(shù)SQLServer2000Microsoft和非文檔直接存儲到庫中SQL存儲各種設(shè)備從中心最大服務(wù)器一直到桌面計算機(jī)和移動設(shè)備控制而不用存儲哪里。應(yīng)用程序中使用面向服務(wù)架(SOA)MicrosoftBizTalkServer業(yè)務(wù)流程中使用信息工作人員通過他們?nèi)粘J褂霉ぞ咧苯釉L問圖2.1 FoodSQLServer20XX信滿足所有圖2.1 Food2.3 MenuType2.4OrderList2.4OrderList設(shè)計思路C#MicrosoftVisual類別,修改類別,查詢類別。管理員可以對菜的信息管理:對各種菜的信息進(jìn)行查詢和刪除,查看點菜記錄。制作步驟1. 準(zhǔn)備頁面內(nèi)容文字,收集素材;. . 閱. 通過該要如何做及要做哪些東西;. 設(shè)計出大體功能模塊畫出模塊圖;. 做法和注地方;. 目代碼細(xì)節(jié)分析1.Account.aspx.csnamespaceCYGLXT.page{publicpartialclassAccount:System.Web.UI.Page{privateFoodfd=newFood();privateOrderListol=newOrderList();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){List<string>idList=FileUtil.GetNodeTextFromXml(Server.MapPath("../App_Data/Order.xml"));DataSetds=fd.GetFood(idList);if(ds!=null){//txtCount.Text=ds.Tables[0].Rows.Count.ToString();intmoney=0;foreach(DataRowrowinds.Tables[0].Rows){//價money+=Convert.ToInt32(row["Price"]);txtIdList.Textrow"ID"].ToString()"|"http://點餐食品的ID集合txtNameList.Textrow["Name"].ToString()"|"http://}txtMoney.Text=string.Format("{0:C}",money);//DataList1.DataSourceDataList1.DataBind();}if(DataList1.Items.Count>0){txtCode.Text="X"+DateTime.Now.ToString("yyMMddHHMMss");}//txtCode.Attributes.Add("readonly","true");txtMoney.Attributes.Add("readonly","true");txtCount.Attributes.Add("readonly","true");}}protectedvoidbtnAccount_Click(objectsender,EventArgse){if(DataList1.Items.Count==0){}{
Jscript.Alert(this,"不能結(jié)算!");return;ol.InsertOrderList(txtCode.Text,txtCount.Text,txtMoney.Text.Substring(1,txtMoney.Text.IndexOf(".")-1),txtDiscount.Text==""?"0":txtDiscount.Text,txtIdList.Text,txtNameList.Text);}catch(Exceptionex){FileUtil.WriteFile(Server.MapPath("../App_Data/ErrorLog.txt"string.Format("\r\n用戶{0}新增結(jié)算信息失敗!\r\n錯誤信息:{1}"User.Identity.Nameex.Message));Jscript.Alert(this"新增結(jié)算信息失敗return;}//移除記錄所記錄節(jié)點if(txtDiscount.Text!=""){floatmoney=int.Parse(txtMoney.Text.Substring(1,txtMoney.Text.IndexOf(".")-1))*float.Parse(txtDiscount.Text);Jscript.ExecuteBlock(this,string.Format("saveSuccess('{0:C}');",money));}{}}}
Jscript.ExecuteBlock(this,string.Format("saveSuccess('{0}');",txtMoney.Text));}2.Food_Info.aspx.csnamespaceCYGLXT.page{publicpartialclassFood_Info:System.Web.UI.Page{privateFoodfd=newFood();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){if(!string.IsNullOrEmpty(Request.QueryString["pId"])){DataSetds=fd.GetFoodInfoById(Request.QueryString["pId"]);if(ds.Tables[0].Rows.Count==0){Jscript.Alert(this,"return;}foodlistBlock.InnerHtml= string.Format("{0}-->{1}-->{2}",ds.Tables[0].Rows[0]["Series"].ToString(),ds.Tables[0].Rows[0]["Type"].ToString(),ds.Tables[0].Rows[0]["Name"].ToString());lblName.Text=ds.Tables[0].Rows[0]["Name"].ToString();lblType.Text=ds.Tables[0].Rows[0]["Series"].ToString()+"-->"+ds.Tables[0].Rows[0]["Type"].ToString();lblPrice.Text=string.Format("{0:C}",ds.Tables[0].Rows[0]["Price"]);imgBtnPath.ImageUrl="../upfile/thumbnailImage/"+ds.Tables[0].Rows[0]["Picture"].ToString();lblRemark.Text=ds.Tables[0].Rows[0]["Remark"].ToString();txtImageName.Text=ds.Tables[0].Rows[0]["Picture"].ToString();}}}protectedvoidimgBtnPath_Click(objectsender,ImageClickEventArgse){//stringstrImagePath=Server.MapPath("../upfile/sourceImage/")+txtImageName.Text;//Bitmap以獲取該的高和寬System.Drawing.Bitmapbmp=newSystem.Drawing.Bitmap(strImagePath);intwidth=bmp.Width+20;intheight=bmp.Height+if(width<400)width=420;elseif(width>900)width=920;if(height<200)height=220;elseif(height>500)height=520;Jscript.ShowDialog(thiswidthheightlblName.Text"樣""Picture.aspx?piame="+txtImageName.Text);}}}Food_List.aspx.csnamespaceCYGLXT.page{publicpartialclassFood_List:System.Web.UI.Page{privateFoodfd=newFood();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){if(!string.IsNullOrEmpty(Request.QueryString["typeId"])){DataSetds=fd.GetFoodByType(Request.QueryString["typeId"]);DataList1.DataSource=ds;DataList1.DataBind();if(ds.Tables[0].Rows.Count>0)foodlistBlock.InnerHtml= string.Format("{0}-->{1}",ds.Tables[0].Rows[0]["Series"].ToString(),ds.Tables[0].Rows[0]["Type"].ToString());elsefoodlistBlock.InnerHtml"下暫無信息";}}}protectedvoidchkOrder_CheckedChanged(objectsender,EventArgse){CheckBoxchkOrder=(CheckBox)sender;DataListItemitem=chkOrder.ParentasDataListItem;stringid=((Label)item.FindControl("ID")).Text;if(chkOrder.Checked){}{}}
FileUtil.WriteLineToXml(Server.MapPath("../App_Data/Order.xml"),id);FileUtil.RemoveLineFromXml(Server.MapPath("../App_Data/Order.xml"),id);protectedvoidDataList1_ItemDataBound(objectsender,DataListItemEventArgse){if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem){List<string>idList=FileUtil.GetNodeTextFromXml(Server.MapPath("../App_Data/Order.xml"));if(idList.Contains(((Label)e.Item.FindControl("ID")).Text)){((CheckBox)e.Item.FindControl("chkOrder")).Checked=true;}}}}}4.Menu_link.aspx.csnamespaceCYGLXT.page{publicpartialclassMenu_Link:System.Web.UI.Page{privateMenuSeriesms=newMenuSeries();privateMenuTypemt=newMenuType();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){StringBuildersb=newStringBuilder(2000);DataSetdsSeries=ms.GetMenuSeriesName();foreach(DataRowrowindsSeries.Tables[0].Rows){sb.Append("<tablecellpadding=\"0\"cellspacing=\"0\"border=\"0\">");sb.Append("<tr>");sb.Append("<tdstyle=\"height:30px;font-size:15px;color:#5494af;\">");sb.Append(row["Name"" -->"http://sb.Append("</td>");sb.Append("</tr>");DataSetdsType=mt.GetMenuTypeName(row["ID"].ToString());sb.Append("<tr>");sb.Append("<tdstyle=\"height:20px;\">");if(dsType.Tables[0].Rows.Count>0){foreach(DataRowrowChildindsType.Tables[0].Rows){sb.Append("<ahref=\"Food_List.aspx?typeId="+rowChild["ID"].ToString()+"\"style=\"margin-right:10px;font-size:13px;color:#5494af;text-decoration:underline;\">");sb.Append(rowChild["Name"]);sb.Append("</a>");}}else{sb.Append"下暫不提供食物!");}sb.Append("</td>");sb.Append("</tr>");sb.Append(}typeInfo.InnerHtml=sb.ToString();}}}}5.page.master.csnamespaceCYGLXT.page{publicpartialclasspage:System.Web.UI.MasterPage{protectedvoidPage_Load(objectsender,EventArgse){}}}6.Picture.aspx.csnamespaceCYGLXT.page{publicpartialclassPicture1:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){if(!string.IsNullOrEmpty(Request.QueryString["piame"])){imgPath.ImageUrl="../upfile/sourceImage/"+Request.QueryString["piame"];}}}}}7.Search.aspx.csnamespaceCYGLXT.page{publicpartialclassSearch:System.Web.UI.Page{privateFoodfd=newFood();protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidbtnSearch_Click(objectsender,EventArgse){if(string.IsNullOrEmpty(txtSearch.Text))return;DataSetds=fd.GetFood(txtSearch.Text);DataList1.DataSource=DataList1.DataBind();}protectedvoidchkOrder_CheckedChanged(objectsender,EventArgse){CheckBoxchkOrder=(CheckBox)sender;DataListItemitem=chkOrder.ParentasDataListItem;stringid=((Label)item.FindControl("ID")).Text;if(chkOrder.Checked){}{}}
FileUtil.WriteLineToXml(Server.MapPath("../App_Data/Order.xml"),id);FileUtil.RemoveLineFromXml(Server.MapPath("../App_Data/Order.xml"),id);protectedvoidDataList1_ItemDataBound(objectsender,DataListItemEventArgse){if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem){List<string>idList=FileUtil.GetNodeTextFromXml(Server.MapPath("../App_Data/Order.xml"));if(idList.Contains(((Label)e.Item.FindControl("ID")).Text)){((CheckBox)e.Item.FindControl("chkOrder")).Checked=true;}}}}}8.Default.aspx.csnamespaceCYGLXT{publicpartialclassDefault:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){//取最新的14條記錄DataList1.DataSource= newFood().GetFood(14);DataList1.DataBind();}}protectedvoidchkOrder_CheckedChanged(objectsender,EventArgse){CheckBoxchkOrder=(CheckBox)sender;DataListItemitem=chkOrder.ParentasDataListItem;stringid=((Label)item.FindControl("ID")).Text;if(chkOrder.Checked){}{}}
FileUtil.WriteLineToXml(Server.MapPath("App_Data/Order.xml"),id);FileUtil.RemoveLineFromXml(Server.MapPath("App_Data/Order.xml"),id);protectedvoidDataList1_ItemDataBound(objectsender,DataListItemEventArgse){if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem){List<string>idList=FileUtil.GetNodeTextFromXml(Server.MapPath("App_Data/Order.xml"));if(idList.Contains(((Label)e.Item.FindControl("ID")).Text)){((CheckBox)e.Item.FindControl("chkOrder")).Checked=true;}}}}}9.Admin.master.csnamespaceCYGLXT.admin{publicpartialclassAdmin:System.Web.UI.MasterPage{privateUsersuser=newUsers();protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidbtnUpdatePwd_Click(objectsender,EventArgse){stringpId=user.GetUserIDByUserName(base.Page.User.Identity.Name);Response.Redirect("User_Update.aspx?pId="+pId);}}}10.Error_log.aspx.csnamespaceCYGLXT.admin{publicpartialclassError_Log:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){divErrorLog.InnerHtml="../App_Data/ErrorLog.txt"));}}}}11.Food_Add.aspx.csnamespaceCYGLXT.admin{publicpartialclassFood_Add:System.Web.UI.Page{privateMenuSeriesmsnewMenuSeries();//作類privateMenuTypemtnewMenuType//譜類別作類privateFoodfdnewFood//譜作類protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){ddlSeries.DataSource=ms.GetMenuSeriesName();ddlSeries.DataValueField="ID";ddlSeries.DataTextField= "Name";ddlSeries.DataBind();ddlSeries.Items.Insert(0,newListItem("",""));}}protectedvoidbtnSave_Click(objectsender,EventArgse){//上傳文件是否為有效圖片格式stringstrClientPathfupPicture.PostedFile.FileName//獲取上傳圖片的客戶端完整路徑if(!ImageUtil.IsImage(strClientPath)){Jscript.Alert(this,"請上傳圖片格式文件,包括[GIF][JPG][PNG]格式圖片!");return;}//設(shè)置圖片名稱(當(dāng)前日期+原圖片擴(kuò)展名)stringstrFileName=DateTime.Now.ToString("yyMMddHHMMss")+ImageUtil.GetExtension(strClientPath);//先將圖片上傳至upfile目錄下stringstrUpPath=Server.MapPath("../upfile/")+strFileName;{strFileName);strFileName);
fupPicture.SaveAs(strUpPath);//為上傳的圖片添加水印,并存至upfile/sourceImageServer.MapPath"../upfile/sourceImage///生成縮略圖,并存至upfile/thumbnailImageServer.MapPath"../upfile/thumbnailImage/}
//保存用戶填寫的數(shù)據(jù)fd.InsertFood(ddlType.SelectedValue,txtName.Text,strFileName,txtPrice.Text,Jscript.ExecuteBlock(this,"saveCallback();");catch(Exceptionex){FileUtil.WriteFile(Server.MapPath("../App_Data/ErrorLog.txt"),string.Format("\r\n用戶{0}新增菜譜信息失?。r\n錯誤信息:{1}",User.Identity.Name,ex.Message));Jscrip.Alert(thi,);}finally{//upfile下的暫存圖片}}protectedvoidddlSeries_SelectedIndexChanged(objectsender,EventArgse){if(string.IsNullOrEmpty(ddlSeries.SelectedValue)){ddlType.Items.Clear();return;}ddlType.DataSource=mt.GetMenuTypeName(ddlSeries.SelectedValue);ddlType.DataValueField= "ID";ddlType.DataTextField="Name";ddlType.DataBind();}}}12.Food_Info.aspx.csnamespaceCYGLXT.admin{publicpartialclassFood_Info:System.Web.UI.Page{Foodfd=newFood();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){if(!string.IsNullOrEmpty(Request.QueryString["pId"])){DataSetds=fd.GetFoodInfoById(Request.QueryString["pId"]);if(ds.Tables[0].Rows.Count==0){t(thi,刷后重操作);return;}txtName.Text=ds.Tables[0].Rows[0]["Name"].ToString();txtSeries.Text=ds.Tables[0].Rows[0]["Series"].ToString();txtType.Text=ds.Tables[0].Rows[0]["Type"].ToString();txtPrice.Text=string.Format("{0:C}",ds.Tables[0].Rows[0]["Price"]);txtRemark.Text=ds.Tables[0].Rows[0]["Remark"].ToString();}}}}}13.Food_List.aspx.csnamespaceCYGLXT.admin{publicpartialclassFood_List:System.Web.UI.Page{privateFoodfd=newFood();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){BindGridView();}}privatevoidBindGridView(){GridView1.DataSource=fd.GetFood();GridView1.DataKeyNames=newstring[]{"ID"};GridView1.DataBind();}protectedvoidGridView1_RowDataBound(objectsender,GridViewRowEventArgse){if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='#F0F7FB';e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=c;");}}protectedvoidGridView1_RowUpdating(objectsender,GridViewUpdateEventArgse){Response.Redirect(string.Format("Food_Update.aspx?pId={0}",GridView1.DataKeys[e.RowIndex].Value.ToString()));}protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse){//IDstringpId=GridView1.DataKeys[e.RowIndex].Value.ToString();try{//IDBindGridView();}catch(Exceptionex){FileUtil.WriteFile(Server.MapPath("../App_Data/ErrorLog.txt"string.Format("\r\n用\r\"t.Alert(thi,);}}protectedvoidGridView1_Rowmand(objectsender,GridViewmandEventArgse){if(e.mandName=="Select"){Jscript.ShowDialogthis600400"""Food_Info.aspx?pId=+e.mandArgument.ToString());}elseif(e.mandName=="Picture"){string[]strResultArray=fd.GetFoodImageById(e.mandArgument.ToString());stringstrImagePath=Server.MapPath("../upfile/sourceImage/")+strResultArray[1];//Bitmap以該高和寬System.Drawing.Bitmapbmp=newSystem.Drawing.Bitmap(strImagePath);intwidth=bmp.Width+20;intheight=bmp.Height+if(width<400)width=420;elseif(width>900)width=920;if(height<200)height=220;elseif(height>500)height=520;Jscript.ShowDialog(thiswidthheightstrResultArray[0"樣",string.Format("Picture_Select.aspx?pId={0}&piame={1}",e.mandArgument.ToString(),strResultArray[1]));}}protectedvoidGridView1_PageIndexChanging(objectsender,GridViewPageEventArgse){//GridView1.PageIndexe.NewPageIndex;BindGridView();}}}14.Food_Update.aspx.csnamespaceCYGLXT.admin{publicpartialclassFood_Update:System.Web.UI.Page{privateMenuSeriesmsnewMenuSeries();//作類privateMenuTypemtnewMenuType//譜類別作類privateFoodfdnewFood//譜作類protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){//ddlSeries.DataSource=ms.GetMenuSeriesName();ddlSeries.DataValueField= "ID";ddlSeries.DataTextField= "Name";ddlSeries.DataBind();ddlSeries.Items.Insert(0,newListItem("",""));if(!string.IsNullOrEmpty(Request.QueryString["pId"])){DataSetds=fd.GetFoodById(Request.QueryString["pId"]);if(ds.Tables[0].Rows.Count==0){Jscript.Alert(this"該條記錄已被刪除請刷后return;}//保存記錄IDViewState.Add("pId",Request.QueryString["pId"]);//件賦值txtName.Text=ds.Tables[0].Rows[0]["Name"].ToString();ddlSeries.SelectedValue=ds.Tables[0].Rows[0]["Series"].ToString();txtPrice.Text=ds.Tables[0].Rows[0]["Price"].ToString();txtRemark.Text=ds.Tables[0].Rows[0]["Remark"].ToString();//獲取執(zhí)行菜系類別ddlType.DataSource=mt.GetMenuTypeName(ddlSeries.SelectedValue);ddlType.DataValueField= "ID";ddlType.DataTextField= ddlType.DataBind();ddlType.SelectedValue=ds.Tables[0].Rows[0]["Type"].ToString();}}}protectedvoidbtnSave_Click(objectsender,EventArgse){try{fd.UpdateFood(ViewState["pId"].ToString(),ddlType.SelectedValue,txtName.Text,txtPrice.Text,txtRemark.Text);}catch(Exceptionex){FileUtil.WriteFile(Server.MapPath("../App_Data/ErrorLog.txt"),string.Format("\r\n用戶{0}修改菜譜信息失敗!\r\n錯誤信息:{1}",User.Identity.Name,ex.Message));Jscript.Alert(this,"修改菜譜信息失敗,詳細(xì)信息請參見異常日志!");return;}Response.Redirect("Food_List.aspx");}protectedvoidddlSeries_SelectedIndexChanged(objectsender,EventArgse){if(string.IsNullOrEmpty(ddlSeries.SelectedValue)){ddlType.Items.Clear();return;}ddlType.DataSource=mt.GetMenuTypeName(ddlSeries.SelectedValue);ddlType.DataValueField="ID";ddlType.DataTextField=ddlType.DataBind();}}}15.MenuType_Add.aspx.csnamespaceCYGLXT.admin{publicpartialclassMeunSeries_List:System.Web.UI.Page{privateMenuSeriesms=newMenuSeries();protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsPostBack){BindGridView();}}privatevoidBindGridView(){GridView1.DataSource=ms.GetMenuSeries();GridView1.DataKeyNames=newstring[]{"ID"};GridView1.DataBind();}protectedvoidGridView1_RowDataBound(objectsender,GridViewRowEventArgse){if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='#f0f7fa';e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=c;");if(e.Row.Cells[3].Text.Length>=32)t=)+ ……;}}protectedvoidGridView1_RowUpdating(objectsender,GridViewUpdateEventArgse){Response.Redirect(string.Format("MeunSeries_Update.aspx?pId={0}",GridView1.DataKeys[e.RowIndex].Value.ToString()));}protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse){//IDstringpId=GridView1.DataKeys[e.RowIndex].Value.ToString();try{//IDBindGridView();}catch(Exceptionex){//FileUtil.WriteFile(Server.MapPath("../App_Data/ErrorLog.txt"string.Format("\r\n用{0}信息失??!\r\n信息:{1}"User.Identity.Nameex.Message));Jscript.Alert(this"信息失敗,詳細(xì)信息請參見異常}}protectedvoidGridView1_Rowmand(objectsender,GridViewmandEventArgse){if(e.mandName=="Select"){Jscript.ShowDialogthis600350"信息詳情""MeunSeries_Info.aspx?pId=+e.mandArgument.ToString());}}protectedvoidGridView1_PageIndexChanging(objectsender,Gr
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- Unit 3 Keep Fit Section B Project教學(xué)設(shè)計 -2024-2025學(xué)年人教版(2024)七年級英語下冊
- Unit 4 Why dont you talk to your parents Section A 4a 教學(xué)設(shè)計2024-2025學(xué)年人教版八年級英語下冊
- 2023三年級數(shù)學(xué)上冊 二 兩、三位數(shù)乘一位數(shù) 4 解決問題教學(xué)設(shè)計 冀教版
- 2023七年級語文下冊 第三單元 寫作 抓住細(xì)節(jié)配套教學(xué)設(shè)計 新人教版
- 4 不做“小馬虎”教學(xué)設(shè)計-2023-2024學(xué)年道德與法治一年級下冊統(tǒng)編版
- 2018春蘇教版八年級生物下冊第十單元第26章教學(xué)設(shè)計:10.26.3關(guān)注健康
- 2023七年級英語下冊 Unit 12 What did you do last weekend Section A 第2課時(3a-3c)教學(xué)設(shè)計 (新版)人教新目標(biāo)版
- Unit 2More than fun Presenting ideas教學(xué)設(shè)計2024-2025學(xué)年外研版英語七年級上冊
- 病房規(guī)范化管理
- 7 乘除法運用題(教學(xué)設(shè)計)-2024-2025學(xué)年三年級上冊數(shù)學(xué)人教版
- 《管子》的智慧課件
- 部編版六年級語文下冊《送元二使安西》課件
- 【國企】火力發(fā)電工程建設(shè)安全標(biāo)準(zhǔn)化圖冊230P
- 2023年版義務(wù)教育音樂課程標(biāo)準(zhǔn)(標(biāo)準(zhǔn)版)
- DB21T 3353-2020 高延性混凝土加固技術(shù)規(guī)程
- 撫州市崇仁縣鄉(xiāng)鎮(zhèn)街道社區(qū)行政村統(tǒng)計表
- 工程甲方指令單
- 扒胎機(jī)的使用
- 民用爆炸物品出口審批單
- 好書推薦——《青銅葵花》PPT課件
- 乙烯裂解爐焊接施工工藝及驗收規(guī)程
評論
0/150
提交評論