• 4.62 MB
  • 37页

同济 数据库 项目报告

  • 37页
  • 当前文档由用户上传发布,收益归属用户
  1. 1、本文档共5页,可阅读全部内容。
  2. 2、本文档内容版权归属内容提供方,所产生的收益全部归内容提供方所有。如果您对本文有版权争议,可选择认领,认领后既往收益都归您。
  3. 3、本文档由用户上传,本站不保证质量和数量令人满意,可能有诸多瑕疵,付费之前,请仔细先通过免费阅读内容等途径辨别内容交易风险。如存在严重挂羊头卖狗肉之情形,可联系本站下载客服投诉处理。
  4. 文档侵权举报电话:19940600175。
'┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统TONGJIUNIVERSITY《数据库技术及其应用》项目设计报告项目名称“嘉食通”校园餐饮信息查询系统组长Xxxxxxxx小组成员Xxxxxxxxx学院(系)xxxxxxxxxxx专业xxxx指导教师朱静完成日期2011年12月20日共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统“嘉食通”校园餐饮信息查询系统项目实际意义如今,越来越多的学生来到了嘉定校区,来到这个陌生的地方。当又一批学生来到嘉定以后,都会发现这里并不像想象中的那样荒凉,在同济新天地有许许多多的商家,有着各种各样的小吃和菜目,但是初来乍到的他们对于这些东西并没有太大的了解,不管是品种,还是胃口、价格等,都不具备太多的了解,为了让大家对嘉定校区的“吃”有所了解,同时也增加在这过程中的趣味性,我们决定制作一个可以为嘉定的新面孔提供一个集信息查询、评价系统、条件搜索、推荐功能于一身的小系统,既能为新生提供帮助,这对于老生来说这也有很大的引导作用,能提供很大的便捷,能利用自己的经验为他人提供一个参考,该系统的评价功能是一个很好的直观参考,也极具互动娱乐价值。项目主要完成工作1.用户注册及密码修改:进入登陆页面后,可点击注册按钮进行注册,登录成功后可以修改密码。2.登陆:用户进入登陆页面,输入用户名及密码,正确则进入系统,不正确则提示。3.信息查询:用户查看食品的相关内容,包括相应餐馆信息,食品价格,商家图片,他人的评价、评分等。4.评价:用户对食品的评价,包括文字评价,评分,“顶”相应的菜目等。5.系统推荐:根据评分、价格和类别排序同时,还可以给出一份人气榜单。6.图片浏览:用户可以在窗体中查看所有商家的图片。7.管理员界面:对菜目、商家信息进行插入、删除、更新等操作,对评价进行删除操作。数据库结构设计1.关系表:菜目表(菜名,商家名称,所属类别,价格,卫生评分总和,口味评分总和,价格评分总和,人气,评价人数)商家表(商家名称,简介,电话)商家评价表(商家名称,评价时间,学号,姓名,评价内容)菜目评价表(菜名,商家名称,评价时间,学号,姓名,评价内容)用户表(学号,姓名,密码)管理员表(账号,密码)共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统2.E-R模型:密码商家名称称管理员编辑评价内容商家密码姓名学号用户简介菜名价格评分口味评分评价时间编辑账号电话评价内容评价时间评分人数图片所属类别价格卫生评分评价评分评价评分出售菜目人气3.安全性设计进入登录界面(界面见用户指南),以用户名以及密码判断是否为用户。学校学生和管理员为用户,用户名、密码错误的不能登录用户手册共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统1)登录窗体如果没有帐号,可以点击“注册”。输入相关信息点击“注册”,如果存在了该用户,显示“已存在该用户”,注册成功后点击“返回”,回到登录页面。输入用户名、密码,如果是用户权限的,成功后出现欢迎界面共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统点击“SKIP”或自动跳过进入主窗体点击菜单栏左方的“”按钮,控制音乐的播放与停止此时可以查看菜品详细信息,点击“顶”,可以提升菜品的人气,且每个用户只能“顶”一次,不能够重复操作,也可以按商家查询此商家的菜品,同时可在“详细信息”的下方输入对菜品的评分。点击主菜单上的按钮,可查看以下窗体。点击“商家信息”共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统本窗体可查看商家信息。点击“用户评价”。在单选框中可选择查看商家或菜品,点击“我要评价”可以对菜品和商家进行评价点击单选框“商家名”查看商家的评价。共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统点击“系统推荐”在本窗体中可以选择类别和条件查询相关排名情况。点击“全局视图”共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统点击“修改密码”可以修改当前用户的密码。程序(窗体设计略)1.存储过程用于查询人气排在前20的菜品createprocedure[dbo].[caimu_renqi]asselecttop20*from菜目orderby人气descgo2.触发器(7个)用于实现数据库内部表间的外键约束:1)防止插入菜目时出现不存在的商家trigger[dbo].[插入菜目]on[dbo].[菜目]forinsertas共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统declare@s_nameaschar(20)select@s_name=商家名称frominsertedif@s_namenotin(select商家名称from商家)beginprint"商家不存在"rollbackend2)菜目表中删除时菜目评价表中的联动删除trigger[dbo].[删除菜目]ON[dbo].[菜目]FORDELETEASDECLARE@_snameaschar(20)DECLARE@_cnameaschar(20)select@_sname=d.商家名称,@_cname=d.菜名FROMdeleteddbegindeletefrom菜目评价where商家名称=@_snameand菜名=@_cnamedeletefrom菜目where商家名称=@_snameand菜名=@_cnameprint"已经删除相关信息"end3)菜目表中修改时菜目评价表中的联动修改trigger[dbo].[修改菜目]ON[dbo].[菜目]FORupdateASDECLARE@_snameaschar(20)DECLARE@_cnameaschar(20)DECLARE@_sname_oaschar(20)DECLARE@_cname_oaschar(20)select@_sname=商家名称,@_cname=菜名FROMinsertedselect@_sname_o=商家名称,@_cname_o=菜名FROMdeletedbeginupdate菜目评价set商家名称=@_sname,菜名=@_cnamewhere商家名称=@_sname_oand菜名=@_cname_oprint"已经修改相关信息"end4)菜目表中修改时商家评价表中的联动修改trigger[dbo].[修改菜目]ON[dbo].[菜目]FORupdateASDECLARE@_snameaschar(20)DECLARE@_cnameaschar(20)DECLARE@_sname_oaschar(20)DECLARE@_cname_oaschar(20)select@_sname=商家名称,@_cname=菜名FROMinsertedselect@_sname_o=商家名称,@_cname_o=菜名FROMdeletedbeginupdate菜目评价set商家名称=@_sname,菜名=@_cnamewhere商家名称=@_sname_oand菜名=@_cname_oprint"已经修改相关信息"end5)商家表中修改时菜目表、商家评价表中的联动修改共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统ALTERtrigger[dbo].[修改商家]ON[dbo].[商家]FORupdateASDECLARE@_snameaschar(20)DECLARE@_sname_oaschar(20)select@_sname=商家名称FROMinsertedselect@_sname_o=商家名称FROMdeletedbeginupdate菜目set商家名称=@_snamewhere商家名称=@_sname_oupdate商家评价set商家名称=@_snamewhere商家名称=@_sname_oprint"已经修改相关信息"end6)删除学号时的联动删除ALTERtrigger[dbo].[删除学号]ON[dbo].[用户]FORDELETEASDECLARE@_snameaschar(20)select@_sname=学号FROMdeletedbegindeletefrom用户where学号=@_snamedeletefrom商家评价where学号=@_snamedeletefrom菜目评价where学号=@_snameprint"已经删除相关信息"end7)修改学号时菜目评价表、商家评价表中的联动修改ALTERtrigger[dbo].[修改学号]ON[dbo].[用户]FORupdateASDECLARE@_snameaschar(20)dECLARE@_sname_oaschar(20)select@_sname=学号FROMinsertedselect@_sname_o=学号FROMdeletedbeginupdate菜目评价set学号=@_snamewhere学号=@_sname_oupdate商家评价set学号=@_snamewhere学号=@_sname_oprint"已经修改相关信息"end1.界面程序1)登录窗体PublicClass登录窗体共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统PrivateSub登录窗体_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadAxWindowsMediaPlayer1.settings.setMode("loop",True)AxWindowsMediaPlayer1.URL=Application.StartupPath&"summer久石让.wma"AxWindowsMediaPlayer1.Ctlcontrols.play()playornot=0AxWindowsMediaPlayer1.Visible=FalseDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)EndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"201011020935229213.png")Label1.BackColor=Color.TransparentLabel2.BackColor=Color.TransparentMe.管理员TableAdapter.Fill(Me.嘉食通DataSet.管理员)Me.用户TableAdapter.Fill(Me.嘉食通DataSet.用户)EndSubPrivateSubbutton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickIfTextBox1.Text=NothingOrTextBox2.Text=NothingThenMessageBox.Show("用户名或密码不能为空","提示")ExitSubEndIf管理员TableAdapter.FillBy管理员(嘉食通DataSet.管理员,TextBox1.Text.Trim,TextBox2.Text.Trim)If嘉食通DataSet.管理员.Count=0Then用户TableAdapter.Fillby用户(嘉食通DataSet.用户,TextBox1.Text.Trim,TextBox2.Text.Trim)If嘉食通DataSet.用户.Count=0ThenMessageBox.Show("用户名或密码错误","提示")TextBox2.Text=NothingElse:Dimf2AsNewwelcome当前用户名=Me.TextBox1.Text.TrimMessageBox.Show("登陆成功","欢迎")gly=FalseAxWindowsMediaPlayer1.Ctlcontrols.pause()f2.Show()Me.Hide()EndIfElse:Dimf1AsNewguanliyuangly=Truef1.Show()Me.Hide()EndIfEndSubPrivateSubbutton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickMe.Close()EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimf2AsNew注册页面f2.Show()Me.Hide()共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndSubEndClass2)welcomePublicClasswelcomeDimtimeAsIntegerPrivateSubwelcome_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadMe.StartPosition=FormStartPosition.CenterScreenMe.AutoSize=FalseMe.BackColor=Color.BlackLabel1.ForeColor=Color.WheatAxShockwaveFlash1.Height=300AxShockwaveFlash1.Width=400AxShockwaveFlash1.Left=-5AxShockwaveFlash1.Top=30Me.Height=AxShockwaveFlash1.Height+50Me.Width=AxShockwaveFlash1.WidthAxWindowsMediaPlayer1.Visible=FalseCallflash()Label1.Text="(●点击此处跳过动画)欢迎用户"&当前用户名&"登陆嘉食通美食信息管理系统"Label1.Top=10"Me.Height-Label1.Height-40Label1.Left=Me.WidthTimer1.Enabled=TrueTimer2.Enabled=TrueTimer1.Interval=50Timer2.Interval=1000time=0Label1.BackColor=Color.TransparentButton1.Text="Skip"Button1.Left=Me.Width-Button1.WidthButton1.Top=3Button1.Height=25EndSubPrivateSubflash()AxShockwaveFlash1.Movie=Application.StartupPath&"中国包子大战日本寿司.swf"AxShockwaveFlash1.GotoFrame(0)AxShockwaveFlash1.Play()IfNotAxShockwaveFlash1.IsPlayingThenMsgBox("播放结束")EndIfEndSubPrivateSubmedia()AxWindowsMediaPlayer1.URL=Application.StartupPath&"中国包子大战日本寿司.swf"AxWindowsMediaPlayer1.Ctlcontrols.play()AxWindowsMediaPlayer1.Visible=TrueEndSubPrivateSubAxShockwaveFlash1_Enter(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesAxShockwaveFlash1.EnterEndSubPrivateSubTimer1_Tick(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesTimer1.TickLabel1.Left-=2IfLabel1.Left<=-10-Label1.WidthThenLabel1.Left=Me.Width+10EndIfEndSubPrivateSubLabel1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesLabel1.Click共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统CallfEndSubPrivateSubTimer2_Tick(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesTimer2.Ticktime+=1Iftime=85ThenCallfEndIfEndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickCallf()EndSubPrivateSubf()AxShockwaveFlash1.StopPlay()mainform.Show()"合并时要把此行代码改为用户看到的第一个窗体"Me.Hide()EndSubEndClass3)mainformPublicClassmainformDimtimeAsIntegerPrivateSub信息浏览ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles信息浏览ToolStripMenuItem.ClickDimF1AsNew菜目浏览F1.MdiParent=MeF1.Width=Me.WidthF1.Show()EndSubPrivateSub系统推荐ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles系统推荐ToolStripMenuItem.ClickDimF2AsNew排序筛选F2.MdiParent=MeF2.Width=Me.WidthF2.Show()EndSubPrivateSubwait()time=0Timer1.Enabled=TrueEndSubPrivateSubTimer1_Tick(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesTimer1.Ticktime+=1Iftime=3Then登录窗体.AxWindowsMediaPlayer1.Ctlcontrols.play()EndIfEndSubPrivateSubmainform_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadTimer1.Enabled=FalseTimer1.Interval=1000Callwait()播放ToolStripMenuItem.Image=Image.FromFile(Application.StartupPath&"129100m03620-45294.png")DimF3AsNew菜目浏览F3.MdiParent=MeF3.Width=Me.WidthF3.Show()EndSub共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统PrivateSub退出ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles退出ToolStripMenuItem.ClickApplication.Exit()EndSubPrivateSub用户评价ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles用户评价ToolStripMenuItem.ClickDimF4AsNew用户评价F4.MdiParent=MeF4.Width=Me.WidthF4.Show()EndSubPrivateSub修改密码ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles修改密码ToolStripMenuItem.ClickDimF5AsNew修改密码F5.MdiParent=MeF5.Width=Me.WidthF5.Show()EndSubPrivateSub商家简介ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles商家简介ToolStripMenuItem.ClickDimF6AsNewguanliyuanF6.MdiParent=MeF6.ControlBox=FalseF6.AutoScroll=TrueF6.Width=Me.WidthF6.Show()EndSubPrivateSub全局视图ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles全局视图ToolStripMenuItem.Clickbutview.MdiParent=Mebutview.Show()butview.Label1.Visible=FalseEndSubPrivateSub播放ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles播放ToolStripMenuItem.ClickIfplayornot=0Then登录窗体.AxWindowsMediaPlayer1.Ctlcontrols.pause()播放ToolStripMenuItem.Image=Image.FromFile(Application.StartupPath&"20071279182659.png")playornot=1Else登录窗体.AxWindowsMediaPlayer1.Ctlcontrols.play()播放ToolStripMenuItem.Image=Image.FromFile(Application.StartupPath&"129100m03620-45294.png")playornot=0EndIfEndSubEndClass4)菜目浏览PublicClass菜目浏览PrivateSub信息查询_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.Transparentob.Font=NewSystem.Drawing.Font("宋体",9.0F,FontStyle.Bold)EndIf共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统NextMe.GroupBox1.BackColor=Color.TransparentMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.菜目TableAdapter.Fill(Me.嘉食通DataSet.菜目)Me.顶TableAdapter.Fill(Me.嘉食通DataSet.顶)Me.菜目1TableAdapter.Fill(Me.嘉食通DataSet.菜目1)Me.商家TableAdapter.Fill(Me.嘉食通DataSet.商家)EndSubPrivateSub系统推荐ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Dimf2AsNew排序筛选f2.Show()EndSubPrivateSub用户评价ToolStripMenuItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Dimf3AsNew用户评价f3.Show()EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text.Trim=NothingThenMessageBox.Show("查询内容不能为空")Else菜目TableAdapter.FillBy菜名(Me.嘉食通DataSet.菜目,TextBox1.Text.Trim)DimiAsIntegerFori=0ToMe.菜目1DataGridView.Rows.Count-1IfMe.菜目1DataGridView.Rows(i).Cells(0).ValueLikeMe.菜目DataGridView.Rows(菜目BindingSource.Position).Cells(0).ValueThen菜目1BindingSource.Position=iExitForEndIfNextIfi=菜目1DataGridView.Rows.CountThenMsgBox("没找到")TextBox1.Text=""EndIfEndIfEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Clickcname=Me.菜名TextBox.Text.Trimsname=Me.商家名称TextBox.Text.TrimDimf4AsNew用户评价f4.MdiParent=Me.MdiParentf4.Show()Me.Hide()EndSubPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.Click菜目TableAdapter.FillBy商家名称(Me.嘉食通DataSet.菜目,ComboBox1.Text.Trim)DimiAsIntegerFori=0ToMe.菜目1DataGridView.Rows.Count-1IfMe.菜目1DataGridView.Rows(i).Cells(0).ValueLikeMe.菜目DataGridView.Rows(菜目BindingSource.Position).Cells(0).ValueThen菜目1BindingSource.Position=iExitForEndIfNext共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndSubPrivateSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.Click菜目1BindingSource.MoveFirst()EndSubPrivateSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton5.Click菜目1BindingSource.MovePrevious()EndSubPrivateSubButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton6.Click菜目1BindingSource.MoveNext()EndSubPrivateSubButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton7.Click菜目1BindingSource.MoveLast()EndSubPrivateSubButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton8.ClickIfTextBox2.Text=NothingOrTextBox3.Text=NothingOrTextBox4.Text=NothingThenMessageBox.Show("请完整输入评分","")EndIfIfNotIsNumeric(TextBox2.Text)OrNotIsNumeric(TextBox3.Text)OrNotIsNumeric(TextBox4.Text)ThenMessageBox.Show("评分应为数字","")ElseIfTextBox2.Text.Trim<0OrTextBox2.Text.Trim>100OrTextBox3.Text.Trim<0OrTextBox3.Text.Trim>100OrTextBox4.Text.Trim<0OrTextBox4.Text.Trim>100ThenMessageBox.Show("评分应为0-100的数字","")Else菜目1TableAdapter.UpdateQuery评分(TextBox3.Text.Trim,TextBox4.Text.Trim,TextBox2.Text.Trim,菜名TextBox.Text.Trim,商家名称TextBox.Text.Trim)MessageBox.Show("评分成功","")TextBox3.Text=NothingTextBox4.Text=NothingTextBox2.Text=NothingEndIfEndSubPrivateSubButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton9.ClickMe.顶TableAdapter.FillBy是否存在(Me.嘉食通DataSet.顶,Me.菜名TextBox.Text.Trim,Me.商家名称TextBox.Text.Trim,当前用户名)IfMe.嘉食通DataSet.顶.Count=0Then顶TableAdapter.InsertQuery是否顶过(菜名TextBox.Text.Trim,商家名称TextBox.Text.Trim,当前用户名)菜目1TableAdapter.UpdateQuery顶(菜名TextBox.Text.Trim,商家名称TextBox.Text.Trim)人气TextBox.Text+=1ElseMessageBox.Show("您已经顶过")EndIfEndSubPrivateSubButton10_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton10.ClickDimkAsIntegerk=菜目BindingSource.Position菜目BindingSource.Position+=1If菜目BindingSource.Position=kThenMsgBox("没有了")ElseDimiAsInteger共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统Fori=0ToMe.菜目1DataGridView.Rows.Count-1IfMe.菜目1DataGridView.Rows(i).Cells(0).ValueLikeMe.菜目DataGridView.Rows(菜目BindingSource.Position).Cells(0).ValueThen菜目1BindingSource.Position=iExitForEndIfNextEndIfEndSubPrivateSubGroupBox1_Enter(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesGroupBox1.EnterEndSubEndClass5)排序筛选PublicClass排序筛选PrivateSub排序筛选_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadMe.Caimu_renqiTableAdapter.Fill(Me.嘉食通DataSet.caimu_renqi)DimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.Transparentob.Font=NewSystem.Drawing.Font("宋体",9.0F,FontStyle.Bold)"字体EndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")"背景图片Me.菜目1TableAdapter.Fill(Me.嘉食通DataSet.菜目1)Me.菜目TableAdapter.Fill(Me.嘉食通DataSet.菜目)EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfComboBox2.Text.Trim=NothingOrComboBox1.Text.Trim=NothingThenMessageBox.Show("请选择排列条件","提示")EndIfIfComboBox1.Text.Trim="全部"ThenIfComboBox2.Text.Trim="价格"ThenMe.菜目TableAdapter.FillBy价格1(Me.嘉食通DataSet.菜目)EndIfIfComboBox2.Text.Trim="价格评分"ThenMe.菜目TableAdapter.FillBy价格评分1(Me.嘉食通DataSet.菜目)EndIfIfComboBox2.Text.Trim="卫生评分"ThenMe.菜目TableAdapter.FillBy卫生评分1(Me.嘉食通DataSet.菜目)EndIfIfComboBox2.Text.Trim="口味评分"ThenMe.菜目TableAdapter.FillBy口味评分1(Me.嘉食通DataSet.菜目)EndIfElseIfComboBox2.Text.Trim="价格"ThenMe.菜目TableAdapter.FillBy价格(Me.嘉食通DataSet.菜目,ComboBox1.Text.Trim)EndIfIfComboBox2.Text.Trim="价格评分"ThenMe.菜目TableAdapter.FillBy价格评分(Me.嘉食通DataSet.菜目,ComboBox1.Text.Trim)EndIfIfComboBox2.Text.Trim="卫生评分"ThenMe.菜目TableAdapter.FillBy卫生评分(Me.嘉食通DataSet.菜目,ComboBox1.Text.Trim)共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndIfIfComboBox2.Text.Trim="口味评分"ThenMe.菜目TableAdapter.FillBy口味评分(Me.嘉食通DataSet.菜目,ComboBox1.Text.Trim)EndIfEndIfEndSubEndClass6)评价窗体1PublicClass评价窗体1PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text.Trim=NothingThenMessageBox.Show("请输入评价内容","")ElseMe.菜目评价TableAdapter.InsertQuery菜目评价(cname,sname,当前用户名,TextBox1.Text.Trim)MessageBox.Show("评价成功")Me.Hide()EndIfEndSubPrivateSubd评价窗体1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.菜目评价TableAdapter.Fill(Me.嘉食通DataSet.菜目评价)EndSubEndClass7)评价窗体2PublicClass评价窗体2PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text.Trim=NothingThenMessageBox.Show("请输入评价内容","")ElseMe.商家评价TableAdapter.InsertQuery评商家(sname,当前用户名,TextBox1.Text.Trim)MessageBox.Show("评价成功")Me.Hide()EndIfEndSubPrivateSubd评价窗体2_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.商家评价TableAdapter.Fill(Me.嘉食通DataSet.商家评价)EndSubEndClass8)修改密码PublicClass修改密码PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click用户TableAdapter.Fillby用户(嘉食通DataSet.用户,当前用户名,TextBox1.Text.Trim)IfNotTextBox2.Text.Trim=TextBox3.Text.TrimThenTextBox3.Text=NothingTextBox2.Text=NothingMessageBox.Show("两次密码不一致","提示")ElseIf嘉食通DataSet.用户.Count=0ThenMessageBox.Show("密码错误,请重新输入","提示")TextBox1.Text=NothingElse共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统Try用户TableAdapter.UpdateQuery修改密码(TextBox2.Text,当前用户名)MessageBox.Show("修改成功","提示")CatchexAsExceptionMessageBox.Show(ex.Message)ExitSubEndTryEndIfTextBox1.Text=NothingTextBox2.Text=NothingTextBox3.Text=NothingEndSubPrivateSub修改密码_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.TransparentEndIfNextMe.GroupBox1.BackColor=Color.TransparentMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")EndSubEndClass9)用户评价PublicClass用户评价PrivateSub用户评价_Activated(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.Activated用户评价_Load(sender,e)EndSubPrivateSub用户评价_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadMe.Caimu_renqiTableAdapter.Fill(Me.嘉食通DataSet.caimu_renqi)DimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.TransparentEndIfNextMe.GroupBox1.BackColor=Color.TransparentMe.GroupBox2.BackColor=Color.TransparentMe.GroupBox3.BackColor=Color.TransparentMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.菜目TableAdapter.Fill(Me.嘉食通DataSet.菜目)Me.菜目1TableAdapter.Fill(Me.嘉食通DataSet.菜目1)Me.商家TableAdapter.Fill(Me.嘉食通DataSet.商家)Me.商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,商家名称TextBox1.Text.Trim)a=Me.GroupBox2.Locationb=Me.GroupBox3.LocationIfNotcname=NothingThen菜目1TableAdapter.FillBy菜名2(Me.嘉食通DataSet.菜目1,cname,sname)DimiAsIntegerFori=0ToMe.菜目DataGridView.Rows.Count-1共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统IfMe.菜目DataGridView.Rows(i).Cells(0).ValueLikeMe.菜目1DataGridView.Rows(菜目1BindingSource.Position).Cells(0).ValueThen菜目BindingSource.Position=iExitForEndIfNext菜目评价TableAdapter.FillBy菜名1(Me.嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim,商家名称TextBox.Text.Trim)ElseMe.菜目TableAdapter.Fill(Me.嘉食通DataSet.菜目)菜目评价TableAdapter.FillBy菜名1(Me.嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim,商家名称TextBox.Text.Trim)EndIfEndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Clicksname=商家名称TextBox.Text.Trimcname=菜名TextBox.Text.TrimDimf1AsNew评价窗体1()f1.Show()EndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Click菜目评价BindingSource.MoveFirst()EndSubPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.Click菜目评价BindingSource.MovePrevious()EndSubPrivateSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.Click菜目评价BindingSource.MoveNext()EndSubPrivateSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton5.Click菜目评价BindingSource.MoveLast()EndSubPrivateSubButton11_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton11.Click商家评价BindingSource.MoveFirst()EndSubPrivateSubButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton8.Click商家评价BindingSource.MovePrevious()EndSubPrivateSubButton10_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton10.Click商家评价BindingSource.MoveNext()EndSubPrivateSubButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton9.Click商家评价BindingSource.MoveLast()EndSubPrivateSubButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton7.Clicksname=商家名称TextBox1.Text.TrimDimF1AsNew评价窗体2F1.Show()EndSubPrivateSubButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统Button6.ClickIfRadioButton1.Checked=TrueThen菜目DataGridView.Visible=TrueGroupBox2.Location=aGroupBox3.Location=bIfTextBox1.Text.Trim=NothingThenMessageBox.Show("查询内容不能为空")EndIf菜目1TableAdapter.FillBy菜名(嘉食通DataSet.菜目1,TextBox1.Text.Trim)DimiAsIntegerFori=0ToMe.菜目DataGridView.Rows.Count-1IfMe.菜目DataGridView.Rows(i).Cells(0).ValueLikeMe.菜目1DataGridView.Rows(菜目1BindingSource.Position).Cells(0).ValueThen菜目BindingSource.Position=iExitForEndIfNext菜目评价TableAdapter.FillBy菜名(嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim)If嘉食通DataSet.菜目评价.Count=0ThenMessageBox.Show("没有找到相应评价","提示")EndIfEndIfEndSubPrivateSubButton12_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton12.Click菜目BindingSource.MovePrevious()菜目评价TableAdapter.FillBy菜名(嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim)EndSubPrivateSubButton13_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton13.Click菜目BindingSource.MoveNext()菜目评价TableAdapter.FillBy菜名(嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim)EndSubPrivateSubButton14_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton14.Click商家BindingSource.MovePrevious()商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,商家名称TextBox1.Text.Trim)EndSubPrivateSubButton15_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton15.Click商家BindingSource.MoveNext()商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,商家名称TextBox1.Text.Trim)EndSubPrivateSubButton16_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton16.Click菜目BindingSource.MoveFirst()菜目评价TableAdapter.FillBy菜名(嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim)EndSubPrivateSubButton19_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton19.Click菜目BindingSource.MoveLast()菜目评价TableAdapter.FillBy菜名(嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim)EndSubPrivateSubButton17_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton17.Click商家BindingSource.MoveFirst()商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,商家名称TextBox1.Text.Trim)EndSub共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统PrivateSubButton18_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton18.Click商家BindingSource.MoveLast()商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,商家名称TextBox1.Text.Trim)EndSubPrivateSubComboBox1_SelectedIndexChanged(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesComboBox1.SelectedIndexChanged商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,ComboBox1.Text.Trim)If嘉食通DataSet.商家评价.Count=0ThenMessageBox.Show("没有相关评价")EndIfEndSubPrivateSubRadioButton1_CheckedChanged(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesRadioButton1.CheckedChanged菜目DataGridView.Visible=TrueGroupBox2.Location=aGroupBox3.Location=bEndSubPrivateSubRadioButton2_CheckedChanged(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesRadioButton2.CheckedChanged菜目DataGridView.Visible=FalseGroupBox2.Location=bGroupBox3.Location=aEndSubPrivateSub菜名TextBox_TextChanged(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles菜名TextBox.TextChanged菜目评价TableAdapter.FillBy菜名(嘉食通DataSet.菜目评价,菜名TextBox.Text.Trim)EndSubPrivateSub商家名称TextBox1_TextChanged(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles商家名称TextBox1.TextChanged商家评价TableAdapter.FillBy商家名称(嘉食通DataSet.商家评价,商家名称TextBox1.Text.Trim)EndSubEndClass10)注册页面PublicClass注册页面PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Dimf0AsNew登录窗体f0.Show()Me.Close()EndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)IfNotIsNumeric(TextBox1.Text.Trim)ThenMessageBox.Show("学号应为数字","提示")ElseIfTextBox2.Text=NothingOrTextBox3.Text=NothingOrTextBox3.Text=NothingThenMessageBox.Show("请完整输入","提示")ElseIfNotTextBox4.Text.Trim=TextBox3.Text.TrimThenTextBox3.Text=NothingTextBox2.Text=NothingMessageBox.Show("两次密码不一致","提示")Else用户TableAdapter.FillBy学号1(Me.嘉食通DataSet.用户,TextBox1.Text.Trim)IfMe.嘉食通DataSet.用户.Count=0ThenTry用户TableAdapter.InsertQuery用户(TextBox1.Text.Trim,TextBox2.Text.Trim,TextBox3.Text.Trim)MessageBox.Show("注册成功","提示")CatchexAsExceptionMessageBox.Show(ex.Message)ExitSub共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndTryElse:MessageBox.Show("已经存在该用户")EndIfEndIfEndSubPrivateSub注册页面_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)"字体EndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"201011020935229213.png")Label1.BackColor=Color.TransparentLabel2.BackColor=Color.TransparentLabel3.BackColor=Color.TransparentLabel4.BackColor=Color.TransparentMe.用户TableAdapter.Fill(Me.嘉食通DataSet.用户)EndSubPrivateSubLabel1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesLabel1.ClickEndSubPrivateSubButton1_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click登录窗体.Show()Me.Close()EndSubPrivateSubButton2_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickIfNotIsNumeric(TextBox1.Text.Trim)ThenMessageBox.Show("学号应为数字","提示")ElseIfTextBox2.Text=NothingOrTextBox3.Text=NothingOrTextBox3.Text=NothingThenMessageBox.Show("请完整输入","提示")ElseIfNotTextBox4.Text.Trim=TextBox3.Text.TrimThenTextBox3.Text=NothingTextBox2.Text=NothingMessageBox.Show("两次密码不一致","提示")Else用户TableAdapter.FillBy学号1(Me.嘉食通DataSet.用户,TextBox1.Text.Trim)IfMe.嘉食通DataSet.用户.Count=0ThenTry用户TableAdapter.InsertQuery用户(TextBox1.Text.Trim,TextBox2.Text.Trim,TextBox3.Text.Trim)MessageBox.Show("注册成功","提示")CatchexAsExceptionMessageBox.Show(ex.Message)ExitSubEndTryElse:MessageBox.Show("已经存在该用户")EndIfEndIfEndSubEndClass11)adddatatreePublicClassadddatatreePrivateSubadddatatree_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Handles共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统MyBase.LoadMe.菜目TableAdapter.Fill(Me.嘉食通DataSet.菜目)Caimu_fenleiTableAdapter.Connection=cnnDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)"字体EndIfIfobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.TransparentEndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")TreeView1.ExpandAll()Me.Button1.Text="返回"EndSubPrivateSubTreeView1_AfterSelect()EndSubPrivateSubTreeView1_AfterSelect(ByValsenderAsSystem.Object,ByValeAsSystem.Windows.Forms.TreeViewEventArgs)HandlesTreeView1.AfterSelectCaimu_fenleiTableAdapter.Connection=cnnCaimu_fenleiTableAdapter.Fill(嘉食通DataSet.caimu_fenlei,TreeView1.SelectedNode.Text.Trim)Caimu_fenleiDataGridView.DataSource=BindingSource1EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Clickguanliyuan2.Show()Me.Close()EndSubEndClass12)butviewPublicClassbutviewDimkAsInteger,liegeshuAsIntegerDimtable1AsNew嘉食通DataSet.商家DataTableDimsumpicAsIntegerDimmleftAsInteger,mtopAsInteger,mheightAsInteger,mwidthAsIntegerPrivateSubbutview_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",12.0F,FontStyle.Bold)"字体EndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.商家TableAdapter.Fill(Me.嘉食通DataSet.商家)Me.商家TableAdapter.Fill(Me.嘉食通DataSet.商家)table1=商家TableAdapter.GetDataIftable1.Rows.Count=0ThenMsgBox("没读到数据")EndIf共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统sumpic=嘉食通DataSet.商家.Countliegeshu=4Me.Width=liegeshu*160+(liegeshu+1)*40Me.Height=3*120+5*30Label1.BackColor=Color.TransparentButton1.Text="返回"Button1.Left=Me.Width-Button1.WidthDimbut(sumpic)AsButtonDimlab(sumpic)AsLabelForMe.k=0Tosumpic-1but(k)=NewButtonlab(k)=NewLabelbut(k).Left=(kModliegeshu)*(160+40)+40"列间距but(k).Top=(kliegeshu)*(120+30)+30"行间距but(k).Height=120"照片大小but(k).Width=160Me.Controls.Add(but(k))lab(k).Text=table1.Rows(k)("商家名称")lab(k).Left=but(k).Leftlab(k).Top=but(k).Top+but(k).Heightlab(k).BackColor=Color.TransparentMe.Controls.Add(lab(k))Dimb()AsByteTryb=table1.Rows(k)("图片")CatchexAsExceptionb=NothingEndTryTryDimsAsNewSystem.IO.MemoryStream(b)but(k).BackgroundImage=Image.FromStream(s)but(k).BackgroundImageLayout=ImageLayout.StretchCatchexAsSystemExceptionbut(k).BackgroundImage=Nothingbut(k).Text="(暂无照片)"EndTryNextLabel1.Text="(已经到底了,点击返回)"Label1.Top=but(sumpic-1).Top+but(sumpic-1).Height+20Label1.Left=(Me.Width-Label1.Width)/2Timer1.Enabled=FalseEndSubPrivateSubTimer1_Tick(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesTimer1.TickEndSubPrivateSubLabel1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesLabel1.ClickCallback()EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickCallback()EndSubEndClass13)guanliyuanPublicClassguanliyuanDimiAsIntegerPrivateSubguanliyuan_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统sjmc="悸动"DimobAsControlDimobtypeAsStringIfgly=TrueThen"管理员界面ForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)"字体EndIfIfobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.Transparentob.AutoSize=TrueEndIfNextElseForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.Transparentob.Font=NewSystem.Drawing.Font("宋体",9.0F,FontStyle.Bold)"字体EndIfNextEndIfMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.StartPosition=FormStartPosition.CenterScreenMe.商家TableAdapter.Fill(嘉食通DataSet.商家)Me.Button1.Text="查询"Me.Button2.Text="查看该商家的菜目"Me.Button3.Text="查看该商家的评价"Me.Button4.Text="添加路径"Me.Button5.Text="全局视图"Me.Label1.Text="方式一:"Me.Label2.Text="方式二:"GroupBox1.BackColor=Color.TransparentGroupBox1.Left=103"图片PictureBox.LeftGroupBox1.Top=38Button5.Left=Me.Width-Button5.Width-10Button5.Top=30ForMe.i=0To嘉食通DataSet.商家.Count-1ComboBox1.Items.Add(嘉食通DataSet.商家.Rows(i).Item(0))NextiComboBox1.SelectedText="选择商家名称"TextBox1.Text="输入名称查询"Button6.Image=Image.FromFile(Application.StartupPath&"129100m03620-45294.png")Button6.BackgroundImageLayout=ImageLayout.Stretch图片PictureBox.SizeMode=PictureBoxSizeMode.StretchImage图片PictureBox.Width=440图片PictureBox.Height=330Button4.Left=图片PictureBox.Left+图片PictureBox.Width-Button4.WidthButton4.Top=图片PictureBox.Top+图片PictureBox.Height+10ToolStripButton2.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton3.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton4.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton5.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton6.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton7.DisplayStyle=ToolStripItemDisplayStyle.Text共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统ToolStripButton8.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton9.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton2.Text="首记录"ToolStripButton3.Text="上一记录"ToolStripButton4.Text="下一记录"ToolStripButton5.Text="末记录"ToolStripButton6.Text="新添"ToolStripButton7.Text="保存"ToolStripButton8.Text="删除"ToolStripButton9.Text="退出"Ifgly=FalseThen"用户不可见的按钮ToolStripButton6.Visible=FalseToolStripButton7.Visible=FalseToolStripButton8.Visible=FalseToolStripButton9.Visible=FalseButton2.Visible=FalseButton2.Enabled=FalseButton3.Visible=FalseButton3.Enabled=FalseButton4.Visible=FalseButton5.Visible=FalseButton6.Visible=FalseMe.Width=400Me.图片PictureBox.Left=Me.商家名称TextBox.Left+Me.商家名称TextBox.Width+20Me.图片PictureBox.Top=Me.商家名称TextBox.TopMe.图片PictureBox.Height=150Me.图片PictureBox.Width=200EndIfsjmc_ori=商家名称TextBox.Text.TrimEndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text=""OrTextBox1.Text="输入名称查询"ThenMsgBox("请输入查询内容")EndIfTryMe.商家TableAdapter.FillBy(嘉食通DataSet.商家,TextBox1.Text)CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTrysjmc_ori=Me.商家名称TextBox.Text.TrimEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Clicksjmc=""sjmc=Me.商家名称TextBox.Text.TrimCallcf12()EndSubPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.Clicksjmc=""sjmc=Me.商家名称TextBox.Text.TrimCallcf14()EndSubPrivateSubComboBox1_SelectedIndexChanged(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesComboBox1.SelectedIndexChangedMe.TextBox1.Text=ComboBox1.SelectedItemEndSubPrivateSubToolStripButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统HandlesToolStripButton2.Click商家BindingSource.MoveFirst()"首记录EndSubPrivateSubToolStripButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton9.ClickIfMessageBox.Show("退出前保存数据吗?","提示",MessageBoxButtons.YesNo)=Windows.Forms.DialogResult.YesThenCallsave()EndElseEndEndIfEndSubPrivateSubToolStripButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton3.Click商家BindingSource.MovePrevious()"上一记录EndSubPrivateSubToolStripButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton4.Click商家BindingSource.MoveNext()"下一记录EndSubPrivateSubToolStripButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton5.Click商家BindingSource.MoveLast()"末记录EndSubPrivateSubToolStripButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton6.Click商家BindingSource.AddNew()"新增记录IfMessageBox.Show("真的插入记录吗?","提示",MessageBoxButtons.YesNo)=Windows.Forms.DialogResult.YesThenCallf5()sjmc=InputBox("输入要插入的商家名称")jj=InputBox("输入要插入的商家的简介")dh=InputBox("输入要插入的商家的电话")商家名称TextBox.Text=sjmc简介TextBox.Text=jj电话TextBox.Text=dhTry商家TableAdapter.InsertQuery(sjmc,jj,dh)CatchexAsExceptionMessageBox.Show(ex.Message)ExitSubEndTryEndIfEndSubPrivateSubToolStripButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton8.ClickIfMessageBox.Show("真的删除吗?","提示",MessageBoxButtons.YesNo)=Windows.Forms.DialogResult.YesThensjmc=商家名称TextBox.TextTry商家TableAdapter.DeleteQuery(sjmc)CatchexAsExceptionMessageBox.Show(ex.Message)ExitSubEndTryComboBox1.Items.Remove(商家名称TextBox.Text)TextBox1.Text=""商家BindingSource.RemoveCurrent()共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndIfEndSubPrivateSubToolStripButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton7.Click商家BindingSource.EndEdit()"保存Callsave()EndSubPublicSubsave()sjmc=商家名称TextBox.Textjj=简介TextBox.Textdh=电话TextBox.TextTryMe.商家TableAdapter.UpdateQuery(sjmc_ori,jj,dh)MessageBox.Show("已保存")CatchexAsExceptionMessageBox.Show(ex.Message)EndTryEndSubPrivateSubf5()商家名称TextBox.Text=""简介TextBox.Text=""电话TextBox.Text=""EndSubDimtable1AsNew嘉食通DataSet.商家DataTableDimb()AsBytePrivateSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton5.Clickbutview.Show()EndSubrivateSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.Clicktable1.Clear()sjmc=商家名称TextBox.Text.Trimtable1=商家TableAdapter.GetDataBy4(sjmc)Iftable1.Rows.Count=0ThenMessageBox.Show("没有这个商家!")图片PictureBox.Image=Nothing"清除原有内容2TextBox1.Focus()ExitSubEndIfOpenFileDialog1.Filter="JEPG文件(*.Jpg)|*.Jpg|Bmp文件(*.Bmp)|*.Bmp|AllFiles(*.*)|*.*"IfOpenFileDialog1.ShowDialog()=DialogResult.OKThen图片PictureBox.Image=Image.FromFile(OpenFileDialog1.FileName)"放入图片2ElseExitSubEndIfDimmyimageAsNewSystem.IO.FileStream(OpenFileDialog1.FileName,IO.FileMode.Open,IO.FileAccess.Read)Dimb(myimage.Length)AsBytemyimage.Read(b,0,myimage.Length)myimage.Close()myimage=Nothingtable1.Rows(0).Item("图片")=b"数组内容赋给表的照片属性TryMe.商家TableAdapter.Updatephoto(b,sjmc)"Callsave()"照片更新到数据库CatchexAsExceptionMessageBox.Show(ex.Message)ExitSub共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndTryEndSubPrivateSubappendphoto_Load()商家TableAdapter.Connection=cnn"指定表适配器的服务器连接商家TableAdapter.Fill(嘉食通DataSet.商家)EndSubPrivateSubdispimage(ByValnumAsInteger)Tryb=table1.Rows(num)("图片")CatchexAsException"MessageBox.Show("无照片")ExitSubEndTry"传送数组B中内容到MemoryStream对象SDimSAsNewSystem.IO.MemoryStream(b)Try图片PictureBox.Image=Image.FromStream(S)CatchexAsSystemException图片PictureBox.Image=Nothing图片PictureBox.Text="无图片"EndTryEndSubPrivateSubButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton6.ClickIfplayornot=0Then登录窗体.AxWindowsMediaPlayer1.Ctlcontrols.pause()Button6.Image=Image.FromFile(Application.StartupPath&"20071279182659.png")playornot=1Else登录窗体.AxWindowsMediaPlayer1.Ctlcontrols.play()Button6.Image=Image.FromFile(Application.StartupPath&"129100m03620-45294.png")playornot=0EndIfEndSubEndClass14)guanliyuan2PublicClassguanliyuan2PrivateSub菜目2BindingNavigatorSaveItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Me.Validate()Me.菜目2BindingSource.EndEdit()Me.TableAdapterManager.UpdateAll(Me.嘉食通DataSet)EndSubPrivateSubguanliyuan2_Activated(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.Activatedguanliyuan2_Load(sender,e)EndSubPrivateSubguanliyuan2_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadDimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)"字体EndIfIfobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.TransparentEndIfNext共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统Me.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.菜目2TableAdapter.Fill(Me.嘉食通DataSet.菜目2)Me.StartPosition=FormStartPosition.CenterScreenMe.菜目2TableAdapter.Fill(Me.嘉食通DataSet.菜目2)Me.Button1.Text="查询"Me.Button2.Text="编辑该菜目的评价"Me.Label1.Text="按菜目名称查询"Button3.Left=Me.Width-Button3.Width-10Button3.Top=30Me.Button3.Text="所有菜目"&vbCrLf&"分类浏览"Me.Button3.Font=NewSystem.Drawing.Font("宋体",10.0F,FontStyle.Bold)"字体TryMe.菜目2TableAdapter.FillBy22(Me.嘉食通DataSet.菜目2,sjmc&"%")CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTryToolStripButton2.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton3.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton4.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton5.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton6.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton7.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton8.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton9.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton2.Text="首记录"ToolStripButton3.Text="上一记录"ToolStripButton4.Text="下一记录"ToolStripButton5.Text="末记录"ToolStripButton6.Text="新添"ToolStripButton7.Text="保存"ToolStripButton8.Text="删除"ToolStripButton9.Text="返回"EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text=""ThenMsgBox("请输入查询内容")EndIfTryMe.菜目2TableAdapter.FillBy2(Me.嘉食通DataSet.菜目2,TextBox1.Text,sjmc)CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTryEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Clickcm=""cm=Me.菜名TextBox.Text.TrimCallcf23()EndSubPrivateSubToolStripButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton2.Click菜目2BindingSource.MoveFirst()"首记录EndSubPrivateSubToolStripButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton9.ClickCallcf21()共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndSubPrivateSubToolStripButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton3.Click菜目2BindingSource.MovePrevious()"上一记录EndSubPrivateSubToolStripButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton4.Click菜目2BindingSource.MoveNext()"下一记录EndSubPrivateSubToolStripButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton5.Click菜目2BindingSource.MoveLast()"末记录EndSubPrivateSubToolStripButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton6.Click菜目2BindingSource.AddNew()"新增记录EndSubPrivateSubToolStripButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton8.Click菜目2BindingSource.RemoveCurrent()EndSubPrivateSubToolStripButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton7.Click菜目2BindingSource.EndEdit()EndSubPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.Clickadddatatree.Show()Me.Hide()EndSubEndClass15)guanliyuan3PublicClassguanliyuan3PrivateSub菜目评价BindingNavigatorSaveItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Me.Validate()Me.菜目评价BindingSource.EndEdit()Me.TableAdapterManager.UpdateAll(Me.嘉食通DataSet)EndSubPrivateSubguanliyuan3_Activated(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.Activatedguanliyuan3_Load(sender,e)EndSubPrivateSubguanliyuan3_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load"界面设置DimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)"EndIfIfobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.TransparentEndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg"Me.StartPosition=FormStartPosition.CenterScreen共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统Me.菜目评价TableAdapter.Fill(Me.嘉食通DataSet.菜目评价)Me.Button1.Text="查询"Me.Label1.Text="按学号查询"TryMe.菜目评价TableAdapter.FillBy33(Me.嘉食通DataSet.菜目评价,cm&"%",sjmc&"%")CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTryToolStripButton2.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton3.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton4.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton5.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton6.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton7.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton8.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton9.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton2.Text="首记录"ToolStripButton3.Text="上一记录"ToolStripButton4.Text="下一记录"ToolStripButton5.Text="末记录"ToolStripButton6.Text="新添"ToolStripButton7.Text="保存"ToolStripButton8.Text="删除"ToolStripButton9.Text="返回"EndSubPrivateSubToolStripButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Callcf32()EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text=""ThenMsgBox("请输入查询内容")EndIfTryMe.菜目评价TableAdapter.FillBy3(Me.嘉食通DataSet.菜目评价,sjmc&"%",cm&"%",TextBox1.Text.Trim()&Mid("______",1,6-TextBox1.Text.Trim().Length))CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTryEndSubPrivateSubToolStripButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton2.Click菜目评价BindingSource.MoveFirst()"首记录EndSubPrivateSubToolStripButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton9.ClickCallcf32()EndSubPrivateSubToolStripButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton3.Click菜目评价BindingSource.MovePrevious()"上一记录EndSubPrivateSubToolStripButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton4.Click菜目评价BindingSource.MoveNext()"下一记录EndSubPrivateSubToolStripButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton5.Click菜目评价BindingSource.MoveLast()"末记录共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统EndSubPrivateSubToolStripButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton6.Click菜目评价BindingSource.AddNew()"新增记录EndSubPrivateSubToolStripButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton8.Click菜目评价BindingSource.RemoveCurrent()EndSubPrivateSubToolStripButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton7.Click菜目评价BindingSource.EndEdit()EndSubEndClass16)guanliyuan4PublicClassguanliyuan4PrivateSub商家评价BindingNavigatorSaveItem_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Me.Validate()Me.商家评价BindingSource.EndEdit()Me.TableAdapterManager.UpdateAll(Me.嘉食通DataSet)EndSubPrivateSubguanliyuan4_Activated(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.Activatedguanliyuan4_Load(sender,e)EndSubPrivateSubguanliyuan4_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load"界面设置DimobAsControlDimobtypeAsStringForEachobInMe.Controlsobtype=ob.GetType().ToString()Ifobtype="System.Windows.Forms.Button"Orobtype="System.Windows.Forms.Label"Thenob.Font=NewSystem.Drawing.Font("宋体",14.0F,FontStyle.Bold)"EndIfIfobtype="System.Windows.Forms.Label"Thenob.BackColor=Color.TransparentEndIfNextMe.BackgroundImage=Image.FromFile(Application.StartupPath&"200810521585848477801.jpg")Me.StartPosition=FormStartPosition.CenterScreenMe.商家评价TableAdapter.Fill(Me.嘉食通DataSet.商家评价)Me.Button1.Text="查询"Me.Label1.Text="按学号查询"TryMe.商家评价TableAdapter.Fillby44(Me.嘉食通DataSet.商家评价,sjmc&"%")CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTryToolStripButton2.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton3.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton4.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton5.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton6.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton7.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton8.DisplayStyle=ToolStripItemDisplayStyle.Text共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统ToolStripButton9.DisplayStyle=ToolStripItemDisplayStyle.TextToolStripButton2.Text="首记录"ToolStripButton3.Text="上一记录"ToolStripButton4.Text="下一记录"ToolStripButton5.Text="末记录"ToolStripButton6.Text="新添"ToolStripButton7.Text="保存"ToolStripButton8.Text="删除"ToolStripButton9.Text="返回"EndSubPrivateSubFillBy4ToolStripButton_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)EndSubPrivateSubFillBy4ToolStrip_ItemClicked(ByValsenderAsSystem.Object,ByValeAsSystem.Windows.Forms.ToolStripItemClickedEventArgs)EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text=""ThenMsgBox("请输入查询学号")EndIfTryMe.商家评价TableAdapter.FillBy4(Me.嘉食通DataSet.商家评价,sjmc&"%",TextBox1.Text.Trim()&Mid("______",1,6-TextBox1.Text.Trim().Length))CatchexAsSystem.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)EndTryEndSubPrivateSubToolStripButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton2.Click商家评价BindingSource.MoveFirst()"首记录EndSubPrivateSubToolStripButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton9.ClickCallcf41()EndSubPrivateSubToolStripButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton3.Click商家评价BindingSource.MovePrevious()"上一记录EndSubPrivateSubToolStripButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton4.Click商家评价BindingSource.MoveNext()"下一记录EndSubPrivateSubToolStripButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton5.Click商家评价BindingSource.MoveLast()"末记录EndSubPrivateSubToolStripButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton6.Click商家评价BindingSource.AddNew()"新增记录IfMessageBox.Show("真的插入记录吗?","提示",MessageBoxButtons.YesNo)=Windows.Forms.DialogResult.YesThenxh=InputBox("输入你的学号")xm=InputBox("输入你的姓名")pjnr=InputBox("输入你的评价")pjsh=Date.Today.Year&Date.Today.Month&Date.Today.Day商家名称TextBox.Text=sjmc评价时间DateTimePicker.Value=pjsh共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统学号TextBox.Text=xh姓名TextBox.Text=xm评价内容TextBox.Text=pjnrTry商家评价TableAdapter.InsertQuery(sjmc,pjsh,xh,xm,pjnr)CatchexAsExceptionMessageBox.Show(ex.Message)ExitSubEndTryEndIfEndSubPrivateSubToolStripButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton8.ClickIfMessageBox.Show("真的删除吗?","提示",MessageBoxButtons.YesNo)=Windows.Forms.DialogResult.YesThensjmc=商家名称TextBox.TextTry商家评价TableAdapter.DeleteQuery(sjmc)CatchexAsExceptionMessageBox.Show(ex.Message)ExitSubEndTry商家评价BindingSource.RemoveCurrent()EndIfEndSubPrivateSubToolStripButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesToolStripButton7.Click商家评价BindingSource.EndEdit()sjmc=商家名称TextBox.Textpjsh=评价时间DateTimePicker.Textxh=学号TextBox.Textxm=姓名TextBox.Textpjnr=评价内容TextBox.TextTryMe.商家评价TableAdapter.UpdateQuery(sjmc,pjsh,xh,xm,pjnr)CatchexAsExceptionMessageBox.Show(ex.Message)EndTryEndSubEndClass系统评述经过几周的努力,系统终于完成了。总的说来,我们的系统还是比较成功的。首先,整个操作系统功能比较完善,充分考虑了用户的使用,并且经过了很多调试,排除了很多异常状况,在功能上实现了多种功能,满足了用户的需求;第二,熟练使用各种方式建立与VB界面与数据库的连接,很好地利用删除触发器解决了修改和删除过程中的问题;第三,采用了MDI容器,使得用户操作显得比较直观和方便;第四,系统添加了背景音乐,和欢迎视频,更人性化。但是由于初学者的一般弊病,也由于时间经验上的不足,系统显然还有不少问题。第一,系统的操作方式存在着不足,操作的衔接上应当更完善;共页第37页 ┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊嘉食通餐饮信息查询系统第二,系统界面较多,界面过于繁杂,系统运行较缓慢;第三,窗体页面布局上由于经验不足,显得结构不清晰,不够简洁,也印影响了美观性。心得体会xxxxxxxx通过一个多月的艰苦奋战,终于完成了这个项目,此刻感到无比的激动和自豪,能有机会接受这样的锻炼是一件好事。首先,通过做这个项目,我更扎实的掌握了SQL语言及数据库知识。初步掌握了利用VB.NET开发程序的方法,了解了VB.NET与数据库连接的方式,对数据库及其部分性质有了更深层次的理解。除了在学习方面的进步,这个项目也进一步增强了我们攻关项目的能力,让我们有机会锻炼自己的分析实践能力以及全情投入、不怕困难的品质。在这个过程之中,我们遇到了很多困难,同时也感受到,真正做一个比较复杂的数据库项目时,我们所学的知识是绝对不够的,这也让我明白,要在今后的工作中取得好的成就,要更加努力的扩充自己,也要多参与到实践的活动中去。Xxxxxxxx一开始得知要做这个数据库大项目的时候还有点摸不着头脑,有点没底,因为自认为对数据库的知识掌握的并不好。但随着项目一步步地进行,主动地或被迫地开始翻书、开始上网查找相关资料来解决问题,在这个过程中我对课堂知识也有了进一步的巩固,对visualstudio这个软件也更熟悉了。另外,在项目制作过程中大量的代码编写、窗体设计、错误调试对于耐心来说是一大挑战,很多次我都想要就此打住,但在过了一段时间后又重新拾起了信心,克服了眼前困难!所以这次项目的制作是挑战并且收获的。分工Xxxxxxx(用户相关页面,数据库建立,触发器设计,撰写报告)Xxxxxxxxx(管理员相关页面,欢迎界面,界面美化,全局浏览页面)共页第37页'