




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
: 与技术专 业: 应用技术号: 20XX12388104生姓名: 訚新俊指导教师: 李顺新日 期: 20XX年6月1日要效率计算机引其发,通计算机效率、、歌舞操界面简洁直观非手;支纯键盘和纯鼠收银可最短时间内飞速包设置查询设置维护帮助信息几大,自包含若干子信息最佳选择。全动态设置菜类别出品付款折扣特价套均可实按户动态设置。计算机一部分,使计算机对信息,具有手所.:、些优够极大地信息效率,也科学、与世界接轨条。关键词:;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环境中的应用程 序开发。.NET框架旨在实现下列目标:提供一个一致的面向对象的编程环境,而无论对象代码是在本地存储和执行,还是在本地执行但在Internet上分布,或者是在远程执行的。提供一个将软件部署和版本控制冲突最小化的代码执行环境。提供一个保证代码(包括由未知的或不完全受信任的第三方创建的代码)安全执行的代码执行环境。提供一个可消除脚本环境或解释环境的性能问题的代码执行环境。使开发人员的经验在面对类型大不相同的应用程序(如基于 的应用程序和基于 Web的应用程序)时保持一致。按照工标,保基于.NET框架的代码可任代码。.NET框架个件:行和.NET框架类。行.NET核(、线处)且强施严格及可靠形事概念原则为称为托为称为非托管.NET另综合重合,含从传统命令图形户界(GUI)到ASP.NET提(Web和XMLWebservices).NET非托承载这些加载到们进程并启动托从利托非托功.NET若干宿且支宿C#介绍C#是从C和 C++演化而来的,是一种简单、现代、面向对象且类型安全的 编程。C#备了C++固的强大能力,同时也吸收了 Java和Delphi等的特点和精华,是目前进行.NET开发的首选。C#(Csharp)C#Microsoft.NETMicrosoft.NEC#——无论高级商业还统级简单C#结些便的转化XML从而们任何在任何操作统上Internet行调#++原有强#+者转C#。C#效网络商业断缩短周期断推出版本仅仅个“标志”版本C#在时就考虑些少的代码做多事同时也不易出错。支持现有网络标准模型意味着依赖出现网络标准例如 HTMXMSOAP等现存往往都早于Internet出现或在我们所知网络还处孕育期时出现所们一般无法好支持网络C#在Microsoft.NET上事半功倍扩展框架C#包含内置特任何轻松转化XML网络Internet被任何操作统上运行任何调突出XML框架现有XML说就C#样样就便他们已有巧现有XML精细特#流例如L逐渐在传输数据标准数据集合往往非常小#允许把数据直接映射到struct数据而不class少量数据非常有效。消除错误专家级C++也常会犯些简单小错误——比如忘初始化变量但往往就些小错误带预料有些要很长时间寻找旦个作产品就简单错误纠起也可能要付出其昂贵代价。C#C++资源回收减轻了序员内存管理负担。C#中变量由环境自动初始。变量是类型安全。这样,序员写与维护那些解决复杂商业问题序就更方便了。对版本更新提供内在容易出工作,因为码修改可无意间改变原有序C#为版本更新提供内在错C。后续过加健壮从而少后续商业软件更对。业商业划要付诸,必须在抽象商业实际软件间建立紧密地对。过大语言都难做到这。例如,如今序员们一般用码注释注明哪类对应于某抽象商业对象。C言允许元数据元数据应用于任何构者可以义有语-类,。,开检查每元素个检查每否被正确定抽象部分只创建份基于领域报表定制元数据紧密应于加强预期实际实之应系。扩交互性适合于大数企应用但实际的经验表应用仍然需要底层是因为考虑要么是因为要与有应用序兼容。这些情况可会迫开发者用 C++,即他们身宁愿用更高效开发环境。C#采用以下对策解决这一问题:.置建象模()基于 ?I;2.允许有限制地用纯指针(NativePointer)。C#中,每个对象都自动生成为一个对象。开发者不再需要显式的实现 IUnknown和其他接口.这些功能都是内置的.类似的,C#可以调用现有的对象,无论它是由什么语言编写的。C#包含了一个特殊的功能,使程序可以调用任何纯API。在一段特别标记的代码中,开发者可以使用指针和传统C/C++特性,如手工的内存管理和指针运算。这是其相对于其它环境的极大优势。这意味着 C#程序员可以在原有的 C/C++代码的基础上编写程序,而不是彻底放弃那些代码。无论是支持还是纯 API的调用,都是为了使开发者在 C#环境中直接拥有必要的强大功能。出项目背景当今世界已进入了在计算机信息管理了,如不开的自、一。,的多,信息量大,信息处理速度快,批量大,的效率就高,中立于不败之地。随着科学技术的不断提高,计算机科学日渐成熟,其强大的功能已为人深刻,它已进入人类社会的各个越来越重要的作用。越来越多的管理人员意到信息管理的重要性。系统目的餐馆菜单管理系统主要是用来方便客户进网上点菜,现在的人生活节作快了,时价格和菜的药用性,做到吃出健康,吃的省钱。传统餐饮企业的日常运作还是靠人工管理,从客人点单,再到结账基本上由人工完成记录,这做不仅耗费人力资源而且容易导致记录丢失或重复等错误,造成管理水平低下。所以餐饮业的管理效率不高。由于缺乏科学的管理和现代化的管理工具,餐饮业在管理上和业务的安排上都存在着不、酒楼、咖啡屋、快店、酒吧、桑拿、夜总会、歌舞等操作界面简洁、。机自动化经营者提供及时、准确计数据。户可以快速查找自己点菜名和料。员可以对菜类菜类菜类类查类。员可以对菜对菜查和。查式界操作完、机、、及餐创造更大利润和。关键技术开发环境VisualStudio20XX和、机和式程集成提供类程板包括MicrosoftWindowsASP.NETASP.NETWebSmartPhone20XX、CE其他此外它还设备(设备)板而且开发人还根需要选择不同编语言包括 C#托C++。很多应开发代码编辑器IntelliSense、解决方案资源、类视图、对象浏览器和类关。下VisualStudio环境。1.1 1VisualStudio20XX显示出来VisualStudio20XX【选择默认环境设置】对话框从中选择一种环境在此选择"VisualC设置"选项如1.1 1.2 设置环境信息第2步 MicrosoftVisualStudio20XX始为第一次使1.2 设置环境信息第3步 稍后会出现MicrosoftVisualStudio20XX主如1.2所示。1.3 VisualStudio20XXtloX--工根据当前窗体不同类型会动态改变,1.3 VisualStudio20XX箱区--箱以卡形式来分组显示常用组标准、数据、验证等作区--用于体目要区域设计控整体布局事代码编写等。目区属性区--目区显示所建目所有夹相应配置;属性区显示设计所控种设置信息。出图图2.2 MenuSeries库技术SQLServer2000Microsoft和非文档直接存储到库中SQL存储各种设备从中心最大服务器一直到桌面计算机和移动设备控制而不用存储哪里。应用程序中使用面向服务架(SOA)MicrosoftBizTalkServer业务流程中使用信息工作人员通过他们日常使用工具直接访问图2.1 FoodSQLServer20XX信满足所有图2.1 Food2.3 MenuType2.4OrderList2.4OrderList设计思路C#MicrosoftVisual类别,修改类别,查询类别。管理员可以对菜的信息管理:对各种菜的信息进行查询和删除,查看点菜记录。制作步骤1. 准备页面内容文字,收集素材;. . 阅. 通过该要如何做及要做哪些东西;. 设计出大体功能模块画出模块图;. 做法和注地方;. 目代码细节分析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()"|"//点餐食品的ID集合txtNameList.Textrow["Name"].ToString()"|"//}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,"不能结算!");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}新增结算信息失败!\r\n错误信息:{1}"User.Identity.Nameex.Message));Jscript.Alert(this"新增结算信息失败return;}//移除记录所记录节点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"" -->"//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;}//设置图片名称(当前日期+原图片扩展名)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/}
//保存用户填写的数据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();//获取执行菜系类别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,"修改菜谱信息失败,详细信息请参见异常日志!");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"信息失败,详细信息请参见异常}}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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 风电塔筒水性面漆项目可行性研究报告
- 防火隔离带项目可行性研究报告
- 电容储能技术项目可行性研究报告
- 2026年高考语文总复习文言文专题-教师版-古代文化常识(复习讲义)
- 投资与资产管理公司合同付款管理办法
- 新材料产业市场前景预测
- 美食文化节市场推广方案
- 防护知识培训内容课件
- 企业施工合同8篇
- 环卫公司劳动合同3篇
- 中央基建投资绩效目标表
- 电商企业海外中转仓库管理方法与经验
- 高压电气设备试验的基本知识
- 整理我的小书桌(课件)小学劳动二年级通用版
- 激光束传输与变换-第九讲课件
- 时空大数据讲义课件
- 2023年上海国企中远海运(上海)有限公司招聘笔试题库含答案解析
- 管工安全技术操作规程
- 武汉某厂房设备基础施工方案
- 第4部分 质量经理-质量管理体系章节题-43题附有答案
- DL-T 736-2021 农村电网剩余电流动作保护器安装运行规程
评论
0/150
提交评论